-
Notifications
You must be signed in to change notification settings - Fork 36
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
Conversation
@@ -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): |
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
.
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") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cli_shared.add_outfile_arg(sub, what="the signed transaction") | |
cli_shared.add_outfile_arg(sub, what="the relayer signed transaction") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Tested locally ✅ |
6f0ae29
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:
A
pem
file, akeystore
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.