jump_table_test.go 488 B

123456789101112131415161718192021222324
  1. package vm
  2. import (
  3. "math/big"
  4. "testing"
  5. "github.com/ethereum/go-ethereum/params"
  6. )
  7. func TestInit(t *testing.T) {
  8. params.HomesteadBlock = big.NewInt(1)
  9. jumpTable := newJumpTable(big.NewInt(0))
  10. if jumpTable[DELEGATECALL].valid {
  11. t.Error("Expected DELEGATECALL not to be present")
  12. }
  13. for _, n := range []int64{1, 2, 100} {
  14. jumpTable := newJumpTable(big.NewInt(n))
  15. if !jumpTable[DELEGATECALL].valid {
  16. t.Error("Expected DELEGATECALL to be present for block", n)
  17. }
  18. }
  19. }