pub fn commit_effects(
        &mut self,
        prestate_hash: Vec<u8>,
        effects: HashMap<contract_ffi::key::Key, Transform>,
    ) -> &mut WasmTestBuilder {
        let commit_request = create_commit_request(&prestate_hash, &effects);

        let commit_response = self
            .engine_state
            .commit(RequestOptions::new(), commit_request)
            .wait_drop_metadata()
            .expect("Should have commit response");
        if !commit_response.has_success() {
            panic!(
                "Expected commit success but received a failure instead: {:?}",
                commit_response
            );
        }
        let commit_success = commit_response.get_success();
        self.post_state_hash = Some(commit_success.get_poststate_hash().to_vec());
        let bonded_validators = commit_success
            .get_bonded_validators()
            .iter()
            .map(|bond| to_domain_validators(bond).unwrap())
            .collect();
        self.bonded_validators.push(bonded_validators);
        self
    }
/// Runs a commit request, expects a successful response, and
/// overwrites existing cached post state hash with a new one.
Runs a commit request, expects a successful response, and
overwrites existing cached post state hash with a new one.
Runs a commit request expects a successful response and overwrites existing cached post state hash with a new one .
pub fn commit_effects(
        &mut self,
        prestate_hash: Vec<u8>,
        effects: HashMap<contract_ffi::key::Key, Transform>,
    ) -> &mut WasmTestBuilder {
        let commit_request = create_commit_request(&prestate_hash, &effects);
        let commit_response = self
            .engine_state
            .commit(RequestOptions::new(), commit_request)
            .wait_drop_metadata()
            .expect("Should have commit response");
        if !commit_response.has_success() {
            panic!(
                "Expected commit success but received a failure instead: {:?}",
                commit_response
            );
        }
        let commit_success = commit_response.get_success();
        self.post_state_hash = Some(commit_success.get_poststate_hash().to_vec());
        let bonded_validators = commit_success
            .get_bonded_validators()
            .iter()
            .map(|bond| to_domain_validators(bond).unwrap())
            .collect();
        self.bonded_validators.push(bonded_validators);
        self
    }
pub fn commit_effects ( & mut self , prestate_hash : Vec < u8 > , effects : HashMap < contract_ffi :: key :: Key , Transform > , ) -> & mut WasmTestBuilder { let commit_request = create_commit_request ( & prestate_hash , & effects ) ; let commit_response = self . engine_state . commit ( RequestOptions :: new ( ) , commit_request ) . wait_drop_metadata ( ) . expect ( " " ) ; if ! commit_response . has_success ( ) { panic ! ( " " commit_response ) ; } let commit_success = commit_response . get_success ( ) ; self . post_state_hash = Some ( commit_success . get_poststate_hash ( ) . to_vec ( ) ) ; let bonded_validators = commit_success . get_bonded_validators ( ) . iter ( ) . map ( | bond | to_domain_validators ( bond ) . unwrap ( ) ) . collect ( ) ; self . bonded_validators . push ( bonded_validators ) ; self }
Runs a commit request, expects a successful response, and
overwrites existing cached post state hash with a new one.
Runs a commit request expects a successful response and overwrites existing cached post state hash with a new one .
&mut self
prestate_hash
Vec<u8>
effects
HashMap<contract_ffi::key::Key, Transform>
&mut self
prestate_hash
Vec<u8>
effects
HashMap<contract_ffi::key::Key, Transform>