MCPcopy Create free account
hub / github.com/CPChain/chain / TestInstructionIteratorInvalid

Function TestInstructionIteratorInvalid

core/asm/asm_test.go:44–56  ·  view source on GitHub ↗

Tests disassembling the instructions for invalid evm code

(t *testing.T)

Source from the content-addressed store, hash-verified

42
43// Tests disassembling the instructions for invalid evm code
44func TestInstructionIteratorInvalid(t *testing.T) {
45 cnt := 0
46 script, _ := hex.DecodeString("6100")
47
48 it := NewInstructionIterator(script)
49 for it.Next() {
50 cnt++
51 }
52
53 if it.Error() == nil {
54 t.Errorf("Expected an error, but got %v instead.", cnt)
55 }
56}
57
58// Tests disassembling the instructions for empty evm code
59func TestInstructionIteratorEmpty(t *testing.T) {

Callers

nothing calls this directly

Calls 3

NewInstructionIteratorFunction · 0.85
ErrorMethod · 0.65
NextMethod · 0.45

Tested by

no test coverage detected