staking-deposit-cli/eth2deposit/settings.py
Hsiao-Wei Wang 08eeed26ed
Add fork_version
1. Use v0.12.0 signing format
2. `GENESIS_FORK_VERSION` may be various for mainnet and testnets. Add
option for it.
2020-05-24 00:23:51 +08:00

20 lines
393 B
Python

from typing import Dict, NamedTuple
class BaseChainSetting(NamedTuple):
GENESIS_FORK_VERSION: bytes
MainnetSetting = BaseChainSetting(
GENESIS_FORK_VERSION=bytes.fromhex('00000000'),
)
MAINNET = 'mainnet'
ALL_CHAINS: Dict[str, BaseChainSetting] = {
MAINNET: MainnetSetting,
}
def get_setting(chain_name: str = MAINNET) -> BaseChainSetting:
return ALL_CHAINS[chain_name]