(t *testing.T)
| 33 | ) |
| 34 | |
| 35 | func 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 | } |
nothing calls this directly
no test coverage detected