INNER CODE UNIT · Rust
selector_seal
ZpokenWeb3/zk-light-client-implementation · contracts/foundry-hardhat/src/lib.rs:36
let mut selector_seal = Vec::with_capacity(selector.len() + seal.len());
selector_seal.extend_from_slice(selector);
selector_seal.extend_from_slice(&seal);
selector_seal
}
InnerReceipt::Groth16(receipt) => {
let selector = &receipt.verifier_parameters.as_bytes()[..4];
// Create a new vector with the capacity to hold both selector and seal
let mut selector_seal = Vec::with_capacity(selector.len() + receipt.seal.len());
selector_seal.extend_from_slice(selector);
selector_seal.extend_from_slice(receipt.seal.as_ref());
selector_seal
}
_ => bail!("Unsupported receipt type"),
};
Ok(seal)
}