-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from ethereum/hwwhww/fork_version
Add fork_version
- Loading branch information
Showing
7 changed files
with
103 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from typing import Dict, NamedTuple | ||
|
||
|
||
class BaseChainSetting(NamedTuple): | ||
GENESIS_FORK_VERSION: bytes | ||
|
||
|
||
MainnetSetting = BaseChainSetting( | ||
GENESIS_FORK_VERSION=bytes.fromhex('00000000'), | ||
) | ||
|
||
|
||
# Eth2 spec v0.11.3 testnet | ||
WittiSetting = BaseChainSetting( | ||
GENESIS_FORK_VERSION=bytes.fromhex('00000113'), | ||
) | ||
|
||
|
||
MAINNET = 'mainnet' | ||
WITTI = 'witti' | ||
ALL_CHAINS: Dict[str, BaseChainSetting] = { | ||
MAINNET: MainnetSetting, | ||
WITTI: WittiSetting, | ||
} | ||
|
||
|
||
def get_setting(chain_name: str = MAINNET) -> BaseChainSetting: | ||
return ALL_CHAINS[chain_name] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters