fn step(&mut self) -> Result<bool, VMError> {
        if let Some(instr) = self.delegate.next_instruction(&mut self.current_run)? {
            // Attempt to read the next instruction and advance the program state
            match instr {
                // the data is just a slice, so the clone would copy the slice struct,
                // not the actual buffer of bytes.
                Instruction::Push(data) => self.pushdata(data)?,
                Instruction::Drop => self.drop()?,
                Instruction::Dup(i) => self.dup(i)?,
                Instruction::Roll(i) => self.roll(i)?,
                Instruction::Const => self.r#const()?,
                Instruction::Var => self.var()?,
                Instruction::Alloc(sw) => self.alloc(sw)?,
                Instruction::Mintime => self.mintime()?,
                Instruction::Maxtime => self.maxtime()?,
                Instruction::Expr => self.expr()?,
                Instruction::Neg => self.neg()?,
                Instruction::Add => self.add()?,
                Instruction::Mul => self.mul()?,
                Instruction::Eq => self.eq()?,
                Instruction::Range(i) => self.range(i)?,
                Instruction::And => self.and()?,
                Instruction::Or => self.or()?,
                Instruction::Not => self.not()?,
                Instruction::Verify => self.verify()?,
                Instruction::Unblind => self.unblind()?,
                Instruction::Issue => self.issue()?,
                Instruction::Borrow => self.borrow()?,
                Instruction::Retire => self.retire()?,
                Instruction::Cloak(m, n) => self.cloak(m, n)?,
                Instruction::Import => unimplemented!(),
                Instruction::Export => unimplemented!(),
                Instruction::Input => self.input()?,
                Instruction::Output(k) => self.output(k)?,
                Instruction::Contract(k) => self.contract(k)?,
                Instruction::Nonce => self.nonce()?,
                Instruction::Log => self.log()?,
                Instruction::Signtx => self.signtx()?,
                Instruction::Call => self.call()?,
                Instruction::Select(n, k) => self.select(n, k)?,
                Instruction::Delegate => self.delegate()?,
                Instruction::Ext(opcode) => self.ext(opcode)?,
            }
            return Ok(true);
        } else {
            // Reached the end of the current program
            return Ok(self.finish_run());
        }
    }
/// Returns a flag indicating whether to continue the execution
Returns a flag indicating whether to continue the execution
Returns a flag indicating whether to continue the execution
fn step(&mut self) -> Result<bool, VMError> {
        if let Some(instr) = self.delegate.next_instruction(&mut self.current_run)? {
            // Attempt to read the next instruction and advance the program state
            match instr {
                // the data is just a slice, so the clone would copy the slice struct,
                // not the actual buffer of bytes.
                Instruction::Push(data) => self.pushdata(data)?,
                Instruction::Drop => self.drop()?,
                Instruction::Dup(i) => self.dup(i)?,
                Instruction::Roll(i) => self.roll(i)?,
                Instruction::Const => self.r#const()?,
                Instruction::Var => self.var()?,
                Instruction::Alloc(sw) => self.alloc(sw)?,
                Instruction::Mintime => self.mintime()?,
                Instruction::Maxtime => self.maxtime()?,
                Instruction::Expr => self.expr()?,
                Instruction::Neg => self.neg()?,
                Instruction::Add => self.add()?,
                Instruction::Mul => self.mul()?,
                Instruction::Eq => self.eq()?,
                Instruction::Range(i) => self.range(i)?,
                Instruction::And => self.and()?,
                Instruction::Or => self.or()?,
                Instruction::Not => self.not()?,
                Instruction::Verify => self.verify()?,
                Instruction::Unblind => self.unblind()?,
                Instruction::Issue => self.issue()?,
                Instruction::Borrow => self.borrow()?,
                Instruction::Retire => self.retire()?,
                Instruction::Cloak(m, n) => self.cloak(m, n)?,
                Instruction::Import => unimplemented!(),
                Instruction::Export => unimplemented!(),
                Instruction::Input => self.input()?,
                Instruction::Output(k) => self.output(k)?,
                Instruction::Contract(k) => self.contract(k)?,
                Instruction::Nonce => self.nonce()?,
                Instruction::Log => self.log()?,
                Instruction::Signtx => self.signtx()?,
                Instruction::Call => self.call()?,
                Instruction::Select(n, k) => self.select(n, k)?,
                Instruction::Delegate => self.delegate()?,
                Instruction::Ext(opcode) => self.ext(opcode)?,
            }
            return Ok(true);
        } else {
            // Reached the end of the current program
            return Ok(self.finish_run());
        }
    }
fn step ( & mut self ) -> Result < bool , VMError > { if let Some ( instr ) = self . delegate . next_instruction ( & mut self . current_run ) ? { // Attempt to read the next instruction and advance the program state match instr { // the data is just a slice, so the clone would copy the slice struct, // not the actual buffer of bytes. Instruction :: Push ( data ) => self . pushdata ( data ) ? , Instruction :: Drop => self . drop ( ) ? , Instruction :: Dup ( i ) => self . dup ( i ) ? , Instruction :: Roll ( i ) => self . roll ( i ) ? , Instruction :: Const => self . r#const ( ) ? , Instruction :: Var => self . var ( ) ? , Instruction :: Alloc ( sw ) => self . alloc ( sw ) ? , Instruction :: Mintime => self . mintime ( ) ? , Instruction :: Maxtime => self . maxtime ( ) ? , Instruction :: Expr => self . expr ( ) ? , Instruction :: Neg => self . neg ( ) ? , Instruction :: Add => self . add ( ) ? , Instruction :: Mul => self . mul ( ) ? , Instruction :: Eq => self . eq ( ) ? , Instruction :: Range ( i ) => self . range ( i ) ? , Instruction :: And => self . and ( ) ? , Instruction :: Or => self . or ( ) ? , Instruction :: Not => self . not ( ) ? , Instruction :: Verify => self . verify ( ) ? , Instruction :: Unblind => self . unblind ( ) ? , Instruction :: Issue => self . issue ( ) ? , Instruction :: Borrow => self . borrow ( ) ? , Instruction :: Retire => self . retire ( ) ? , Instruction :: Cloak ( m , n ) => self . cloak ( m , n ) ? , Instruction :: Import => unimplemented ! ( ) , Instruction :: Export => unimplemented ! ( ) , Instruction :: Input => self . input ( ) ? , Instruction :: Output ( k ) => self . output ( k ) ? , Instruction :: Contract ( k ) => self . contract ( k ) ? , Instruction :: Nonce => self . nonce ( ) ? , Instruction :: Log => self . log ( ) ? , Instruction :: Signtx => self . signtx ( ) ? , Instruction :: Call => self . call ( ) ? , Instruction :: Select ( n , k ) => self . select ( n , k ) ? , Instruction :: Delegate => self . delegate ( ) ? , Instruction :: Ext ( opcode ) => self . ext ( opcode ) ? , } return Ok ( true ) ; } else { // Reached the end of the current program return Ok ( self . finish_run ( ) ) ; } }
Returns a flag indicating whether to continue the execution
Returns a flag indicating whether to continue the execution
&mut self
&mut self