Skip to content

Commit 9aff02d

Browse files
committed
update to latest sdk-y
1 parent 183f511 commit 9aff02d

3 files changed

Lines changed: 73 additions & 3 deletions

File tree

multiversx_sdk_cli/tests/test_cli_transactions.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,76 @@ def test_sign_transaction(capsys: Any):
393393
)
394394

395395

396+
def test_estimate_gas(capsys: Any):
397+
return_code = main(
398+
[
399+
"tx",
400+
"new",
401+
"--pem",
402+
str(testdata_path / "alice.pem"),
403+
"--receiver",
404+
"erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx",
405+
"--proxy",
406+
"https://devnet-gateway.multiversx.com",
407+
"--value",
408+
"1000000000000",
409+
]
410+
)
411+
assert return_code == 0
412+
413+
tx = _read_stdout(capsys)
414+
tx_json = json.loads(tx)["emittedTransaction"]
415+
assert tx_json["gasLimit"] == 50000
416+
417+
418+
def test_estimate_gas_for_guarded_tx(capsys: Any):
419+
return_code = main(
420+
[
421+
"tx",
422+
"new",
423+
"--pem",
424+
str(testdata_path / "alice.pem"),
425+
"--receiver",
426+
"erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx",
427+
"--proxy",
428+
"https://devnet-gateway.multiversx.com",
429+
"--value",
430+
"1000000000000",
431+
"--guardian",
432+
"erd1cqqxak4wun7508e0yj9ng843r6hv4mzd0hhpjpsejkpn9wa9yq8sj7u2u5",
433+
]
434+
)
435+
assert return_code == 0
436+
437+
tx = _read_stdout(capsys)
438+
tx_json = json.loads(tx)["emittedTransaction"]
439+
assert tx_json["gasLimit"] == 100000
440+
441+
442+
def test_estimate_gas_with_multiplier(capsys: Any):
443+
return_code = main(
444+
[
445+
"tx",
446+
"new",
447+
"--pem",
448+
str(testdata_path / "alice.pem"),
449+
"--receiver",
450+
"erd1spyavw0956vq68xj8y4tenjpq2wd5a9p2c6j8gsz7ztyrnpxrruqzu66jx",
451+
"--proxy",
452+
"https://devnet-gateway.multiversx.com",
453+
"--gas-limit-multiplier",
454+
"1.5",
455+
"--value",
456+
"1000000000000",
457+
]
458+
)
459+
assert return_code == 0
460+
461+
tx = _read_stdout(capsys)
462+
tx_json = json.loads(tx)["emittedTransaction"]
463+
assert tx_json["gasLimit"] == 75000
464+
465+
396466
def _read_stdout(capsys: Any) -> str:
397467
stdout: str = capsys.readouterr().out.strip()
398468
return stdout

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "multiversx-sdk-cli"
7-
version = "11.0.1"
7+
version = "11.1.0"
88
authors = [
99
{ name="MultiversX" },
1010
]
@@ -25,7 +25,7 @@ dependencies = [
2525
"ledgercomm[hid]",
2626
"rich==13.3.4",
2727
"argcomplete==3.2.2",
28-
"multiversx-sdk[ledger]==1.6.2"
28+
"multiversx-sdk[ledger]==2.0.0"
2929
]
3030

3131
[project.scripts]

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ ledgercomm[hid]
66
rich==13.3.4
77
argcomplete==3.2.2
88

9-
multiversx-sdk[ledger]==1.6.2
9+
multiversx-sdk[ledger]==2.0.0

0 commit comments

Comments
 (0)