check_edition_constructor_requirements

Function check_edition_constructor_requirements 

Source
pub fn check_edition_constructor_requirements<N: Network>(
    programs: &[(Program<N>, Edition)],
    consensus_version: ConsensusVersion,
    action: &str,
) -> Result<(), CliError>
Expand description

Checks if any programs violate edition/constructor requirements.

Programs at edition 0 without a constructor cannot be executed after ConsensusVersion::V8. This check should be performed before attempting execution to provide a clear error message.

§Arguments

  • programs - Slice of (program, edition) tuples to check
  • consensus_version - The current consensus version
  • action - Description of the action being attempted (e.g., “deploy”, “execute”, “upgrade”)

§Returns

Ok(()) if all programs pass the check, or an error with a descriptive message if not.