Closed Lozu closed 8 months ago
Well, the test does not sign the DelegateAction
from relayer_test0.testnet
account and just puts placeholders there:
You should populate the public key with relayer_test0.testnet
public key, and then sign the DelegateAction with the private key and put the signature into the signature
field (which you cannot do since neither you nor I are owners of the keys, so for you to test I suggest you create a new account and replace relayer_test0.testnet
with your account and fill out the public key and sign it with your keypair).
See near.cli.rs implementation to learn more how to construct the meta-transaction properly: https://github.com/near/near-cli-rs/blob/1c9a7a62ed8eb31edea91f584090838b91f512a0/src/transaction_signature_options/mod.rs#L315-L353
You can use near-cli-rs without this relayer at all: https://asciinema.org/a/79Pwj2KxIHJgxC0CFrRTgfNcs?autoplay=1&t=1&speed=2; in order to create a meta-testnet
network, use the following commands:
near config \
add-connection \
--network-name testnet \
--connection-name meta-testnet \
--rpc-url https://rpc.testnet.near.org \
--wallet-url https://wallet.testnet.near.org/ \
--explorer-transaction-url https://explorer.testnet.near.org/transactions/ \
--linkdrop-account-id testnet \
--faucet-url https://helper.nearprotocol.com/account \
--meta-transaction-relayer-url http://127.0.0.1:3030
You are right. I just lacked some knowledge. Thank you. If unit tests author only wanted to test relaying itself, there is no issue.
I can write a patch with which relayed transactions from unit tests will be successful. If you think this is a good idea, let me know.
@Lozu I think it makes sense to have a proper example in the test. Please, go ahead with creating a PR
Even though cargo test finishes successfully and transactions are relayed (they can be seen at near explorer), they fail with the following:
For an example see https://explorer.testnet.near.org/transactions/2K45R7291Ddz6MkKapMACAq6g1ZBFnsrk9STyXFuHBG9. This is actually unmodified transaction from the first unit test.
I was unable to relay any transaction with success using pagoda relayer no matter how I formed them.