pub fn commit_effects(
        &mut self,
        prestate_hash: Vec<u8>,
        effects: AdditiveMap<Key, Transform>,
    ) -> &mut Self {
        let mut commit_response = self.commit_transforms(prestate_hash, effects);
        if !commit_response.has_success() {
            panic!(
                "Expected commit success but received a failure instead: {:?}",
                commit_response
            );
        }
        let mut commit_success = commit_response.take_success();
        self.post_state_hash = Some(commit_success.take_poststate_hash().to_vec());
        let bonded_validators = commit_success
            .take_bonded_validators()
            .into_iter()
            .map(TryInto::try_into)
            .collect::<Result<HashMap<PublicKey, U512>, MappingError>>()
            .unwrap();
        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: AdditiveMap<Key, Transform>,
    ) -> &mut Self {
        let mut commit_response = self.commit_transforms(prestate_hash, effects);
        if !commit_response.has_success() {
            panic!(
                "Expected commit success but received a failure instead: {:?}",
                commit_response
            );
        }
        let mut commit_success = commit_response.take_success();
        self.post_state_hash = Some(commit_success.take_poststate_hash().to_vec());
        let bonded_validators = commit_success
            .take_bonded_validators()
            .into_iter()
            .map(TryInto::try_into)
            .collect::<Result<HashMap<PublicKey, U512>, MappingError>>()
            .unwrap();
        self.bonded_validators.push(bonded_validators);
        self
    }
pub fn commit_effects ( & mut self , prestate_hash : Vec < u8 > , effects : AdditiveMap < Key , Transform > , ) -> & mut Self { let mut commit_response = self . commit_transforms ( prestate_hash , effects ) ; if ! commit_response . has_success ( ) { panic ! ( " " commit_response ) ; } let mut commit_success = commit_response . take_success ( ) ; self . post_state_hash = Some ( commit_success . take_poststate_hash ( ) . to_vec ( ) ) ; let bonded_validators = commit_success . take_bonded_validators ( ) . into_iter ( ) . map ( TryInto :: try_into ) . collect :: < Result < HashMap < PublicKey , U512 > , MappingError > > ( ) . unwrap ( ) ; 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
AdditiveMap<Key, Transform>
&mut self
prestate_hash
Vec<u8>
effects
AdditiveMap<Key, Transform>