(t *testing.T)
| 30 | ) |
| 31 | |
| 32 | func TestInfiniteLoopCrash(t *testing.T) { |
| 33 | evilBytecode := []byte(" e\xff\u007f\xffhm\xb7%\xa7AAAAAAAAAAAAAAAC\xef\xed\x04INVERT\x95ve") |
| 34 | dbFile := "test" |
| 35 | defer func() { |
| 36 | os.RemoveAll(dbFile) |
| 37 | }() |
| 38 | //testLevelDB, err := leveldbstore.NewLevelDBStore(dbFile) |
| 39 | //if err != nil { |
| 40 | // t.Fatal(err) |
| 41 | //} |
| 42 | //store := statestore.NewMemDatabase() |
| 43 | //testBatch := statestore.NewStateStoreBatch(store, testLevelDB) |
| 44 | config := &Config{ |
| 45 | Time: 10, |
| 46 | Height: 10, |
| 47 | Tx: &types.Transaction{}, |
| 48 | } |
| 49 | sc := SmartContract{ |
| 50 | Config: config, |
| 51 | Gas: 10000, |
| 52 | CacheDB: nil, |
| 53 | } |
| 54 | engine, err := sc.NewExecuteEngine(evilBytecode, types.InvokeNeo) |
| 55 | if err != nil { |
| 56 | t.Fatal(err) |
| 57 | } |
| 58 | _, err = engine.Invoke() |
| 59 | |
| 60 | assert.NotNil(t, err) |
| 61 | } |
nothing calls this directly
no test coverage detected