Skip to content

Commit

Permalink
fix dns register using relayed transaction
Browse files Browse the repository at this point in the history
  • Loading branch information
popenta committed Jan 4, 2024
1 parent b327522 commit 0377e19
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions multiversx_sdk_cli/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
from multiversx_sdk_cli.accounts import Account
from multiversx_sdk_cli.constants import ADDRESS_ZERO_BECH32, DEFAULT_HRP
from multiversx_sdk_cli.contracts import query_contract
from multiversx_sdk_cli.transactions import (
do_prepare_transaction, tx_to_dictionary_as_inner_for_relayed_V1)
from multiversx_sdk_cli.transactions import (compute_relayed_v1_data,
do_prepare_transaction)

MaxNumShards = 256
ShardIdentiferLen = 2
Expand Down Expand Up @@ -50,7 +50,7 @@ def register(args: Any):
tx = do_prepare_transaction(args)

if hasattr(args, "relay") and args.relay:
args.outfile.write(tx_to_dictionary_as_inner_for_relayed_V1(tx))
args.outfile.write(compute_relayed_v1_data(tx))
return

cli_shared.send_or_simulate(tx, args)
Expand Down
21 changes: 21 additions & 0 deletions multiversx_sdk_cli/tests/test_cli_dns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from pathlib import Path

from multiversx_sdk_cli.cli import main

testdata_path = Path(__file__).parent / "testdata"


def test_prepare_relayed_dns_register_transaction():
alice = testdata_path / "alice.pem"

return_code = main([
"dns", "register",
"--pem", str(alice),
"--name", "alice.elrond",
"--nonce", "0",
"--gas-limit", "15000000",
"--chain", "T",
"--relay"
])

assert False if return_code else True
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "multiversx-sdk-cli"
version = "9.2.0"
version = "9.3.0"
authors = [
{ name="MultiversX" },
]
Expand Down

0 comments on commit 0377e19

Please sign in to comment.