2016-01-19 22:50:00 +00:00
|
|
|
package vm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInit(t *testing.T) {
|
2016-03-01 22:32:43 +00:00
|
|
|
jumpTable := newJumpTable(ruleSet{big.NewInt(1)}, big.NewInt(0))
|
2016-01-19 22:50:00 +00:00
|
|
|
if jumpTable[DELEGATECALL].valid {
|
|
|
|
t.Error("Expected DELEGATECALL not to be present")
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, n := range []int64{1, 2, 100} {
|
2016-03-01 22:32:43 +00:00
|
|
|
jumpTable := newJumpTable(ruleSet{big.NewInt(1)}, big.NewInt(n))
|
2016-01-19 22:50:00 +00:00
|
|
|
if !jumpTable[DELEGATECALL].valid {
|
|
|
|
t.Error("Expected DELEGATECALL to be present for block", n)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|