Skip to content

Commit

Permalink
feat: add prague to edr mappings
Browse files Browse the repository at this point in the history
  • Loading branch information
schaable committed Feb 7, 2025
1 parent 0f28475 commit 3e40b71
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export function ethereumsjsHardforkToEdrSpecId(hardfork: HardforkName): SpecId {
return SpecId.Shanghai;
case HardforkName.CANCUN:
return SpecId.Cancun;
case HardforkName.PRAGUE:
// TODO: update the value when Prague is added to EDR
return SpecId.Cancun;
default:
const _exhaustiveCheck: never = hardfork;
throw new Error(
Expand Down Expand Up @@ -107,9 +110,11 @@ export function edrSpecIdToEthereumHardfork(specId: SpecId): HardforkName {
return HardforkName.MERGE;
case SpecId.Shanghai:
return HardforkName.SHANGHAI;
// HACK: EthereumJS doesn't support Cancun, so report Shanghai
case SpecId.Cancun:
return HardforkName.SHANGHAI;
return HardforkName.CANCUN;
// TODO: uncomment when Prague is added to EDR
/* case SpecId.Prague:
return HardforkName.PRAGUE; */

default:
throw new Error(`Unknown spec id '${specId}', this shouldn't happen`);
Expand Down

0 comments on commit 3e40b71

Please sign in to comment.