Skip to content

Commit d5b9254

Browse files
committed
Merge branch 'feat/next' into move-delegation-code
2 parents 9a0766a + e2746a8 commit d5b9254

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

multiversx_sdk_cli/cli_shared.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def add_tx_args(
143143
sub.add_argument("--options", type=int, default=0, help="the transaction options (default: %(default)s)")
144144

145145
sub.add_argument("--relayer", type=str, help="the bech32 address of the relayer", default="")
146-
sub.add_argument("--guardian", type=str, help="the bech32 address of the guradian", default="")
146+
sub.add_argument("--guardian", type=str, help="the bech32 address of the guardian", default="")
147147

148148

149149
def add_wallet_args(args: list[str], sub: Any):
@@ -368,7 +368,7 @@ def _get_guardian_data_from_network(sender: str, args: Any, guardian_and_relayer
368368
guardian_and_relayer_data.guardian_service_url = tcs_url if tcs_url else args.guardian_service_url
369369

370370
if guardian_and_relayer_data.guardian_service_url:
371-
guardian_and_relayer_data.guardian_2fa_code = _get_2fa_code(args)
371+
guardian_and_relayer_data.guardian_2fa_code = _ask_for_2fa_code(args)
372372

373373

374374
def _get_guardian_data(address: str, proxy_url: str) -> Union[dict[str, str], None]:
@@ -406,7 +406,7 @@ def _fetch_guardian_data(address: str, proxy_url: str) -> dict[str, Any]:
406406
return guardian_data
407407

408408

409-
def _get_2fa_code(args: Any) -> str:
409+
def _ask_for_2fa_code(args: Any) -> str:
410410
code: str = args.guardian_2fa_code
411411
if not code:
412412
code = input("Please enter the two factor authentication code: ")

multiversx_sdk_cli/utils.py

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import tarfile
88
import zipfile
99
from pathlib import Path
10+
from types import SimpleNamespace
1011
from typing import Any, Optional, Protocol, Union, runtime_checkable
1112

1213
import toml
@@ -38,6 +39,9 @@ def default(self, o: Any) -> Any:
3839
return o.to_dictionary()
3940
if isinstance(o, bytes):
4041
return o.hex()
42+
# needed because sdk-py returns SimpleNamespace objects that the json library does not know to serialize
43+
if isinstance(o, SimpleNamespace):
44+
return o.__dict__
4145
return super().default(o)
4246

4347

0 commit comments

Comments
 (0)