From 98ce378842eb5d404f82e3bc2d082dd06091b665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=ADn=20Triay?= Date: Thu, 24 Nov 2022 22:40:48 +0100 Subject: [PATCH] Fix account invariant (#302) * fix account invariant * fix max_fee --- src/nile/core/account.py | 2 +- src/nile/starknet_cli.py | 2 +- tests/test_starknet_cli.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/nile/core/account.py b/src/nile/core/account.py index 2611731c..3d10a196 100644 --- a/src/nile/core/account.py +++ b/src/nile/core/account.py @@ -96,7 +96,7 @@ async def __init__( ) if output is not None: address, index = output - self.address = address + self.address = normalize_number(address) self.index = index # we should replace this with static type checks diff --git a/src/nile/starknet_cli.py b/src/nile/starknet_cli.py index 1d0cb391..1cf9fd0a 100644 --- a/src/nile/starknet_cli.py +++ b/src/nile/starknet_cli.py @@ -94,7 +94,7 @@ def set_command_args(**kwargs): if kwargs.get("max_fee"): command_args.append("--max_fee") - command_args.extend(prepare_params(kwargs.get("max_fee"))) + command_args.append(str(kwargs.get("max_fee"))) if kwargs.get("method"): command_args.append("--function") diff --git a/tests/test_starknet_cli.py b/tests/test_starknet_cli.py index ef143876..e5a48294 100644 --- a/tests/test_starknet_cli.py +++ b/tests/test_starknet_cli.py @@ -71,8 +71,8 @@ def test__add_args(args, expected): "args, expected", [ ( - {"address": ADDRESS, "inputs": INPUTS}, - ["--address", ADDRESS, "--inputs", "1", "2"], + {"address": ADDRESS, "inputs": INPUTS, "max_fee": "324652"}, + ["--address", ADDRESS, "--inputs", "1", "2", "--max_fee", "324652"], ), ( {"inputs": INPUTS, "contract_name": CONTRACT_NAME},