diff --git a/src/nile/cli.py b/src/nile/cli.py index 7ff32c1d..fee65e06 100755 --- a/src/nile/cli.py +++ b/src/nile/cli.py @@ -126,8 +126,7 @@ def send(signer, address_or_alias, method, params, network, max_fee=None): method, address_or_alias, [x for x in params] ) ) - if not is_alias(address_or_alias): - address_or_alias = normalize_number(address_or_alias) + # Account.send is part of the public API, so it accepts addresses as string out = account.send(address_or_alias, method, params, max_fee=max_fee) print(out) diff --git a/src/nile/core/account.py b/src/nile/core/account.py index ca527958..0cb8f4ad 100644 --- a/src/nile/core/account.py +++ b/src/nile/core/account.py @@ -5,6 +5,7 @@ from dotenv import load_dotenv from nile import accounts, deployments +from nile.common import is_alias from nile.core.call_or_invoke import call_or_invoke from nile.core.deploy import deploy from nile.utils import normalize_number @@ -77,13 +78,10 @@ def deploy(self): return address, index def send(self, address_or_alias, method, calldata, max_fee, nonce=None): - """ - Execute a tx going through an Account contract. + """Execute a tx going through an Account contract.""" + if not is_alias(address_or_alias): + address_or_alias = normalize_number(address_or_alias) - If address_or_alias is an int, address is assumed. - - If address_or_alias is a str, alias is assumed. - """ target_address, _ = ( next(deployments.load(address_or_alias, self.network), None) or address_or_alias