diff --git a/convex_api/api.py b/convex_api/api.py index e23836b..cbf8a0c 100644 --- a/convex_api/api.py +++ b/convex_api/api.py @@ -49,7 +49,7 @@ class API: def __init__(self, url: str): - self._url = url + self._url = str(url) self._registry = Registry(self) def create_account(self, key_pair: KeyPair, sequence_retry_count: int = 20) -> Account: diff --git a/convex_api/tool/command/account_balance_command.py b/convex_api/tool/command/account_balance_command.py index 60471bc..4798eba 100644 --- a/convex_api/tool/command/account_balance_command.py +++ b/convex_api/tool/command/account_balance_command.py @@ -49,7 +49,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountBalanceArgs.parse_obj(vars(args)) + typed_args = AccountBalanceArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) info = self.resolve_to_name_address(typed_args.name_address, output) if not info: diff --git a/convex_api/tool/command/account_create_command.py b/convex_api/tool/command/account_create_command.py index 0786cc7..de4b75d 100644 --- a/convex_api/tool/command/account_create_command.py +++ b/convex_api/tool/command/account_create_command.py @@ -59,7 +59,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountCreateArgs.parse_obj(vars(args)) + typed_args = AccountCreateArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) key_pair = self.import_key_pair(typed_args) diff --git a/convex_api/tool/command/account_fund_command.py b/convex_api/tool/command/account_fund_command.py index 0182cf2..f57cb89 100644 --- a/convex_api/tool/command/account_fund_command.py +++ b/convex_api/tool/command/account_fund_command.py @@ -54,7 +54,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountFundArgs.parse_obj(vars(args)) + typed_args = AccountFundArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) account = self.load_account(typed_args, typed_args.name_address, output) diff --git a/convex_api/tool/command/account_info_command.py b/convex_api/tool/command/account_info_command.py index dd3ae10..6dcd784 100644 --- a/convex_api/tool/command/account_info_command.py +++ b/convex_api/tool/command/account_info_command.py @@ -48,7 +48,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountInfoArgs.parse_obj(vars(args)) + typed_args = AccountInfoArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) info = self.resolve_to_name_address(typed_args.name_address, output) if not info: diff --git a/convex_api/tool/command/account_name_register_command.py b/convex_api/tool/command/account_name_register_command.py index c14c1b2..6ad8308 100644 --- a/convex_api/tool/command/account_name_register_command.py +++ b/convex_api/tool/command/account_name_register_command.py @@ -22,9 +22,9 @@ class AccountNameRegisterArgs(BaseArgs): command: Literal['account'] account_command: Literal['register'] - name_address: str + name_address: str | int name: str - address: str + address: str | int class AccountNameRegisterCommand(CommandBase): @@ -59,7 +59,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountNameRegisterArgs.parse_obj(vars(args)) + typed_args = AccountNameRegisterArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) account = self.load_account(typed_args, typed_args.name_address, output) diff --git a/convex_api/tool/command/account_name_resolve_command.py b/convex_api/tool/command/account_name_resolve_command.py index 75627aa..e8ebaa8 100644 --- a/convex_api/tool/command/account_name_resolve_command.py +++ b/convex_api/tool/command/account_name_resolve_command.py @@ -47,7 +47,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountNameResolveArgs.parse_obj(vars(args)) + typed_args = AccountNameResolveArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) address = convex.resolve_account_name(typed_args.name) if address: diff --git a/convex_api/tool/command/account_topup_command.py b/convex_api/tool/command/account_topup_command.py index d6a7f0d..3206ceb 100644 --- a/convex_api/tool/command/account_topup_command.py +++ b/convex_api/tool/command/account_topup_command.py @@ -47,7 +47,7 @@ def create_parser(self, sub_parser: SubParsersAction): return parser def execute(self, args: Namespace, output: Output): - typed_args = AccountTopupArgs.parse_obj(vars(args)) + typed_args = AccountTopupArgs.model_validate(vars(args)) convex = self.load_convex(typed_args.url) account = self.load_account(typed_args, typed_args.name_address, output) if not account: diff --git a/tests/intergration/tool/test_account_command.py b/tests/intergration/tool/test_account_command.py index 20d87dc..fa784ea 100644 --- a/tests/intergration/tool/test_account_command.py +++ b/tests/intergration/tool/test_account_command.py @@ -47,6 +47,10 @@ def test_account_balance_command(convex_url: str, test_account: Account): args.account_command = 'balance' args.url = convex_url args.name_address = test_account.address + args.keyfile = None + args.keytext = None + args.password = None + args.keywords = None command = AccountBalanceCommand() output = Output() @@ -71,6 +75,10 @@ def test_account_info_command(convex_url: str, test_account: Account): args.account_command = 'info' args.url = convex_url args.name_address = test_account.address + args.keyfile = None + args.keytext = None + args.password = None + args.keywords = None command = AccountInfoCommand() output = Output() @@ -102,6 +110,11 @@ def test_account_name_resolve_command(convex_url: str, test_account: Account): args.account_command = 'resolve' args.url = convex_url args.name = test_account.name + args.keyfile = None + args.keytext = None + args.password = None + args.keywords = None + command = AccountNameResolveCommand() output = Output() diff --git a/tests/intergration/tool/test_query_command.py b/tests/intergration/tool/test_query_command.py index e827e98..f6d6b7b 100644 --- a/tests/intergration/tool/test_query_command.py +++ b/tests/intergration/tool/test_query_command.py @@ -17,6 +17,10 @@ def test_query_command(convex_url: str): args.url = convex_url args.query = '(address *registry*)' args.name_address = None + args.keyfile = None + args.keytext = None + args.password = None + args.keywords = None command = QueryCommand() output = Output()