pub fn verify_predicate_address_with_configurables(
predicate_id: Address,
ref mut bytecode: Vec<u8>,
configurables: Vec<(u64, Vec<u8>)>,
)
Expand description
Asserts that a predicates’s address from some bytecode and configurables and the given address match.
Arguments
predicate_id
: [Address] - The predicate address that the bytecode should match.bytecode
: [Vec] - The bytecode of the predicate.configurables
: [Vec<(u64, Vec)>] - The configurable values to swap.
Reverts
- When the predicate’s address does not match the passed address.
Examples
use sway_libs::bytecode::verify_predicate_address_with_configurables;
fn foo(my_predicate_id: Address, my_bytecode: Vec<u8>, my_configurables: Vec<(u64, Vec<u8>)>) {
let mut my_bytecode = my_bytecode;
verify_predicate_address_with_configurables(my_predicate_id, my_bytecode, my_configurables);
// This line will only be reached if the predicates's address and the computed address match.
}