Skip to content

Commit

Permalink
Create token v2 tests (#582)
Browse files Browse the repository at this point in the history
## Description

Add tests for token v2 processor
Test coverage increased: 
Before: <img width="1433" alt="Screenshot 2024-10-31 at 8 47 41 PM" src="https://github.com/user-attachments/assets/19a77826-23cf-4b7a-92db-42189e97d030"> 
After: <img width="1281" alt="Screenshot 2024-10-31 at 8 56 08 PM" src="https://github.com/user-attachments/assets/b9653acf-beab-4513-8ed6-0290db04c1e1">

To get even higher coverage we can add some tests for token v1s


## Testing 
### test_token_v2_burn_event_v1

![Screenshot 2024-10-31 at 5 24 54 PM](https://github.com/user-attachments/assets/952300c0-beff-47c9-9bb8-dd0c9645b747)
<img width="889" alt="Screenshot 2024-10-31 at 8 05 54 PM" src="https://github.com/user-attachments/assets/4e50bad5-9f82-4c80-b022-fb08ec198253">

### test_token_v2_burn_event_v2
<img width="1324" alt="Screenshot 2024-10-31 at 8 09 45 PM" src="https://github.com/user-attachments/assets/a21081af-6f11-4139-b63d-a7788b63bef9">

### test_token_v2_concurrent_aptos_mint

<img width="1550" alt="Screenshot 2024-10-31 at 8 27 33 PM" src="https://github.com/user-attachments/assets/dbe6fc1e-da1c-4041-ace8-42f33d8cdcad">
<img width="1400" alt="Screenshot 2024-10-31 at 8 25 05 PM" src="https://github.com/user-attachments/assets/cbc52c5d-1840-44ca-9ae7-ea69cc24d744">
<img width="1533" alt="Screenshot 2024-10-31 at 8 20 33 PM" src="https://github.com/user-attachments/assets/d98025ee-526a-46b4-9fbd-7ac3446f6804">
<img width="1317" alt="Screenshot 2024-10-31 at 8 11 32 PM" src="https://github.com/user-attachments/assets/dadcae2b-e5b6-4c4d-8c9c-16ee842a4a88">

### test_token_v2_fixed_supply
<img width="1264" alt="Screenshot 2024-10-31 at 8 36 02 PM" src="https://github.com/user-attachments/assets/bfbfe36c-1314-4d8f-af77-e9d700bfb55a">
<img width="1214" alt="Screenshot 2024-10-31 at 8 34 57 PM" src="https://github.com/user-attachments/assets/fa40c975-c724-48c6-a5aa-75140ecb5708">
(token ownership amount in BQ is incorrect)
<img width="1325" alt="Screenshot 2024-10-31 at 8 33 58 PM" src="https://github.com/user-attachments/assets/f1ff8e68-1c2d-4d96-baad-3dae8dc85e4d">
<img width="1314" alt="Screenshot 2024-10-31 at 8 32 32 PM" src="https://github.com/user-attachments/assets/8cbf4463-e2c6-41e6-bd83-54c7921283f2">

### test_token_v2_mint_and_transfer_event_v1
Number of token activities matches and data is correct
<img width="1217" alt="Screenshot 2024-10-31 at 8 39 45 PM" src="https://github.com/user-attachments/assets/17162a8b-2105-41b4-9121-fcc8826be5c4">

### test_token_v2_mutation_event
<img width="1345" alt="Screenshot 2024-10-31 at 8 41 07 PM" src="https://github.com/user-attachments/assets/dd43d9d7-02d2-441f-a339-a22107a8967c">


### test_token_v2_unlimited_supply
<img width="1317" alt="Screenshot 2024-10-31 at 8 42 21 PM" src="https://github.com/user-attachments/assets/6106261f-6432-44de-9a5e-49cb2d65ce29">
  • Loading branch information
rtso authored Nov 1, 2024
1 parent b4afe8b commit ed32dad
Show file tree
Hide file tree
Showing 428 changed files with 5,554 additions and 39 deletions.
6 changes: 3 additions & 3 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-index
aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "c8f12a75c3648fba889c3da657ff713cd5e676dc" }
aptos-protos = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb" }
aptos-system-utils = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "202bdccff2b2d333a385ae86a4fcf23e89da9f62" }
aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "9ffc0a383e416e5b4f9845f043be2fde8a9a5656" }
aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "751286c4373473ffaf9005e71066a9b1bc4e9054" }
aptos-indexer-testing-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "c8f12a75c3648fba889c3da657ff713cd5e676dc" }
async-trait = "0.1.53"
backtrace = "0.3.58"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 1080786089,
"write_set_change_index": 10,
"transaction_block_height": 210969872,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "110972396016310057",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 308783012,
"write_set_change_index": 8,
"transaction_block_height": 106350614,
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "106177548228160480",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 325355235,
"write_set_change_index": 8,
"transaction_block_height": 111985120,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "106457430431845969",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 453498957,
"write_set_change_index": 15,
"transaction_block_height": 146272590,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "108125185789884776",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 508365567,
"write_set_change_index": 18,
"transaction_block_height": 159068756,
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "108655487588791357",
"is_deleted": false
},
{
"key": "0x0000000000000000",
"transaction_version": 508365567,
"write_set_change_index": 19,
"transaction_block_height": 159068756,
"key": "0x0000000000000000",
"table_handle": "0x635198ef8a973c8da529ca94a6b564706137eb6c95976ba9be1144408fe300dd",
"decoded_key": "0",
"decoded_value": [
Expand Down Expand Up @@ -101,10 +101,10 @@
"is_deleted": false
},
{
"key": "0x0100000000000000",
"transaction_version": 508365567,
"write_set_change_index": 20,
"transaction_block_height": 159068756,
"key": "0x0100000000000000",
"table_handle": "0x635198ef8a973c8da529ca94a6b564706137eb6c95976ba9be1144408fe300dd",
"decoded_key": "1",
"decoded_value": [
Expand Down Expand Up @@ -237,10 +237,10 @@
"is_deleted": false
},
{
"key": "0x0200000000000000",
"transaction_version": 508365567,
"write_set_change_index": 21,
"transaction_block_height": 159068756,
"key": "0x0200000000000000",
"table_handle": "0x635198ef8a973c8da529ca94a6b564706137eb6c95976ba9be1144408fe300dd",
"decoded_key": "2",
"decoded_value": [
Expand Down Expand Up @@ -368,10 +368,10 @@
"is_deleted": false
},
{
"key": "0x0300000000000000",
"transaction_version": 508365567,
"write_set_change_index": 22,
"transaction_block_height": 159068756,
"key": "0x0300000000000000",
"table_handle": "0x635198ef8a973c8da529ca94a6b564706137eb6c95976ba9be1144408fe300dd",
"decoded_key": "3",
"decoded_value": [
Expand Down Expand Up @@ -519,10 +519,10 @@
"is_deleted": false
},
{
"key": "0x0400000000000000",
"transaction_version": 508365567,
"write_set_change_index": 23,
"transaction_block_height": 159068756,
"key": "0x0400000000000000",
"table_handle": "0x635198ef8a973c8da529ca94a6b564706137eb6c95976ba9be1144408fe300dd",
"decoded_key": "4",
"decoded_value": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 537250181,
"write_set_change_index": 11,
"transaction_block_height": 165399051,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "108925890145365759",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 578366445,
"write_set_change_index": 8,
"transaction_block_height": 174826957,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "109362269591398320",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 602320562,
"write_set_change_index": 12,
"transaction_block_height": 179784414,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "109588276694972701",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 967255533,
"write_set_change_index": 7,
"transaction_block_height": 187592972,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "109947820651494579",
"is_deleted": false
}
]
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 999929475,
"write_set_change_index": 30,
"transaction_block_height": 194508912,
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "110269921639741626",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"key": "0x0619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"transaction_version": 999930475,
"write_set_change_index": 12,
"transaction_block_height": 194509179,
"table_handle": "0x1b854694ae746cdbd8d44186ca4929b2b337df21d1c74633be19b2710552fdca",
"decoded_key": "0x619dc29a0aac8fa146714058e8dd6d2d0f3bdf5f6331907bf91f3acd81e6935",
"decoded_value": "110269921622761956",
"is_deleted": false
}
]
Loading

0 comments on commit ed32dad

Please sign in to comment.