|
|
@ -22,12 +22,12 @@ Example: |
|
|
|
>>> assert check_addr not in addrs.values() |
|
|
|
>>> assert check_addr not in addrs.values() |
|
|
|
>>> assert "test1" not in addrs.keys() |
|
|
|
>>> assert "test1" not in addrs.keys() |
|
|
|
|
|
|
|
|
|
|
|
This module refers to `accounts` as the NAME of an `address` given to by the CLI's |
|
|
|
This module refers to `accounts` as the NAME/ALIAS of an `address` given to by the |
|
|
|
account keystore. |
|
|
|
CLI's account keystore. |
|
|
|
|
|
|
|
|
|
|
|
Lastly, on init, this module tries to a find a file named `hmy` within the current |
|
|
|
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 |
|
|
|
working directory. If found, said file will be the default binary used. Note that the |
|
|
|
that is used by this module can be changed with the `set_binary` function. |
|
|
|
binary that is used by this module can be changed with the `set_binary` function. |
|
|
|
|
|
|
|
|
|
|
|
Example: |
|
|
|
Example: |
|
|
|
Below is a demo of how to set the CLI binary used by the module:: |
|
|
|
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 |
|
|
|
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. |
|
|
|
_account_keystore_path = "~/.hmy/account-keys" # Internal path to account keystore, will match the current binary. |
|
|
|
_binary_path = "hmy" # Internal binary path. |
|
|
|
_binary_path = "hmy" # Internal binary path. |
|
|
|
_environment = os.environ.copy() # Internal environment dict for Subprocess & Pexpect. |
|
|
|
_environment = os.environ.copy() # Internal environment dict for Subprocess & Pexpect. |
|
|
@ -206,6 +206,9 @@ def get_accounts(address): |
|
|
|
""" |
|
|
|
""" |
|
|
|
:param address: The 'one1...' address |
|
|
|
:param address: The 'one1...' address |
|
|
|
:return: A list of account names associated with the param |
|
|
|
: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] |
|
|
|
return [acc for acc, addr in get_accounts_keystore().items() if address == addr] |
|
|
|
|
|
|
|
|
|
|
|