aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jump_table_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'core/vm/jump_table_test.go')
-rw-r--r--core/vm/jump_table_test.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/vm/jump_table_test.go b/core/vm/jump_table_test.go
new file mode 100644
index 000000000..98d34bef2
--- /dev/null
+++ b/core/vm/jump_table_test.go
@@ -0,0 +1,24 @@
+package vm
+
+import (
+ "math/big"
+ "testing"
+
+ "github.com/ethereum/go-ethereum/params"
+)
+
+func TestInit(t *testing.T) {
+ params.HomesteadBlock = big.NewInt(1)
+
+ jumpTable.init(big.NewInt(0))
+ if jumpTable[DELEGATECALL].valid {
+ t.Error("Expected DELEGATECALL not to be present")
+ }
+
+ for _, n := range []int64{1, 2, 100} {
+ jumpTable.init(big.NewInt(n))
+ if !jumpTable[DELEGATECALL].valid {
+ t.Error("Expected DELEGATECALL to be present for block", n)
+ }
+ }
+}