MCPcopy Create free account
hub / github.com/DNAProject/DNA / TestEqualStackOverflow

Function TestEqualStackOverflow

smartcontract/test/equal_stack_overflow_test.go:35–67  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

33)
34
35func TestEqualStackOverflow(t *testing.T) {
36 log.InitLog(4)
37 defer func() {
38 os.RemoveAll("./Log")
39 }()
40
41 code := []byte{
42 byte(neovm.PUSH1), // {1}
43 byte(neovm.NEWARRAY), // {[]}
44 byte(neovm.DUP), // {[],[]}
45 byte(neovm.DUP), // {[],[],[]}
46 byte(neovm.PUSH0), // {[],[],[],0}
47 byte(neovm.ROT), // {[],[],0,[]}
48 byte(neovm.SETITEM), // {[[]]}
49 byte(neovm.DUP), // {[[]],[[]]}
50 byte(neovm.EQUAL),
51 }
52
53 config := &Config{
54 Time: 10,
55 Height: 10,
56 Tx: &types.Transaction{},
57 }
58 sc := SmartContract{
59 Config: config,
60 Gas: 10000,
61 CacheDB: nil,
62 }
63 engine, _ := sc.NewExecuteEngine(code, types.InvokeNeo)
64 _, err := engine.Invoke()
65
66 assert.Nil(t, err)
67}

Callers

nothing calls this directly

Calls 3

NewExecuteEngineMethod · 0.95
InitLogFunction · 0.92
InvokeMethod · 0.65

Tested by

no test coverage detected