fn update_configuration(&mut self, new_block_height: Height) -> Option<Patch> {
        use ConfigurationProposalState::*;

        let actual_from = new_block_height.next();
        if let Some(cfg_proposal) = self.cfg_proposal.take() {
            match cfg_proposal {
                Uncommitted(cfg_proposal) => {
                    // Commit configuration proposal
                    let stored = cfg_proposal.stored_configuration().clone();

                    let mut fork = self.blockchain.fork();
                    CoreSchema::new(&mut fork).commit_configuration(stored);
                    self.cfg_proposal = Some(Committed(cfg_proposal));

                    return Some(fork.into_patch());
                }
                Committed(cfg_proposal) => {
                    if cfg_proposal.actual_from() == actual_from {
                        // Modify the self configuration
                        self.network_mut().update_configuration(cfg_proposal);
                    } else {
                        self.cfg_proposal = Some(Committed(cfg_proposal));
                    }
                }
            }
        }

        None
    }
/// Update test network configuration if such an update has been scheduled
/// with `commit_configuration_change`.
Update test network configuration if such an update has been scheduled
with `commit_configuration_change`.
Update test network configuration if such an update has been scheduled with ` commit_configuration_change ` .
fn update_configuration(&mut self, new_block_height: Height) -> Option<Patch> {
        use ConfigurationProposalState::*;
        let actual_from = new_block_height.next();
        if let Some(cfg_proposal) = self.cfg_proposal.take() {
            match cfg_proposal {
                Uncommitted(cfg_proposal) => {
                    // Commit configuration proposal
                    let stored = cfg_proposal.stored_configuration().clone();
                    let mut fork = self.blockchain.fork();
                    CoreSchema::new(&mut fork).commit_configuration(stored);
                    self.cfg_proposal = Some(Committed(cfg_proposal));
                    return Some(fork.into_patch());
                }
                Committed(cfg_proposal) => {
                    if cfg_proposal.actual_from() == actual_from {
                        // Modify the self configuration
                        self.network_mut().update_configuration(cfg_proposal);
                    } else {
                        self.cfg_proposal = Some(Committed(cfg_proposal));
                    }
                }
            }
        }
        None
    }
fn update_configuration ( & mut self , new_block_height : Height ) -> Option < Patch > { use ConfigurationProposalState :: * ; let actual_from = new_block_height . next ( ) ; if let Some ( cfg_proposal ) = self . cfg_proposal . take ( ) { match cfg_proposal { Uncommitted ( cfg_proposal ) => { // Commit configuration proposal let stored = cfg_proposal . stored_configuration ( ) . clone ( ) ; let mut fork = self . blockchain . fork ( ) ; CoreSchema :: new ( & mut fork ) . commit_configuration ( stored ) ; self . cfg_proposal = Some ( Committed ( cfg_proposal ) ) ; return Some ( fork . into_patch ( ) ) ; } Committed ( cfg_proposal ) => { if cfg_proposal . actual_from ( ) == actual_from { // Modify the self configuration self . network_mut ( ) . update_configuration ( cfg_proposal ) ; } else { self . cfg_proposal = Some ( Committed ( cfg_proposal ) ) ; } } } } None }
Update test network configuration if such an update has been scheduled
with `commit_configuration_change`.
Update test network configuration if such an update has been scheduled with ` commit_configuration_change ` .
&mut self
new_block_height
Height
&mut self
new_block_height
Height