From ccb6b852659272be04c1ea4dc18bcc32ae9e4591 Mon Sep 17 00:00:00 2001 From: Daniel Van Der Maden Date: Sat, 28 Dec 2019 00:55:09 -0800 Subject: [PATCH] [cli] Update docs --- pyhmy/cli.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pyhmy/cli.py b/pyhmy/cli.py index c365401..7461ee4 100644 --- a/pyhmy/cli.py +++ b/pyhmy/cli.py @@ -22,12 +22,12 @@ Example: >>> assert check_addr not in addrs.values() >>> assert "test1" not in addrs.keys() -This module refers to `accounts` as the NAME of an `address` given to by the CLI's -account keystore. +This module refers to `accounts` as the NAME/ALIAS of an `address` given to by the +CLI's account keystore. Lastly, on init, this module tries to a find a file named `hmy` within the current -working directory; if found, said file will be the default binary used. The binary -that is used by this module can be changed with the `set_binary` function. +working directory. If found, said file will be the default binary used. Note that the +binary that is used by this module can be changed with the `set_binary` function. Example: Below is a demo of how to set the CLI binary used by the module:: @@ -50,7 +50,7 @@ import re from .util import get_bls_build_variables, get_gopath -_accounts = {} # Internal accounts keystore, guaranteed to be up to date. +_accounts = {} # Internal accounts keystore, make sure to sync to keep up to date. _account_keystore_path = "~/.hmy/account-keys" # Internal path to account keystore, will match the current binary. _binary_path = "hmy" # Internal binary path. _environment = os.environ.copy() # Internal environment dict for Subprocess & Pexpect. @@ -206,6 +206,9 @@ def get_accounts(address): """ :param address: The 'one1...' address :return: A list of account names associated with the param + + Note that a list of account names is needed because 1 address can + have multiple names within the CLI's keystore. """ return [acc for acc, addr in get_accounts_keystore().items() if address == addr]