-
Notifications
You must be signed in to change notification settings - Fork 129
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
generating test transactions with move script #775
base: main
Are you sure you want to change the base?
generating test transactions with move script #775
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
f346475
to
337099f
Compare
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
337099f
to
41c221f
Compare
d35779c
to
18f5a07
Compare
41c221f
to
f4a5496
Compare
18f5a07
to
e3a6dae
Compare
f4a5496
to
7c9ef01
Compare
e3a6dae
to
51b360e
Compare
7c9ef01
to
443f3c1
Compare
51b360e
to
0307421
Compare
443f3c1
to
719d843
Compare
0307421
to
d1e31ef
Compare
719d843
to
fc57bc1
Compare
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
apps/nextra/pages/en/build/indexer/indexer-sdk/documentation/advanced-tutorials/txn-script.mdx
Outdated
Show resolved
Hide resolved
fc57bc1
to
ee03a7e
Compare
|
||
|
||
## Next Steps | ||
Once the transaction constants are integrated, you can use them in processor tests to validate functionality. For detailed instructions on writing processor tests, refer to [Writing Processor Tests](). |
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.
The empty link [Writing Processor Tests]()
will be broken when rendered. Please either add the correct URL path to the parentheses or remove the Markdown link formatting if the destination page doesn't exist yet.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
1. Read the configuration in the `move_fixtures` folder. | ||
2. Execute the specified Move scripts. | ||
3. Output the generated JSON files to the designated folder (`~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions`). |
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.
The output path shown in the documentation (~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions
) differs from the path specified in the command (../indexer-test-transactions/src/
). This discrepancy should be resolved to ensure users can follow the instructions correctly. Consider updating either the command or the documentation to show the correct output path.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
5fd548e
to
aeacbb0
Compare
ee03a7e
to
8736bb3
Compare
aeacbb0
to
60db79c
Compare
8736bb3
to
260f684
Compare
### Set up `move_fixtures` folder | ||
Before proceeding, ensure you have the move_fixtures folder set up in the appropriate location: | ||
1. Location: | ||
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. |
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.
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. | |
The `move_fixtures` folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. |
1. Location: | ||
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. | ||
|
||
<Callout> **Note:** Do not create the `move_fixtures` folder in your processor repository. All Move-related files should reside in the `aptos-core` repository under the specified directory. </Callout> |
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.
why can't you put move_fixtures in the processor repository? what if they want to add the fixtures to version control?
### Set Up Test Accounts | ||
|
||
1. These accounts will be used to deploy your module. | ||
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to the guide [here](https://aptos.dev/en/build/cli/setup-cli) to create accounts. |
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.
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to the guide [here](https://aptos.dev/en/build/cli/setup-cli) to create accounts. | |
2. Set up as many accounts as you need. These accounts will be used to send the scripted transactions. Refer to [Aptos CLI](https://aptos.dev/en/build/cli/setup-cli) to create accounts. |
|
||
## Overview: | ||
|
||
This section outlines how to create test transactions with Move scripts. |
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.
i think it'd help to have details on why you need scripted txn's, and when you would use a scripted txn instead of an imported txn
- **Add as a Dependency**: | ||
|
||
Include the crate containing the generated transactions as a dependency in the `Cargo.toml` file of your test crate. (Internally, transactions are stored in `aptos-core` and used in the [processor repo](https://github.com/aptos-labs/aptos-indexer-processors/blob/0c92d323b0f560b5f8601a831a36520ad9b72d68/rust/Cargo.toml#L34)). |
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 needed as per discussion on previous PR
|
||
```bash | ||
cd ~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator | ||
cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/src/ |
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.
cargo run -- --testing-folder ./imported_transactions --output-folder ../indexer-test-transactions/src/ | |
cargo run -- --testing-folder ./imported_transactions --output-folder /path/to/processor/repo/ |
60db79c
to
e8f5eaf
Compare
260f684
to
95c1024
Compare
e8f5eaf
to
775613a
Compare
95c1024
to
d958d58
Compare
The move_fixtures folder should be created in the `aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/imported_transactions` directory. This is the folder where Move scripts and their configurations for test transactions will be stored. | ||
|
||
<Callout> **Note:** Do not create the `move_fixtures` folder in your processor repository. All Move-related files should reside in the `aptos-core` repository under the specified directory. </Callout> | ||
2. Steps to set up the follder: |
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.
Typo: follder
-> folder
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
|
||
## Next Steps | ||
Once the transaction constants are integrated, you can use them in processor tests to validate functionality. For detailed instructions on writing processor tests, refer to [Writing Processor Tests](). |
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.
The link [Writing Processor Tests]()
appears to be a placeholder without a destination URL. Consider either adding the correct documentation URL or removing the link formatting until the documentation is available. This will prevent broken links in the published documentation.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
d958d58
to
72c37ec
Compare
775613a
to
475d800
Compare
72c37ec
to
8313ef5
Compare
@@ -0,0 +1,102 @@ | |||
--- | |||
title: "Aptos Transaction generated using Move Script" |
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.
I think it might be good to make the title of this consistent with the sidebar title you have in _meta.tsx
8313ef5
to
9d90f22
Compare
The configuration file should be structured like this: | ||
- output_name: This field specifies the name of the output file where the results of the transaction will be saved. | ||
- script_path: This field holds the path to the Move script file that will be executed as part of the transaction. | ||
- sender_address: : This field contains the address of the account that will send the 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.
There is a duplicate colon in sender_address: :
- one colon is sufficient here.
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
|
||
### Export the `json_transactions` Folder | ||
|
||
Since the `generated_transactions.rs` relies on the `json_transactions` Ensure the `json_transactions` folder is properly exported in the library file for your tests have direct access to the transaction data. |
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.
Missing comma after "json_transactions
" in this sentence. The corrected version should read: "Since the generated_transactions.rs
relies on the json_transactions
, ensure..."
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
The configuration file should be structured like this: | ||
- output_name: This field specifies the name of the output file where the results of the transaction will be saved. | ||
- script_path: This field holds the path to the Move script file that will be executed as part of the transaction. | ||
- sender_address: : This field contains the address of the account that will send the 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.
There is a duplicate colon in sender_address: :
- this should be sender_address:
Spotted by Graphite Reviewer
Is this helpful? React 👍 or 👎 to let us know.
Description
Checklist
pnpm fmt
?pnpm lint
?