ethereumjs / ethereumjs-monorepo

@@ -56,7 +56,6 @@
Loading
56 56
      throw new Error('cannot get iterator head: blockchain has no getTotalDifficulty function')
57 57
    }
58 58
    const td = await vm.blockchain.getTotalDifficulty(parentBlock.hash())
59 -
    vm._common.setHardforkByBlockNumber(parentBlock.header.number, td)
60 59
61 60
    const builder = await vm.buildBlock({
62 61
      parentBlock,
@@ -69,6 +68,7 @@
Loading
69 68
      withdrawals,
70 69
      blockOpts: {
71 70
        putBlockIntoBlockchain: false,
71 +
        hardforkByTTD: td,
72 72
      },
73 73
    })
74 74

@@ -139,6 +139,25 @@
Loading
139 139
 * @ignore
140 140
 */
141 141
export class EVM implements EVMInterface {
142 +
  private static supportedHardforks = [
143 +
    Hardfork.Chainstart,
144 +
    Hardfork.Homestead,
145 +
    Hardfork.Dao,
146 +
    Hardfork.TangerineWhistle,
147 +
    Hardfork.SpuriousDragon,
148 +
    Hardfork.Byzantium,
149 +
    Hardfork.Constantinople,
150 +
    Hardfork.Petersburg,
151 +
    Hardfork.Istanbul,
152 +
    Hardfork.MuirGlacier,
153 +
    Hardfork.Berlin,
154 +
    Hardfork.London,
155 +
    Hardfork.ArrowGlacier,
156 +
    Hardfork.GrayGlacier,
157 +
    Hardfork.MergeForkIdTransition,
158 +
    Hardfork.Merge,
159 +
    Hardfork.Shanghai,
160 +
  ]
142 161
  protected _tx?: {
143 162
    gasPrice: bigint
144 163
    origin: Address
@@ -246,25 +265,7 @@
Loading
246 265
      }
247 266
    }
248 267
249 -
    const supportedHardforks = [
250 -
      Hardfork.Chainstart,
251 -
      Hardfork.Homestead,
252 -
      Hardfork.Dao,
253 -
      Hardfork.TangerineWhistle,
254 -
      Hardfork.SpuriousDragon,
255 -
      Hardfork.Byzantium,
256 -
      Hardfork.Constantinople,
257 -
      Hardfork.Petersburg,
258 -
      Hardfork.Istanbul,
259 -
      Hardfork.MuirGlacier,
260 -
      Hardfork.Berlin,
261 -
      Hardfork.London,
262 -
      Hardfork.ArrowGlacier,
263 -
      Hardfork.GrayGlacier,
264 -
      Hardfork.MergeForkIdTransition,
265 -
      Hardfork.Merge,
266 -
    ]
267 -
    if (!supportedHardforks.includes(this._common.hardfork() as Hardfork)) {
268 +
    if (!EVM.supportedHardforks.includes(this._common.hardfork() as Hardfork)) {
268 269
      throw new Error(
269 270
        `Hardfork ${this._common.hardfork()} not set as supported in supportedHardforks`
270 271
      )
Files Coverage
packages 86.45%
Project Totals (140 files) 86.45%
1
coverage:
2
  status:
3
    project:
4
      default:
5
        target: auto
6
        threshold: 2%
7
    patch:
8
      default:
9
        target: auto
10
        threshold: 5%
11
comment:
12
  layout: 'reach, flags'
13
flags:
14
  rlp:
15
    carryforward: true
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading