Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove dead chains #59

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions staking_deposit/cli/exit_transaction_keystore.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from staking_deposit.key_handling.keystore import Keystore
from staking_deposit.settings import (
MAINNET,
NON_PRATER_CHAIN_KEYS,
ALL_CHAIN_KEYS,
get_chain_setting,
)
from staking_deposit.utils.click import (
Expand All @@ -30,18 +30,18 @@
)
@jit_option(
callback=captive_prompt_callback(
lambda x: closest_match(x, NON_PRATER_CHAIN_KEYS),
lambda x: closest_match(x, ALL_CHAIN_KEYS),
choice_prompt_func(
lambda: load_text(['arg_exit_transaction_keystore_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
),
default=MAINNET,
help=lambda: load_text(['arg_exit_transaction_keystore_chain', 'help'], func=FUNC_NAME),
param_decls='--chain',
prompt=choice_prompt_func(
lambda: load_text(['arg_exit_transaction_keystore_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
)
@jit_option(
Expand Down
8 changes: 4 additions & 4 deletions staking_deposit/cli/exit_transaction_mnemonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from staking_deposit.exceptions import ValidationError
from staking_deposit.settings import (
MAINNET,
NON_PRATER_CHAIN_KEYS,
ALL_CHAIN_KEYS,
get_chain_setting,
)
from staking_deposit.utils.click import (
Expand Down Expand Up @@ -48,18 +48,18 @@ def _exit_verifier(kwargs: Dict[str, Any]) -> bool:
)
@jit_option(
callback=captive_prompt_callback(
lambda x: closest_match(x, NON_PRATER_CHAIN_KEYS),
lambda x: closest_match(x, ALL_CHAIN_KEYS),
choice_prompt_func(
lambda: load_text(['arg_exit_transaction_mnemonic_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
),
default=MAINNET,
help=lambda: load_text(['arg_exit_transaction_mnemonic_chain', 'help'], func=FUNC_NAME),
param_decls='--chain',
prompt=choice_prompt_func(
lambda: load_text(['arg_exit_transaction_mnemonic_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
)
@load_mnemonic_arguments_decorator
Expand Down
8 changes: 4 additions & 4 deletions staking_deposit/cli/generate_bls_to_execution_change.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
)
from staking_deposit.settings import (
MAINNET,
NON_PRATER_CHAIN_KEYS,
ALL_CHAIN_KEYS,
get_chain_setting,
get_devnet_chain_setting,
)
Expand Down Expand Up @@ -77,18 +77,18 @@ def _validate_credentials_match(kwargs: Dict[str, Any]) -> Optional[ValidationEr
)
@jit_option(
callback=captive_prompt_callback(
lambda x: closest_match(x, NON_PRATER_CHAIN_KEYS),
lambda x: closest_match(x, ALL_CHAIN_KEYS),
choice_prompt_func(
lambda: load_text(['arg_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
),
default=MAINNET,
help=lambda: load_text(['arg_chain', 'help'], func=FUNC_NAME),
param_decls='--chain',
prompt=choice_prompt_func(
lambda: load_text(['arg_chain', 'prompt'], func=FUNC_NAME),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
)
@load_mnemonic_arguments_decorator
Expand Down
8 changes: 4 additions & 4 deletions staking_deposit/cli/generate_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
)
from staking_deposit.settings import (
MAINNET,
NON_PRATER_CHAIN_KEYS,
ALL_CHAIN_KEYS,
get_chain_setting,
)

Expand Down Expand Up @@ -64,10 +64,10 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[
),
jit_option(
callback=captive_prompt_callback(
lambda x: closest_match(x, NON_PRATER_CHAIN_KEYS),
lambda x: closest_match(x, ALL_CHAIN_KEYS),
choice_prompt_func(
lambda: load_text(['chain', 'prompt'], func='generate_keys_arguments_decorator'),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
default=MAINNET,
),
Expand All @@ -76,7 +76,7 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[
param_decls='--chain',
prompt=choice_prompt_func(
lambda: load_text(['chain', 'prompt'], func='generate_keys_arguments_decorator'),
NON_PRATER_CHAIN_KEYS
ALL_CHAIN_KEYS
),
),
jit_option(
Expand Down
20 changes: 1 addition & 19 deletions staking_deposit/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@ class BaseChainSetting(NamedTuple):


MAINNET = 'mainnet'
GOERLI = 'goerli'
PRATER = 'prater'
SEPOLIA = 'sepolia'
ZHEJIANG = 'zhejiang'
HOLESKY = 'holesky'
EPHEMERY = 'ephemery'

Expand All @@ -25,24 +22,12 @@ class BaseChainSetting(NamedTuple):
GENESIS_FORK_VERSION=bytes.fromhex('00000000'),
EXIT_FORK_VERSION=bytes.fromhex('03000000'),
GENESIS_VALIDATORS_ROOT=bytes.fromhex('4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95'))
# Goerli setting
GoerliSetting = BaseChainSetting(
NETWORK_NAME=GOERLI,
GENESIS_FORK_VERSION=bytes.fromhex('00001020'),
EXIT_FORK_VERSION=bytes.fromhex('03001020'),
GENESIS_VALIDATORS_ROOT=bytes.fromhex('043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb'))
# Sepolia setting
SepoliaSetting = BaseChainSetting(
NETWORK_NAME=SEPOLIA,
GENESIS_FORK_VERSION=bytes.fromhex('90000069'),
EXIT_FORK_VERSION=bytes.fromhex('90000072'),
GENESIS_VALIDATORS_ROOT=bytes.fromhex('d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078'))
# Zhejiang setting
ZhejiangSetting = BaseChainSetting(
NETWORK_NAME=ZHEJIANG,
GENESIS_FORK_VERSION=bytes.fromhex('00000069'),
EXIT_FORK_VERSION=bytes.fromhex('00000072'),
GENESIS_VALIDATORS_ROOT=bytes.fromhex('53a92d8f2bb1d85f62d16a156e6ebcd1bcaba652d0900b2c2f387826f3481f6f'))
# Holesky setting
HoleskySetting = BaseChainSetting(
NETWORK_NAME=HOLESKY,
Expand All @@ -63,15 +48,12 @@ class BaseChainSetting(NamedTuple):

ALL_CHAINS: Dict[str, BaseChainSetting] = {
MAINNET: MainnetSetting,
GOERLI: GoerliSetting,
PRATER: GoerliSetting, # Prater is the old name of the Prater/Goerli testnet
SEPOLIA: SepoliaSetting,
ZHEJIANG: ZhejiangSetting,
HOLESKY: HoleskySetting,
EPHEMERY: EphemerySetting,
}

NON_PRATER_CHAIN_KEYS: list[str] = list(key for key in ALL_CHAINS.keys() if key != PRATER)
ALL_CHAIN_KEYS: tuple[str, ...] = tuple(ALL_CHAINS.keys())


def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting:
Expand Down