Skip to content

Commit

Permalink
Add more description of mnemonic language per @infosecual's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
hwwhww committed Mar 13, 2023
1 parent 9aed027 commit ee052fa
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ You can use `new-mnemonic --help` to see all arguments. Note that if there are m
| Argument | Type | Description |
| -------- | -------- | -------- |
| `--num_validators` | Non-negative integer | The number of signing keys you want to generate. Note that the child key(s) are generated via the same master key. |
| `--mnemonic_language` | String. Options: `简体中文`, `繁體中文`, `český jazyk`, `English`, `Italiano`, `한국어`, `Português`, `Español`. Default to `English` | The mnemonic language |
| `--mnemonic_language` | String. Options: `简体中文`, `繁體中文`, `český jazyk`, `English`, `Italiano`, `한국어`, `Português`, `Español`. Default to `English` | The language of the mnemonic word list |
| `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) |
| `--chain` | String. `mainnet` by default | The chain setting for the signing domain. |
| `--eth1_withdrawal_address` | String. Eth1 address in hexadecimal encoded form | If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in [ERC-2334 format](https://eips.ethereum.org/EIPS/eip-2334#eth2-specific-parameters). |
Expand Down
4 changes: 2 additions & 2 deletions staking_deposit/intl/en/cli/new_mnemonic.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
},
"arg_mnemonic_language": {
"default": "english",
"help": "The language that your mnemonic is in",
"prompt": "Please choose your mnemonic language"
"help": "The language of the mnemonic word list",
"prompt": "Please choose the language of the mnemonic word list"
},
"msg_mnemonic_presentation": "This is your mnemonic (seed phrase). Write it down and store it safely. It is the ONLY way to retrieve your deposit.",
"msg_press_any_key": "Press any key when you have written down your mnemonic.",
Expand Down
12 changes: 9 additions & 3 deletions tests/test_cli/test_new_mnemonic.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
from staking_deposit.cli import new_mnemonic
from staking_deposit.deposit import cli
from staking_deposit.key_handling.key_derivation.mnemonic import abbreviate_words
from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, ETH1_ADDRESS_WITHDRAWAL_PREFIX, BLS_WITHDRAWAL_PREFIX
from staking_deposit.utils.constants import (
BLS_WITHDRAWAL_PREFIX,
DEFAULT_VALIDATOR_KEYS_FOLDER_NAME,
ETH1_ADDRESS_WITHDRAWAL_PREFIX,
)
from staking_deposit.utils.intl import load_text
from .helpers import clean_key_folder, get_permissions, get_uuid

Expand Down Expand Up @@ -164,13 +168,15 @@ async def test_script_bls_withdrawal() -> None:
assert len(seed_phrase) > 0

# Check files
deposit_file = [key_file for key_file in key_files if key_file.startswith('deposit_data')][0]
validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME)
_, _, key_files = next(os.walk(validator_keys_folder_path))

deposit_file = [key_file for key_file in key_files if key_file.startswith('deposit_data')][0]
with open(validator_keys_folder_path + '/' + deposit_file, 'r') as f:
deposits_dict = json.load(f)
for deposit in deposits_dict:
withdrawal_credentials = bytes.fromhex(deposit['withdrawal_credentials'])
assert withdrawal_credentials[:2] == BLS_WITHDRAWAL_PREFIX
assert withdrawal_credentials[:1] == BLS_WITHDRAWAL_PREFIX

_, _, key_files = next(os.walk(validator_keys_folder_path))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_utils/test_intl.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
@pytest.mark.parametrize(
'params, file_path, func, lang, found_str', [
(['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'),
'new_mnemonic', 'en', 'Please choose your mnemonic language'),
'new_mnemonic', 'en', 'Please choose the language of the mnemonic word list'),
(['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'),
'new_mnemonic', 'ja', 'ニーモニックの言語を選択してください'),
]
Expand Down

0 comments on commit ee052fa

Please sign in to comment.