forked from TrueCloudLab/neoneo-go
Add Equal Opcode
This commit is contained in:
parent
329f8f388c
commit
31511e55d0
1 changed files with 17 additions and 0 deletions
17
pkg/vm/vm_ops_bitwise.go
Normal file
17
pkg/vm/vm_ops_bitwise.go
Normal file
|
@ -0,0 +1,17 @@
|
|||
package vm
|
||||
|
||||
import "github.com/CityOfZion/neo-go/pkg/vm/stack"
|
||||
|
||||
// Bitwise logic
|
||||
|
||||
// EQUAL pushes true to the stack
|
||||
// If the two top items on the stack are equal
|
||||
func EQUAL(op stack.Instruction, ctx *stack.Context, istack *stack.Invocation) (Vmstate, error) {
|
||||
|
||||
itemA, itemB, err := popTwoByteArrays(ctx)
|
||||
if err != nil {
|
||||
return FAULT, err
|
||||
}
|
||||
ctx.Estack.Push(itemA.Equals(itemB))
|
||||
return NONE, nil
|
||||
}
|
Loading…
Reference in a new issue