mirror of
https://github.com/Chia-Network/chia-blockchain.git
synced 2024-09-20 08:05:33 +03:00
Initial commit cherry-pick #1398.
This commit is contained in:
parent
166ab7c99a
commit
68a11e5161
@ -23,10 +23,12 @@ def generate_cmd(ctx: click.Context):
|
||||
|
||||
|
||||
@keys_cmd.command("show", short_help="Displays all the keys in keychain")
|
||||
def show_cmd():
|
||||
@click.option(
|
||||
"--show-mnemonic-seed", help="Show the mnemonic seed of the keys", default=False, show_default=True, is_flag=True
|
||||
)
|
||||
def show_cmd(show_mnemonic_seed):
|
||||
from .keys_funcs import show_all_keys
|
||||
|
||||
show_all_keys()
|
||||
show_all_keys(show_mnemonic_seed)
|
||||
|
||||
|
||||
@keys_cmd.command("add", short_help="Add a private key by mnemonic")
|
||||
|
@ -57,7 +57,7 @@ def add_private_key_seed(mnemonic: str):
|
||||
return
|
||||
|
||||
|
||||
def show_all_keys():
|
||||
def show_all_keys(show_mnemonic: bool):
|
||||
"""
|
||||
Prints all keys and mnemonics (if available).
|
||||
"""
|
||||
@ -89,9 +89,10 @@ def show_all_keys():
|
||||
encode_puzzle_hash(create_puzzlehash_for_pk(master_sk_to_wallet_sk(sk, uint32(0)).get_g1()), prefix),
|
||||
)
|
||||
assert seed is not None
|
||||
mnemonic = bytes_to_mnemonic(seed)
|
||||
print(" Mnemonic seed (24 secret words):")
|
||||
print(mnemonic)
|
||||
if show_mnemonic:
|
||||
mnemonic = bytes_to_mnemonic(seed)
|
||||
print(" Mnemonic seed (24 secret words):")
|
||||
print(mnemonic)
|
||||
|
||||
|
||||
def delete(fingerprint: int):
|
||||
|
Loading…
Reference in New Issue
Block a user