pub(super) fn validate_spec_requirements(
    requirements: SpecRequirements,
    instruction: &Instruction,
) {
    assert_eq!(requirements.op, instruction.op);

    // Pass the assert if the minimum referred wc in the spec is met
    assert!(instruction.wc >= requirements.wc);

    if requirements.type_id {
        assert!(instruction.type_id.is_some());
    }

    if requirements.result_id {
        assert!(instruction.result_id.is_some());
    }

    if requirements.operands {
        assert!(!instruction.operands.is_empty());
    }
}
/// Basic validation for checking if the instruction complies to the spec requirements
Basic validation for checking if the instruction complies to the spec requirements
Basic validation for checking if the instruction complies to the spec requirements
pub(super) fn validate_spec_requirements(
    requirements: SpecRequirements,
    instruction: &Instruction,
) {
    assert_eq!(requirements.op, instruction.op);
    // Pass the assert if the minimum referred wc in the spec is met
    assert!(instruction.wc >= requirements.wc);
    if requirements.type_id {
        assert!(instruction.type_id.is_some());
    }
    if requirements.result_id {
        assert!(instruction.result_id.is_some());
    }
    if requirements.operands {
        assert!(!instruction.operands.is_empty());
    }
}
pub ( super ) fn validate_spec_requirements ( requirements : SpecRequirements , instruction : & Instruction , ) { assert_eq ! ( requirements op instruction op ) ; // Pass the assert if the minimum referred wc in the spec is met assert ! ( instruction wc requirements wc ) ; if requirements . type_id { assert ! ( instruction type_id is_some ( ) ) ; } if requirements . result_id { assert ! ( instruction result_id is_some ( ) ) ; } if requirements . operands { assert ! ( instruction operands is_empty ( ) ) ; } }
Basic validation for checking if the instruction complies to the spec requirements
Basic validation for checking if the instruction complies to the spec requirements
requirements
SpecRequirements
instruction
&Instruction
requirements
SpecRequirements
instruction
&Instruction