Skip to content

Commit

Permalink
integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
rtso committed Dec 6, 2024
1 parent 8b2f096 commit 323b0b1
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 10 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 = "e6867c50a2c30ef16ad6f82e02313b2ba5ce361a" }
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 = "60ee0c686c15480b2cbba224c205e03f479bcdbd" }
aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "8bb628129ff48241c650178caf1ff8bf53a44e5e" }
aptos-indexer-testing-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "e6867c50a2c30ef16ad6f82e02313b2ba5ce361a" }
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,17 @@
[
{
"token_data_id": "0x2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8",
"property_version_v1": "0",
"owner_address": "0xe2ebcbacd81584f97b6ba9a458239ea083428d75158c0d42ef38b6379527e99a",
"storage_id": "0xa5e6f84af35d356027c1513b37248bae3968c20720af6fc2d5c58b7c90ffda55",
"amount": "1",
"table_type_v1": "0x3::token::TokenStore",
"token_properties_mutated_v1": {},
"is_soulbound_v2": null,
"token_standard": "v1",
"is_fungible_v2": null,
"last_transaction_version": 19922017,
"last_transaction_timestamp": "2024-11-28T23:53:41.291148",
"non_transferrable_by_owner": null
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"token_data_id_hash": "2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8",
"property_version": "0",
"from_address": "0xd77942ad91c35a2d165fdec8f6a28ec48b6bb9f905db2fd0ac8a7e481a9c543e",
"to_address": "0xe2ebcbacd81584f97b6ba9a458239ea083428d75158c0d42ef38b6379527e99a",
"collection_data_id_hash": "84b2198ac10fdbb64bc3474ed0cf184b7bdcd5bc5f098a8858f2e48f379c5fcc",
"creator_address": "0xd77942ad91c35a2d165fdec8f6a28ec48b6bb9f905db2fd0ac8a7e481a9c543e",
"collection_name": "Alice's",
"name": "Alice's first token",
"amount": "0",
"table_handle": "0xc4b3a532f522e5cc021427b4d729938073a6d34949bd397490d4bbf96a4703f1",
"last_transaction_version": 19922017,
"collection_id": "0x84b2198ac10fdbb64bc3474ed0cf184b7bdcd5bc5f098a8858f2e48f379c5fcc",
"last_transaction_timestamp": "2024-11-28T23:53:41.291148",
"token_data_id": "0x2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8"
}
]
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,36 @@
[
{
"transaction_version": 19922017,
"event_index": 0,
"event_account_address": "0x0000000000000000000000000000000000000000000000000000000000000000",
"token_data_id": "0x2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8",
"property_version_v1": "0",
"type_": "0x3::token::TokenDeposit",
"from_address": null,
"to_address": "0xe2ebcbacd81584f97b6ba9a458239ea083428d75158c0d42ef38b6379527e99a",
"token_amount": "1",
"before_value": null,
"after_value": null,
"entry_function_id_str": "0x3::token_transfers::claim_script",
"token_standard": "v1",
"is_fungible_v2": null,
"transaction_timestamp": "2024-11-28T23:53:41.291148"
},
{
"transaction_version": 19922017,
"event_index": 1,
"event_account_address": "0x0000000000000000000000000000000000000000000000000000000000000000",
"token_data_id": "0x2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8",
"property_version_v1": "0",
"type_": "0x3::token_transfers::Claim",
"from_address": "0xd77942ad91c35a2d165fdec8f6a28ec48b6bb9f905db2fd0ac8a7e481a9c543e",
"to_address": "0xe2ebcbacd81584f97b6ba9a458239ea083428d75158c0d42ef38b6379527e99a",
"token_amount": "1",
"before_value": null,
"after_value": null,
"entry_function_id_str": "0x3::token_transfers::claim_script",
"token_standard": "v1",
"is_fungible_v2": null,
"transaction_timestamp": "2024-11-28T23:53:41.291148"
}
]
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,18 @@
[
{
"transaction_version": 19922017,
"write_set_change_index": 4,
"token_data_id": "0x2877fd783c3c7957b50941cce1b3b729dae16b5928e0ba0606cd282df2b085c8",
"property_version_v1": "0",
"owner_address": "0xe2ebcbacd81584f97b6ba9a458239ea083428d75158c0d42ef38b6379527e99a",
"storage_id": "0xa5e6f84af35d356027c1513b37248bae3968c20720af6fc2d5c58b7c90ffda55",
"amount": "1",
"table_type_v1": "0x3::token::TokenStore",
"token_properties_mutated_v1": {},
"is_soulbound_v2": null,
"token_standard": "v1",
"is_fungible_v2": null,
"transaction_timestamp": "2024-11-28T23:53:41.291148",
"non_transferrable_by_owner": null
}
]
10 changes: 10 additions & 0 deletions rust/integration-tests/src/sdk_tests/token_v2_processor_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ mod sdk_token_v2_processor_tests {
},
};
use aptos_indexer_test_transactions::{
IMPORTED_DEVNET_TXNS_19922017_TOKEN_V1_OFFER_CLAIM,
IMPORTED_DEVNET_TXNS_78753831_TOKEN_V1_MINT_TRANSFER_WITH_V2_EVENTS,
IMPORTED_DEVNET_TXNS_78753832_TOKEN_V2_MINT_TRANSFER_WITH_V2_EVENTS,
IMPORTED_MAINNET_TXNS_1058723093_TOKEN_V1_MINT_WITHDRAW_DEPOSIT_EVENTS,
Expand Down Expand Up @@ -314,6 +315,15 @@ mod sdk_token_v2_processor_tests {
.await;
}

#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn test_token_v1_offer_claim_no_table_metadata() {
process_single_transaction(
IMPORTED_DEVNET_TXNS_19922017_TOKEN_V1_OFFER_CLAIM,
Some("test_token_v1_offer_claim_no_table_metadata".to_string()),
)
.await;
}

/**
* This test includes processing for the following:
* - Resources
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,7 @@ impl TokenActivityV2 {
tokens_claimed: &mut TokenV1Claimed,
) -> anyhow::Result<Option<Self>> {
let event_type = event.type_str.clone();
tracing::info!("event_type: {}, event: {:?}", event_type, event);
if let Some(token_event) = &TokenEvent::from_event(&event_type, &event.data, txn_version)? {
tracing::info!(
"TokenActivityV2::get_v1_from_parsed_event: event_type: {}, event: {:?}",
event_type,
token_event
);
let event_account_address =
standardize_address(&event.key.as_ref().unwrap().account_address);
let token_activity_helper = match token_event {
Expand Down

0 comments on commit 323b0b1

Please sign in to comment.