MCPcopy Create free account
hub / github.com/chain/txvm / opEq

Function opEq

protocol/txvm/data.go:31–49  ·  view source on GitHub ↗
(vm *VM)

Source from the content-addressed store, hash-verified

29}
30
31func opEq(vm *VM) {
32 v1 := vm.popData()
33 v2 := vm.popData()
34
35 res := false
36
37 switch vv1 := v1.(type) {
38 case Int:
39 if vv2, ok := v2.(Int); ok {
40 res = vv1 == vv2
41 }
42 case Bytes:
43 if vv2, ok := v2.(Bytes); ok {
44 res = bytes.Equal(vv1, vv2)
45 }
46 }
47
48 vm.pushBool(res)
49}
50
51func opLen(vm *VM) {
52 d := vm.popData()

Callers

nothing calls this directly

Calls 3

popDataMethod · 0.80
EqualMethod · 0.80
pushBoolMethod · 0.80

Tested by

no test coverage detected