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

Add transaction submission api test #66

Closed
wants to merge 2 commits into from

Conversation

0xmaayan
Copy link
Collaborator

Description

Need #65 to land first.

Add transaction submission api function tests

secp256k1 is skipped for now because of a user txn processor issue #42

  • submit single signer transaction with script / entry function / multisig payloads
  • submit multi agent transaction with script / entry function payloads
  • submit fee payer transaction with script / entry function / multisig payloads

Test Plan

pnpm test

@0xmaayan 0xmaayan requested a review from xbtmatt October 16, 2023 02:11
@0xmaayan 0xmaayan force-pushed the generate_transaction_test branch from 0e79871 to f212806 Compare October 16, 2023 17:58
Base automatically changed from generate_transaction_test to main October 16, 2023 18:01
@0xmaayan 0xmaayan force-pushed the transaction_submission_test branch from 8049a8a to 2f4cffe Compare October 16, 2023 18:04
@0xmaayan 0xmaayan enabled auto-merge (squash) October 16, 2023 18:07
@0xmaayan 0xmaayan force-pushed the transaction_submission_test branch from 2f4cffe to 0f77724 Compare October 17, 2023 02:13
@xbtmatt
Copy link
Contributor

xbtmatt commented Oct 17, 2023

At some point we should probably try to use the same little "test harness" for these lol, there's a ton of setup

my transaction arguments test suite looks very similar heh

signer: bob,
transaction: rawTxn,

await waitForTransaction({ aptosConfig: config, txnHash: response.hash });
Copy link
Contributor

@xbtmatt xbtmatt Oct 17, 2023

Choose a reason for hiding this comment

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

I think in general we should be doing a check here right? for each type

The node api will tell you if you have a fee payer signature, etc

const responseSignature = response.signature as TransactionFeePayerSignature;
expect(responseSignature.type).toEqual("fee_payer_signature");

this is what I do in mine

the 5 types:

ed25519_signature
secp256k1_ecdsa_signature
multi_agent_signature
fee_payer_signature
multi_ed25519_signature

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

hmm I guess it depends on what you are testing. those tests tests that transaction is submitted. We have some other tests that tests the signature in sign_transaction

await fundAccounts(aptos, [
senderAccount,
senderSecp256k1Account,
...recieverAccounts,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
...recieverAccounts,
...receiverAccounts,

ctrl+f reciever nit :D

@0xmaayan 0xmaayan force-pushed the transaction_submission_test branch from 0f77724 to a926370 Compare October 17, 2023 05:50
@0xmaayan 0xmaayan closed this Oct 20, 2023
auto-merge was automatically disabled October 20, 2023 19:24

Pull request was closed

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.

2 participants