From 28ccf04155f3aa030608b9624156211b76d0a1e5 Mon Sep 17 00:00:00 2001 From: Karl Bartel Date: Mon, 10 Jul 2023 18:09:26 +0200 Subject: [PATCH] Turn Gingerbread off for CIP-35 test (#10398) CIP-35 support is dropped in Gingerbread, so that hard fork must be turned off to test CIP-35. --- packages/celotool/src/e2e-tests/cip35_tests.ts | 1 + packages/celotool/src/lib/generate_utils.ts | 7 +++++++ packages/celotool/src/lib/interfaces/genesis-config.ts | 1 + 3 files changed, 9 insertions(+) diff --git a/packages/celotool/src/e2e-tests/cip35_tests.ts b/packages/celotool/src/e2e-tests/cip35_tests.ts index 5dc71e6d747..6dffe05cfa6 100644 --- a/packages/celotool/src/e2e-tests/cip35_tests.ts +++ b/packages/celotool/src/e2e-tests/cip35_tests.ts @@ -137,6 +137,7 @@ function getGethRunConfig(withDonut: boolean, withEspresso: boolean): GethRunCon churritoBlock: 0, donutBlock: withDonut ? 0 : null, espressoBlock: withEspresso ? 0 : null, + gingerbreadBlock: null, }, instances: [ { diff --git a/packages/celotool/src/lib/generate_utils.ts b/packages/celotool/src/lib/generate_utils.ts index 576f67962cb..951df4fcef1 100644 --- a/packages/celotool/src/lib/generate_utils.ts +++ b/packages/celotool/src/lib/generate_utils.ts @@ -395,6 +395,7 @@ export const generateGenesis = ({ churritoBlock, donutBlock, espressoBlock, + gingerbreadBlock, }: GenesisConfig): string => { const genesis: any = { ...TEMPLATE } @@ -411,6 +412,9 @@ export const generateGenesis = ({ if (typeof espressoBlock === 'number') { genesis.config.espressoBlock = espressoBlock } + if (typeof gingerbreadBlock === 'number') { + genesis.config.gingerbreadBlock = gingerbreadBlock + } genesis.config.chainId = chainId @@ -539,6 +543,9 @@ export const generateGenesisWithMigrations = async ({ if (genesisConfig.espressoBlock !== undefined) { mcConfig.hardforks.espressoBlock = genesisConfig.espressoBlock } + if (genesisConfig.gingerbreadBlock !== undefined) { + mcConfig.hardforks.gingerbreadBlock = genesisConfig.gingerbreadBlock + } if (genesisConfig.timestamp !== undefined) { mcConfig.genesisTimestamp = genesisConfig.timestamp } diff --git a/packages/celotool/src/lib/interfaces/genesis-config.ts b/packages/celotool/src/lib/interfaces/genesis-config.ts index 5e680965924..b59ca86b1e5 100644 --- a/packages/celotool/src/lib/interfaces/genesis-config.ts +++ b/packages/celotool/src/lib/interfaces/genesis-config.ts @@ -15,4 +15,5 @@ export interface GenesisConfig { churritoBlock?: number | null donutBlock?: number | null espressoBlock?: number | null + gingerbreadBlock?: number | null }