Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added RelayedV3 support #457

Merged
merged 5 commits into from
Dec 6, 2024
Merged

Added RelayedV3 support #457

merged 5 commits into from
Dec 6, 2024

Conversation

popenta
Copy link
Contributor

@popenta popenta commented Nov 22, 2024

The --relayer arg has been added to add the relayer address.

The following args have been added as well, in order to sign a transaction with the relayer wallet:

"--relayer-pem"
"--relayer-pem-index"
"--relayer-keyfile"
"--relayer-passfile"
"--relayer-ledger"
"--relayer-ledger-account-index"
"--relayer-ledger-address-index"

A pem file, a keystore file or a ledger device can be used for signing.

mxpy tx relay

A new command mxpy tx relay has also been added. The command can be used to relay a previously signed transaction. The saved transaction can be loaded from a file using the --infile argument.

@popenta popenta self-assigned this Nov 22, 2024
@@ -122,6 +127,16 @@ def add_guardian_wallet_args(args: List[str], sub: Any):
sub.add_argument("--guardian-ledger-address-index", type=int, default=0, help="🔐 the index of the address when using Ledger")


def add_relayed_v3_wallet_args(args: List[str], sub: Any):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -105,5 +107,62 @@ def test_create_multi_transfer_transaction_with_single_egld_transfer(capsys: Any
assert data == "MultiESDTNFTTransfer@8049d639e5a6980d1cd2392abcce41029cda74a1563523a202f09641cc2618f8@01@45474c442d303030303030@@0de0b6b3a7640000"


def test_create_relayed_v3_transaction(capsys: Any):
return_code = main([
"tx", "new",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not possible to take a user transaction, already signed, and sign it with a relayer? Maybe mxpy tx relay or mxpy wallet sign-as-relayer? 💭

I think we should allow users to decouple (in a way or another) the step of signing as user from the step of signing as relayer.

Maybe brainstorm this a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, sounds like a good idea. Added a new command, mxpy tx relay.

andreibancioiu
andreibancioiu previously approved these changes Nov 25, 2024
sstanculeanu
sstanculeanu previously approved these changes Dec 5, 2024
sub = cli_shared.add_command_subparser(subparsers, "tx", "relay", f"Relay a previously saved transaction.{CLIOutputBuilder.describe()}")
cli_shared.add_relayed_v3_wallet_args(args, sub)
cli_shared.add_infile_arg(sub, what="a previously saved transaction")
cli_shared.add_outfile_arg(sub, what="the signed transaction")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cli_shared.add_outfile_arg(sub, what="the signed transaction")
cli_shared.add_outfile_arg(sub, what="the relayer signed transaction")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@sstanculeanu
Copy link

Tested locally ✅

@popenta popenta dismissed stale reviews from sstanculeanu and andreibancioiu via 6f0ae29 December 5, 2024 15:13
@popenta popenta merged commit b080e02 into main Dec 6, 2024
10 checks passed
@popenta popenta deleted the new-relayed-v3 branch December 6, 2024 07:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants