core/vm: expose jumptable constructors (#26880)

When interacting with geth as a library to e.g. produce state tests, it is desirable to obtain the consensus-correct jumptable definition for a given fork. This changes adds accessors so the instructionset can be obtained and characteristics about opcodes can be inspected.
This commit is contained in:
Martin Holst Swende
2023-03-21 07:14:47 -04:00
committed by GitHub
parent 905a723fae
commit b3f43c89b3
2 changed files with 77 additions and 3 deletions
+3 -3
View File
@@ -956,7 +956,7 @@ type Rules struct {
IsHomestead, IsEIP150, IsEIP155, IsEIP158 bool
IsByzantium, IsConstantinople, IsPetersburg, IsIstanbul bool
IsBerlin, IsLondon bool
IsMerge, IsShanghai, isCancun, isPrague bool
IsMerge, IsShanghai, IsCancun, IsPrague bool
}
// Rules ensures c's ChainID is not nil.
@@ -979,7 +979,7 @@ func (c *ChainConfig) Rules(num *big.Int, isMerge bool, timestamp uint64) Rules
IsLondon: c.IsLondon(num),
IsMerge: isMerge,
IsShanghai: c.IsShanghai(timestamp),
isCancun: c.IsCancun(timestamp),
isPrague: c.IsPrague(timestamp),
IsCancun: c.IsCancun(timestamp),
IsPrague: c.IsPrague(timestamp),
}
}