// Generates a sequence of valid operations, based on the
// current state.
Generates a sequence of valid operations, based on the
current state.
Generates a sequence of valid operations based on the current state .
fn generate_valid_sequence(&mut self, size: usize) -> Vec<Operation> {
        let mut operations = Vec::new();
        while operations.len() < size {
            let operation = match self.choose_random_op_idx() {
                0 => self.generate_random_ledger_transfer(),
                1 => self.generate_random_neuron_stake(),
                2 => self.generate_random_neuron_disburse(),
                3 => self.generate_random_verify_one(),
                _ => panic!("Unsupposed operation idx."),
            };
            if let Some(operation) = operation {
                operations.push(operation);
                self.next_op_id += 1;
            }
        }
        operations
    }
fn generate_valid_sequence ( & mut self , size : usize ) -> Vec < Operation > { let mut operations = Vec :: new ( ) ; while operations . len ( ) < size { let operation = match self . choose_random_op_idx ( ) { 0 => self . generate_random_ledger_transfer ( ) , 1 => self . generate_random_neuron_stake ( ) , 2 => self . generate_random_neuron_disburse ( ) , 3 => self . generate_random_verify_one ( ) , _ => panic ! ( " " ) , } ; if let Some ( operation ) = operation { operations . push ( operation ) ; self . next_op_id += 1 ; } } operations }
Generates a sequence of valid operations, based on the
current state.
Generates a sequence of valid operations based on the current state .
&mut self
size
usize