mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-17 18:30:45 +00:00
core/vm: surface some internal methods (#20958)
This commit is contained in:
parent
d29ecf427c
commit
3e4932e408
1 changed files with 12 additions and 14 deletions
|
|
@ -24,26 +24,24 @@ import (
|
||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var activators = map[int]func(*JumpTable){
|
||||||
|
3855: enable3855,
|
||||||
|
3198: enable3198,
|
||||||
|
2929: enable2929,
|
||||||
|
2200: enable2200,
|
||||||
|
1884: enable1884,
|
||||||
|
1344: enable1344,
|
||||||
|
}
|
||||||
|
|
||||||
// EnableEIP enables the given EIP on the config.
|
// EnableEIP enables the given EIP on the config.
|
||||||
// This operation writes in-place, and callers need to ensure that the globally
|
// This operation writes in-place, and callers need to ensure that the globally
|
||||||
// defined jump tables are not polluted.
|
// defined jump tables are not polluted.
|
||||||
func EnableEIP(eipNum int, jt *JumpTable) error {
|
func EnableEIP(eipNum int, jt *JumpTable) error {
|
||||||
switch eipNum {
|
enablerFn, ok := activators[eipNum]
|
||||||
case 3855:
|
if !ok {
|
||||||
enable3855(jt)
|
|
||||||
case 3198:
|
|
||||||
enable3198(jt)
|
|
||||||
case 2929:
|
|
||||||
enable2929(jt)
|
|
||||||
case 2200:
|
|
||||||
enable2200(jt)
|
|
||||||
case 1884:
|
|
||||||
enable1884(jt)
|
|
||||||
case 1344:
|
|
||||||
enable1344(jt)
|
|
||||||
default:
|
|
||||||
return fmt.Errorf("undefined eip %d", eipNum)
|
return fmt.Errorf("undefined eip %d", eipNum)
|
||||||
}
|
}
|
||||||
|
enablerFn(jt)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue