aboutsummaryrefslogtreecommitdiffstats
path: root/core/vm/jump_table_test.go
blob: 98d34bef205edfa74ecb83ba4cdcc23e5beab6a8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)
        }
    }
}