/// Verify the results (and potentially update some internal state with the
/// state from the NNS).
Verify the results (and potentially update some internal state with the
state from the NNS).
Verify the results ( and potentially update some internal state with the state from the NNS ) .
fn verify_results(&mut self, op_results: &[OperationResult]) {
        for op_result in op_results {
            match op_result {
                OperationResult::LedgerTransfer { id, result } => {
                    if result.is_err() {
                        // A ledger transfer failed. Get the balance of that
                        // account before panicking with the failure.
                        let balance_op = Operation::GetAccountBalance {
                            id: 0,
                            account: self.generator.state.accounts.get(id).unwrap().clone(),
                        };
                        self.driver.execute_operations(vec![balance_op]);
                        let balance_res = self.driver.collect_results(1)[0].clone();
                        panic!(
                            "Test failed on ledger transfer operation {} with error: {}.\
                             Account balance: {:?}\
                             Test started with params: {:?}\
                             Initial accounts: {:#?}\
                             \nOperations: {:#?}\nResults: {:#?}",
                            id,
                            result.as_ref().unwrap_err(),
                            balance_res,
                            self.params,
                            self.generator.state.initial_accounts,
                            self.operations,
                            self.results
                        );
                    }
                }
                OperationResult::NeuronStake {
                    id,
                    neuron_id,
                    result,
                } => {
                    if result.is_err() {
                        panic!(
                            "Test failed on neuron stake operation {} with error: {}.\
                             Test started with params: {:?}\
                             Initial accounts: {:#?}\
                             \nOperations: {:#?}\nResults: {:#?}",
                            id,
                            result.as_ref().unwrap_err(),
                            self.params,
                            self.generator.state.initial_accounts,
                            self.operations,
                            self.results
                        );
                    } else {
                        let neuron_id_in_governance = result.as_ref().unwrap();
                        self.generator
                            .state
                            .neurons
                            .get_mut(neuron_id)
                            .unwrap()
                            .id_in_governance = Some(neuron_id_in_governance.id);
                    }
                }
                OperationResult::NeuronDisburse { id, result } => {
                    if result.is_err() {
                        panic!(
                            "Test failed on neuron disburse operation {} with error: {}.\
                             Test started with params: {:?}\
                             Initial accounts: {:#?}\
                             \nOperations: {:#?}\nResults: {:#?}",
                            id,
                            result.as_ref().unwrap_err(),
                            self.params,
                            self.generator.state.initial_accounts,
                            self.operations,
                            self.results
                        );
                    }
                }
                OperationResult::VerifyOne { id, result } => {
                    if result.is_err() {
                        panic!(
                            "Test failed on verify one operation {} with error: {}.\
                             Test started with params: {:?}\
                             Initial accounts: {:#?}\
                             \nOperations: {:#?}\nResults: {:#?}",
                            id,
                            result.as_ref().unwrap_err(),
                            self.params,
                            self.generator.state.initial_accounts,
                            self.operations,
                            self.results
                        );
                    }
                }
                _ => unimplemented!(),
            }
        }
    }
fn verify_results ( & mut self , op_results : & [ OperationResult ] ) { for op_result in op_results { match op_result { OperationResult :: LedgerTransfer { id , result } => { if result . is_err ( ) { // A ledger transfer failed. Get the balance of that // account before panicking with the failure. let balance_op = Operation :: GetAccountBalance { id : 0 , account : self . generator . state . accounts . get ( id ) . unwrap ( ) . clone ( ) , } ; self . driver . execute_operations ( vec ! [ balance_op ] ) ; let balance_res = self . driver . collect_results ( 1 ) [ 0 ] . clone ( ) ; panic ! ( " \
 \
 \
 \
 \n \n " id result as_ref ( ) unwrap_err ( ) balance_res self params self generator state initial_accounts self operations self results ) ; } } OperationResult :: NeuronStake { id , neuron_id , result , } => { if result . is_err ( ) { panic ! ( " \
 \
 \
 \n \n " id result as_ref ( ) unwrap_err ( ) self params self generator state initial_accounts self operations self results ) ; } else { let neuron_id_in_governance = result . as_ref ( ) . unwrap ( ) ; self . generator . state . neurons . get_mut ( neuron_id ) . unwrap ( ) . id_in_governance = Some ( neuron_id_in_governance . id ) ; } } OperationResult :: NeuronDisburse { id , result } => { if result . is_err ( ) { panic ! ( " \
 \
 \
 \n \n " id result as_ref ( ) unwrap_err ( ) self params self generator state initial_accounts self operations self results ) ; } } OperationResult :: VerifyOne { id , result } => { if result . is_err ( ) { panic ! ( " \
 \
 \
 \n \n " id result as_ref ( ) unwrap_err ( ) self params self generator state initial_accounts self operations self results ) ; } } _ => unimplemented ! ( ) , } } }
Verify the results (and potentially update some internal state with the
state from the NNS).
Verify the results ( and potentially update some internal state with the state from the NNS ) .
&mut self
op_results
&[OperationResult]