2016-01-19 16:50:00 -06:00
|
|
|
package vm
|
|
|
|
|
|
|
|
import (
|
|
|
|
"math/big"
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/params"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestInit(t *testing.T) {
|
|
|
|
params.HomesteadBlock = big.NewInt(1)
|
|
|
|
|
2016-01-21 08:29:58 -06:00
|
|
|
jumpTable := newJumpTable(big.NewInt(0))
|
2016-01-19 16:50:00 -06:00
|
|
|
if jumpTable[DELEGATECALL].valid {
|
|
|
|
t.Error("Expected DELEGATECALL not to be present")
|
|
|
|
}
|
|
|
|
|
|
|
|
for _, n := range []int64{1, 2, 100} {
|
2016-01-21 08:29:58 -06:00
|
|
|
jumpTable := newJumpTable(big.NewInt(n))
|
2016-01-19 16:50:00 -06:00
|
|
|
if !jumpTable[DELEGATECALL].valid {
|
|
|
|
t.Error("Expected DELEGATECALL to be present for block", n)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|