Skip to content

Commit 995d0ee

Browse files
authored
Merge pull request #511 from multiversx/hrp-as-arg
Added hrp as argument
2 parents 7df0a2c + f3e12cb commit 995d0ee

3 files changed

Lines changed: 8 additions & 22 deletions

File tree

multiversx_sdk_cli/cli_shared.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ def add_wallet_args(args: list[str], sub: Any):
176176
help="🔑 the address index; can be used for PEM files, keyfiles of type mnemonic or Ledger devices (default: %(default)s)",
177177
)
178178
sub.add_argument("--sender-username", required=False, help="🖄 the username of the sender")
179+
sub.add_argument(
180+
"--hrp", required=False, type=str, help="The hrp used to convert the address to its bech32 representation"
181+
)
179182

180183

181184
def add_guardian_wallet_args(args: list[str], sub: Any):
@@ -304,9 +307,13 @@ def prepare_account(args: Any):
304307

305308

306309
def _get_address_hrp(args: Any) -> str:
307-
"""If proxy is provided, fetch the hrp from the network, otherwise get the hrp from config"""
310+
"""Use hrp provided by the user. If not provided, fetch from network. If proxy not provided, get hrp from config."""
308311
hrp: str = ""
309312

313+
if hasattr(args, "hrp") and args.hrp:
314+
hrp = args.hrp
315+
return hrp
316+
310317
if hasattr(args, "proxy") and args.proxy:
311318
hrp = _get_hrp_from_proxy(args)
312319
elif hasattr(args, "api") and args.api:

multiversx_sdk_cli/tests/test_cli_contracts.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def test_contract_deploy():
2828
"https://testnet-api.multiversx.com",
2929
"--chain",
3030
"T",
31-
"--recall-nonce",
3231
"--gas-limit",
3332
"5000000",
3433
"--arguments",
@@ -57,7 +56,6 @@ def test_contract_upgrade():
5756
"https://testnet-api.multiversx.com",
5857
"--chain",
5958
"T",
60-
"--recall-nonce",
6159
"--gas-limit",
6260
"5000000",
6361
"--arguments",
@@ -86,7 +84,6 @@ def test_contract_call():
8684
"https://testnet-api.multiversx.com",
8785
"--chain",
8886
"T",
89-
"--recall-nonce",
9087
"--gas-limit",
9188
"5000000",
9289
"--arguments",
@@ -177,7 +174,6 @@ def test_contract_flow(capsys: Any):
177174
adder,
178175
"--pem",
179176
alice,
180-
"--recall-nonce",
181177
"--gas-limit",
182178
"5000000",
183179
"--proxy",
@@ -220,7 +216,6 @@ def test_contract_flow(capsys: Any):
220216
alice,
221217
"--function",
222218
"add",
223-
"--recall-nonce",
224219
"--gas-limit",
225220
"5000000",
226221
"--proxy",
@@ -262,7 +257,6 @@ def test_contract_flow(capsys: Any):
262257
adder,
263258
"--pem",
264259
alice,
265-
"--recall-nonce",
266260
"--gas-limit",
267261
"5000000",
268262
"--proxy",
@@ -287,7 +281,6 @@ def test_contract_deploy_without_required_arguments():
287281
adder,
288282
"--pem",
289283
alice,
290-
"--recall-nonce",
291284
"--gas-limit",
292285
"5000000",
293286
"--arguments",
@@ -490,7 +483,6 @@ def test_contract_query(capsys: Any):
490483
adder_abi,
491484
"--pem",
492485
alice,
493-
"--recall-nonce",
494486
"--gas-limit",
495487
"5000000",
496488
"--proxy",
@@ -516,7 +508,6 @@ def test_contract_query(capsys: Any):
516508
alice,
517509
"--function",
518510
"add",
519-
"--recall-nonce",
520511
"--gas-limit",
521512
"5000000",
522513
"--proxy",

multiversx_sdk_cli/tests/test_cli_validators_localnet.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ def test_stake():
3434
"localnet",
3535
"--proxy",
3636
"http://127.0.0.1:7950",
37-
"--recall-nonce",
3837
]
3938
)
4039
assert return_code == 0
@@ -78,7 +77,6 @@ def test_stake_top_up():
7877
"localnet",
7978
"--proxy",
8079
"http://127.0.0.1:7950",
81-
"--recall-nonce",
8280
]
8381
)
8482
assert return_code == 0
@@ -99,7 +97,6 @@ def test_unstake():
9997
"localnet",
10098
"--proxy",
10199
"http://127.0.0.1:7950",
102-
"--recall-nonce",
103100
]
104101
)
105102
assert return_code == 0
@@ -120,7 +117,6 @@ def test_unbond():
120117
"localnet",
121118
"--proxy",
122119
"http://127.0.0.1:7950",
123-
"--recall-nonce",
124120
]
125121
)
126122
assert return_code == 0
@@ -143,7 +139,6 @@ def test_unjail():
143139
"localnet",
144140
"--proxy",
145141
"http://127.0.0.1:7950",
146-
"--recall-nonce",
147142
]
148143
)
149144
assert return_code == 0
@@ -164,7 +159,6 @@ def test_change_reward_address():
164159
"localnet",
165160
"--proxy",
166161
"http://127.0.0.1:7950",
167-
"--recall-nonce",
168162
]
169163
)
170164
assert return_code == 0
@@ -185,7 +179,6 @@ def test_unstake_nodes():
185179
"localnet",
186180
"--proxy",
187181
"http://127.0.0.1:7950",
188-
"--recall-nonce",
189182
]
190183
)
191184
assert return_code == 0
@@ -206,7 +199,6 @@ def test_unstake_tokens():
206199
"localnet",
207200
"--proxy",
208201
"http://127.0.0.1:7950",
209-
"--recall-nonce",
210202
]
211203
)
212204
assert return_code == 0
@@ -227,7 +219,6 @@ def test_unbond_nodes():
227219
"localnet",
228220
"--proxy",
229221
"http://127.0.0.1:7950",
230-
"--recall-nonce",
231222
]
232223
)
233224
assert return_code == 0
@@ -248,7 +239,6 @@ def test_unbond_tokens():
248239
"localnet",
249240
"--proxy",
250241
"http://127.0.0.1:7950",
251-
"--recall-nonce",
252242
]
253243
)
254244
assert return_code == 0
@@ -267,7 +257,6 @@ def test_clean_registration_data():
267257
"localnet",
268258
"--proxy",
269259
"http://127.0.0.1:7950",
270-
"--recall-nonce",
271260
]
272261
)
273262
assert return_code == 0
@@ -288,7 +277,6 @@ def test_re_stake_unstaked_nodes():
288277
"localnet",
289278
"--proxy",
290279
"http://127.0.0.1:7950",
291-
"--recall-nonce",
292280
]
293281
)
294282
assert return_code == 0

0 commit comments

Comments
 (0)