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

Function TestOpCodeDUP

smartcontract/test/panic_test.go:76–99  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

74}
75
76func TestOpCodeDUP(t *testing.T) {
77 log.InitLog(4)
78 defer func() {
79 os.RemoveAll("Log")
80 }()
81
82 config := &Config{
83 Time: 10,
84 Height: 10,
85 Tx: &types.Transaction{},
86 }
87
88 var code = []byte{byte(neovm.DUP)}
89
90 sc := SmartContract{
91 Config: config,
92 Gas: 10000,
93 CacheDB: nil,
94 }
95 engine, _ := sc.NewExecuteEngine(code, types.InvokeNeo)
96 _, err := engine.Invoke()
97
98 assert.NotNil(t, err)
99}
100
101func TestOpReadMemAttack(t *testing.T) {
102 log.InitLog(4)

Callers

nothing calls this directly

Calls 3

NewExecuteEngineMethod · 0.95
InitLogFunction · 0.92
InvokeMethod · 0.65

Tested by

no test coverage detected