Skip to content

Commit

Permalink
resolve test genesis poisioning
Browse files Browse the repository at this point in the history
  • Loading branch information
g11tech committed Nov 19, 2022
1 parent c27fc98 commit a9566e5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/client/test/rpc/util/CLConnectionManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ tape('[CLConnectionManager]', (t) => {
st.ok(manager.running, 'should start')
manager.stop()
st.ok(!manager.running, 'should stop')
const prevMergeForkBlock = (genesisJSON.config as any).mergeForkBlock
;(genesisJSON.config as any).mergeForkBlock = 0
const params = parseGethGenesis(genesisJSON, 'post-merge')
const params = parseGethGenesis(genesisJSON, 'post-merge', false)
let common = new Common({
chain: params.name,
customChains: [params],
Expand All @@ -53,7 +54,6 @@ tape('[CLConnectionManager]', (t) => {
manager = new CLConnectionManager({ config })
st.ok(manager.running, 'starts on instantiation if hardfork is MergeForkBlock')
manager.stop()
const prevMergeForkBlock = (genesisJSON.config as any).mergeForkBlock
;(genesisJSON.config as any).mergeForkBlock = 10
common = new Common({
chain: params.name,
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ function parseGethParams(json: any, mergeForkIdPostMerge: boolean = true) {
name: forkMapRev[nameBlock],
block: config[nameBlock],
}))
.filter((fork) => fork.block !== null)
.filter((fork) => fork.block !== null && fork.block !== undefined)

params.hardforks.unshift({ name: Hardfork.Chainstart, block: 0 })

Expand Down

0 comments on commit a9566e5

Please sign in to comment.