You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: apps/nextra/pages/en/build/indexer/indexer-sdk/advanced-tutorials/txn-script.mdx
+8-6
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,7 @@ Each configuration file defines a sequences of transactions for a test scenario.
46
46
- script_path: This field holds the path to the Move script file that will be executed as part of the transaction.
47
47
- sender_address: : This field contains the address of the account that will send the transaction.
48
48
49
+
The number of output is totally up to you, but the output name should be unique for each transaction. Add as many transactions as you need to test your processor.
49
50
```yaml
50
51
transactions:
51
52
- output_name: simple_user_script1
@@ -72,7 +73,7 @@ Each configuration file defines a sequences of transactions for a test scenario.
72
73
73
74
1. Read the configuration in the `move_fixtures` folder.
74
75
2. Execute the specified Move scripts.
75
-
3. Output the generated JSON files to the designated folder (`~/aptos-core/ecosystem/indexer-grpc/indexer-transaction-generator/json_transactions`).
76
+
3. Output the generated JSON files to the designated folder (`~/aptos-core/ecosystem/indexer-grpc/indexer-test-transactions/src/json_transactions`).
76
77
4. Overwrite `generated_transactions.rs` with the new transaction data based on the generated JSON files. This file contains the transaction constants that can be used in tests.
77
78
78
79
### Verification
@@ -85,7 +86,7 @@ Verify that the json_transactions folder in the target directory contains the ge
85
86
86
87
### Export the Generated File
87
88
88
-
Update the `mod.rs` file to include the generated Rust file containing the transaction constants. If `mod.rs` doesn’t exist, create one in the target folder:
89
+
Update the `mod.rs` file to include the generated Rust file containing the transaction constants. If `mod.rs` doesn't exist, create one in the target folder:
If you decided to output the rust file in a different crate, you can update you cargo.toml to import the crate containing the generated file as a dependency. Otherwise, you can simply import the generated file directly in your test file.
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.
105
+
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.
0 commit comments