forked from TrueCloudLab/neoneo-go
vm: introduce HasFailed() method and use it where appropriate
It's gonna be used by external modules.
This commit is contained in:
parent
317dc6c5ed
commit
3bbeb2476e
2 changed files with 148 additions and 142 deletions
|
@ -233,6 +233,12 @@ func (v *VM) Step() {
|
|||
}
|
||||
}
|
||||
|
||||
// HasFailed returns whether VM is in the failed state now. Usually used to
|
||||
// check status after Run.
|
||||
func (v *VM) HasFailed() bool {
|
||||
return v.state.HasFlag(faultState)
|
||||
}
|
||||
|
||||
// execute performs an instruction cycle in the VM. Acting on the instruction (opcode).
|
||||
func (v *VM) execute(ctx *Context, op Instruction) {
|
||||
// Instead of polluting the whole VM logic with error handling, we will recover
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue