pub fn verify_contract_bytecode_with_configurables(
    contract_id: ContractId,
    ref mut bytecode: Vec<u8>,
    configurables: Vec<(u64, Vec<u8>)>,
) 
Expand description

Asserts that a contract’s bytecode and the given bytecode and configurable values match.

Arguments

  • contract_id: [ContractId] - The contract that the bytecode should match.
  • bytecode: [Vec] - The bytecode of the contract.
  • configurables: [Vec<(u6, Vec)>] - The configurable values to swap.

Reverts

  • When the contract’s bytecode root does not match the passed bytecode.

Examples

use sway_libs::bytecode::verify_contract_bytecode_with_configurables;

fn foo(my_contract_id: ContractId, my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
    let mut my_bytecode = my_bytecode;
    verify_contract_bytecode_with_configurables(my_contract_id, my_bytecode, my_configurables);
    // This line will only be reached if the contract's bytecode root and the computed bytecode root match.
}