From b95f3dae342102b98c971767711d0a7cd98eff88 Mon Sep 17 00:00:00 2001 From: yuunlimm Date: Wed, 16 Oct 2024 14:55:44 -0700 Subject: [PATCH] Update existing processor tests with the latest dependency change --- rust/Cargo.lock | 210 ++++++++++-------- rust/Cargo.toml | 8 +- rust/integration-tests/Cargo.toml | 18 ++ .../events.json} | 0 .../308783012/coin_supply.json | 10 + .../current_fungible_asset_balances.json | 13 ++ .../fungible_asset_activities.json} | 0 .../308783012/fungible_asset_balances.json | 14 ++ .../308783012/fungible_asset_metadata.json} | 0 .../token_activities_v2.json} | 0 .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../1/coin_supply.json | 10 + .../current_fungible_asset_balances.json} | 0 .../1/fungible_asset_activities.json} | 0 .../1/fungible_asset_balances.json} | 0 .../1/fungible_asset_metadata.json} | 0 .../1255836496/coin_supply.json | 10 + .../current_fungible_asset_balances.json | 46 ++++ .../fungible_asset_activities.json} | 0 .../1255836496/fungible_asset_balances.json | 50 +++++ .../1255836496/fungible_asset_metadata.json | 19 ++ .../278556781/coin_supply.json | 10 + .../current_fungible_asset_balances.json | 24 ++ .../fungible_asset_activities.json} | 0 .../278556781/fungible_asset_balances.json | 26 +++ .../278556781/fungible_asset_metadata.json | 19 ++ .../5523474016/coin_supply.json | 10 + .../current_fungible_asset_balances.json} | 0 .../5523474016/fungible_asset_activities.json | 1 + .../5523474016/fungible_asset_balances.json | 1 + .../5523474016/fungible_asset_metadata.json | 1 + .../5979639459/coin_supply.json | 10 + .../current_fungible_asset_balances.json | 24 ++ .../fungible_asset_activities.json} | 0 .../5979639459/fungible_asset_balances.json | 26 +++ .../5979639459/fungible_asset_metadata.json | 1 + .../5992795934/coin_supply.json | 10 + .../current_fungible_asset_balances.json | 35 +++ .../fungible_asset_activities.json} | 0 .../5992795934/fungible_asset_balances.json | 38 ++++ .../5992795934/fungible_asset_metadata.json | 1 + .../1/token_activities_v2.json | 1 + .../1255836496/token_activities_v2.json | 1 + .../278556781/token_activities_v2.json | 1 + .../5523474016/token_activities_v2.json | 1 + .../5979639459/token_activities_v2.json | 1 + .../5992795934/token_activities_v2.json | 1 + .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../events.json} | 0 .../23/coin_supply.json | 10 + .../23/current_fungible_asset_balances.json | 13 ++ .../fungible_asset_activities.json} | 2 +- .../23/fungible_asset_balances.json | 14 ++ .../23/fungible_asset_metadata.json | 1 + .../43/coin_supply.json | 10 + .../43/current_fungible_asset_balances.json | 13 ++ .../fungible_asset_activities.json} | 2 +- .../43/fungible_asset_balances.json | 14 ++ .../43/fungible_asset_metadata.json | 1 + .../65/coin_supply.json | 10 + .../65/current_fungible_asset_balances.json | 1 + .../fungible_asset_activities.json} | 2 +- .../65/fungible_asset_balances.json | 14 ++ .../65/fungible_asset_metadata.json | 1 + .../85/coin_supply.json | 10 + .../85/current_fungible_asset_balances.json | 13 ++ .../fungible_asset_activities.json} | 2 +- .../85/fungible_asset_balances.json | 14 ++ .../85/fungible_asset_metadata.json | 1 + .../23/token_activities_v2.json | 1 + .../43/token_activities_v2.json | 1 + .../65/token_activities_v2.json | 1 + .../85/token_activities_v2.json | 1 + .../src/diff_test_helper/event_processor.rs | 30 +++ .../fungible_asset_processor.rs | 95 ++++++++ .../src/diff_test_helper/mod.rs | 13 +- .../processors/event_processor.rs | 25 --- .../processors/fungible_asset_processor.rs | 26 --- .../src/diff_test_helper/processors/mod.rs | 3 - .../processors/token_v2_processor.rs | 24 -- .../diff_test_helper/token_v2_processor.rs | 30 +++ .../src/diff_tests/all_tests.rs | 146 +++++++----- rust/integration-tests/src/diff_tests/mod.rs | 82 ++++--- rust/integration-tests/src/lib.rs | 1 - .../src/models/queryable_models.rs | 95 +++++++- .../scenarios_tests/event_processor_tests.rs | 1 - rust/processor/src/db/postgres/schema.rs | 2 +- 94 files changed, 1098 insertions(+), 278 deletions(-) rename rust/integration-tests/expected_db_output_files/imported_mainnet_txns/events_processor/{events_processor_308783012.json => 308783012/events.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/{fungible_asset_processor_308783012.json => 308783012/fungible_asset_activities.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/{imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_1.json => imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_metadata.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_mainnet_txns/token_v2_processor/{token_v2_processor_308783012.json => 308783012/token_activities_v2.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_1.json => 1/events.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_1255836496.json => 1255836496/events.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_278556781.json => 278556781/events.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_5523474016.json => 5523474016/events.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_5979639459.json => 5979639459/events.json} (100%) rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/{events_processor_5992795934.json => 5992795934/events.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/coin_supply.json rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/{fungible_asset_processor_5523474016.json => 1/current_fungible_asset_balances.json} (100%) rename rust/integration-tests/expected_db_output_files/{scripted_txns/token_v2_processor/token_v2_processor_23.json => imported_testnet_txns/fungible_asset_processor/1/fungible_asset_activities.json} (100%) rename rust/integration-tests/expected_db_output_files/{scripted_txns/token_v2_processor/token_v2_processor_43.json => imported_testnet_txns/fungible_asset_processor/1/fungible_asset_balances.json} (100%) rename rust/integration-tests/expected_db_output_files/{scripted_txns/token_v2_processor/token_v2_processor_65.json => imported_testnet_txns/fungible_asset_processor/1/fungible_asset_metadata.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/{fungible_asset_processor_1255836496.json => 1255836496/fungible_asset_activities.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/{fungible_asset_processor_278556781.json => 278556781/fungible_asset_activities.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/coin_supply.json rename rust/integration-tests/expected_db_output_files/{scripted_txns/token_v2_processor/token_v2_processor_85.json => imported_testnet_txns/fungible_asset_processor/5523474016/current_fungible_asset_balances.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_activities.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/{fungible_asset_processor_5979639459.json => 5979639459/fungible_asset_activities.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/{fungible_asset_processor_5992795934.json => 5992795934/fungible_asset_activities.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1255836496/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/278556781/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5523474016/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5979639459/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5992795934/token_activities_v2.json rename rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/{events_processor_23.json => 23/events.json} (100%) rename rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/{events_processor_43.json => 43/events.json} (100%) rename rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/{events_processor_65.json => 65/events.json} (100%) rename rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/{events_processor_85.json => 85/events.json} (100%) create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/{fungible_asset_processor_23.json => 23/fungible_asset_activities.json} (91%) create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/{fungible_asset_processor_43.json => 43/fungible_asset_activities.json} (91%) create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/{fungible_asset_processor_65.json => 65/fungible_asset_activities.json} (91%) create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/coin_supply.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/current_fungible_asset_balances.json rename rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/{fungible_asset_processor_85.json => 85/fungible_asset_activities.json} (91%) create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_balances.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_metadata.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/23/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/43/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/65/token_activities_v2.json create mode 100644 rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/85/token_activities_v2.json create mode 100644 rust/integration-tests/src/diff_test_helper/event_processor.rs create mode 100644 rust/integration-tests/src/diff_test_helper/fungible_asset_processor.rs delete mode 100644 rust/integration-tests/src/diff_test_helper/processors/event_processor.rs delete mode 100644 rust/integration-tests/src/diff_test_helper/processors/fungible_asset_processor.rs delete mode 100644 rust/integration-tests/src/diff_test_helper/processors/mod.rs delete mode 100644 rust/integration-tests/src/diff_test_helper/processors/token_v2_processor.rs create mode 100644 rust/integration-tests/src/diff_test_helper/token_v2_processor.rs diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3348e3337..4fe1c2b88 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -141,7 +141,7 @@ checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "aptos-indexer-processor-sdk" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "ahash", "anyhow", @@ -174,7 +174,7 @@ dependencies = [ [[package]] name = "aptos-indexer-processor-sdk-server-framework" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "anyhow", "aptos-indexer-processor-sdk", @@ -198,19 +198,46 @@ dependencies = [ [[package]] name = "aptos-indexer-test-transactions" version = "1.0.0" -source = "git+https://github.com/aptos-labs/aptos-core.git?rev=7246f0536d599789d7dd5e9fb776554abbe11eac#7246f0536d599789d7dd5e9fb776554abbe11eac" +source = "git+https://github.com/aptos-labs/aptos-core.git?rev=c583502c69529fddbbf7e47bf920f1dc60e71b72#c583502c69529fddbbf7e47bf920f1dc60e71b72" +dependencies = [ + "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=c583502c69529fddbbf7e47bf920f1dc60e71b72)", + "serde_json", +] + +[[package]] +name = "aptos-indexer-testing-framework" +version = "0.1.0" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ - "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=7246f0536d599789d7dd5e9fb776554abbe11eac)", + "anyhow", + "aptos-indexer-processor-sdk", + "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", + "async-trait", + "diesel", + "diesel-async", + "diesel_migrations", + "futures", + "futures-util", + "native-tls", + "once_cell", + "postgres-native-tls", "serde_json", + "testcontainers", + "tokio", + "tokio-postgres", + "tokio-retry", + "tokio-stream", + "tonic 0.11.0", + "url", ] [[package]] name = "aptos-indexer-transaction-stream" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "anyhow", - "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b)", + "aptos-moving-average 0.1.0 (git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32)", "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", "chrono", "futures-util", @@ -235,7 +262,7 @@ dependencies = [ [[package]] name = "aptos-moving-average" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "chrono", ] @@ -281,7 +308,7 @@ dependencies = [ [[package]] name = "aptos-protos" version = "1.3.1" -source = "git+https://github.com/aptos-labs/aptos-core.git?rev=7246f0536d599789d7dd5e9fb776554abbe11eac#7246f0536d599789d7dd5e9fb776554abbe11eac" +source = "git+https://github.com/aptos-labs/aptos-core.git?rev=c583502c69529fddbbf7e47bf920f1dc60e71b72#c583502c69529fddbbf7e47bf920f1dc60e71b72" dependencies = [ "futures-core", "pbjson", @@ -737,9 +764,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.24" +version = "1.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "58e804ac3194a48bb129643eb1d62fcc20d18c6b8c181704489353d13120bcd1" dependencies = [ "jobserver", "libc", @@ -775,9 +802,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -785,9 +812,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -1070,18 +1097,18 @@ dependencies = [ [[package]] name = "derive_builder" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd33f37ee6a119146a1781d3356a7c26028f83d779b2e04ecd45fdc75c76877b" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" dependencies = [ "derive_builder_macro", ] [[package]] name = "derive_builder_core" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7431fa049613920234f22c47fdc33e6cf3ee83067091ea4277a3f8c4587aae38" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" dependencies = [ "darling", "proc-macro2", @@ -1091,9 +1118,9 @@ dependencies = [ [[package]] name = "derive_builder_macro" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4abae7035bf79b9877b779505d8cf3749285b80c43941eda66604841889451dc" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" dependencies = [ "derive_builder_core", "syn 2.0.79", @@ -1431,9 +1458,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1446,9 +1473,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1456,15 +1483,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1473,15 +1500,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1490,21 +1517,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1541,9 +1568,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" @@ -2030,7 +2057,7 @@ dependencies = [ "http 1.1.0", "hyper 1.4.1", "hyper-util", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", @@ -2219,7 +2246,7 @@ dependencies = [ [[package]] name = "instrumented-channel" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "delegate", "derive_builder", @@ -2239,26 +2266,36 @@ checksum = "8bb03732005da905c88227371639bf1ad885cc712789c011c31c5fb3ab3ccf02" name = "integration-tests" version = "1.0.0" dependencies = [ + "ahash", "anyhow", + "aptos-indexer-processor-sdk", "aptos-indexer-test-transactions", + "aptos-indexer-testing-framework", "aptos-protos 1.3.1 (git+https://github.com/aptos-labs/aptos-core.git?rev=5c48aee129b5a141be2792ffa3d9bd0a1a61c9cb)", "assert-json-diff", "bigdecimal", "chrono", + "clap", "diesel", "dirs", "field_count", + "futures", "itertools 0.12.1", "json-structural-diff", + "once_cell", "processor", "prost 0.12.6", "regex", + "sdk-processor", "serde", "serde_canonical_json", "serde_json", + "tempfile", "testcontainers", "testing-transactions", "tokio", + "tonic 0.11.0", + "url", ] [[package]] @@ -2275,9 +2312,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is-terminal" @@ -2351,9 +2388,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2865,21 +2902,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" @@ -3153,18 +3187,18 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -3334,9 +3368,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3577,7 +3611,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.23.13", + "rustls 0.23.14", "socket2", "thiserror", "tokio", @@ -3594,7 +3628,7 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.13", + "rustls 0.23.14", "slab", "thiserror", "tinyvec", @@ -3818,7 +3852,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn", - "rustls 0.23.13", + "rustls 0.23.14", "rustls-native-certs 0.8.0", "rustls-pemfile 2.2.0", "rustls-pki-types", @@ -3987,9 +4021,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "once_cell", "ring 0.17.8", @@ -4095,16 +4129,16 @@ checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "sample" version = "0.1.0" -source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=95d76e07dd66a20a0e50a9e6c559885bff7ab52b#95d76e07dd66a20a0e50a9e6c559885bff7ab52b" +source = "git+https://github.com/aptos-labs/aptos-indexer-processor-sdk.git?rev=376647ed207aa05a5149dfb49a0ae6e2ca15aa32#376647ed207aa05a5149dfb49a0ae6e2ca15aa32" dependencies = [ "tracing", ] [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -4298,9 +4332,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -4316,9 +4350,9 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ "darling", "proc-macro2", @@ -4928,7 +4962,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.13", + "rustls 0.23.14", "rustls-pki-types", "tokio", ] @@ -5395,9 +5429,9 @@ checksum = "b8dad83b4f25e74f184f64c43b150b91efe7647395b42289f38e50566d82855b" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -5406,9 +5440,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -5421,9 +5455,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -5433,9 +5467,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5443,9 +5477,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -5456,9 +5490,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -5475,9 +5509,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index be3a3c3e5..95fb8d0fd 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -30,11 +30,13 @@ testing-transactions = { path = "testing-transactions" } ahash = { version = "0.8.7", features = ["serde"] } anyhow = "1.0.86" -aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "95d76e07dd66a20a0e50a9e6c559885bff7ab52b" } -aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "95d76e07dd66a20a0e50a9e6c559885bff7ab52b" } +aptos-indexer-processor-sdk = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "376647ed207aa05a5149dfb49a0ae6e2ca15aa32" } +aptos-indexer-processor-sdk-server-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "376647ed207aa05a5149dfb49a0ae6e2ca15aa32" } 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 = "7246f0536d599789d7dd5e9fb776554abbe11eac" } +aptos-indexer-test-transactions = { git = "https://github.com/aptos-labs/aptos-core.git", rev = "c583502c69529fddbbf7e47bf920f1dc60e71b72" } +aptos-indexer-testing-framework = { git = "https://github.com/aptos-labs/aptos-indexer-processor-sdk.git", rev = "376647ed207aa05a5149dfb49a0ae6e2ca15aa32" } + async-trait = "0.1.53" backtrace = "0.3.58" base64 = "0.13.0" diff --git a/rust/integration-tests/Cargo.toml b/rust/integration-tests/Cargo.toml index fb6e1cf55..bd60c5c9a 100644 --- a/rust/integration-tests/Cargo.toml +++ b/rust/integration-tests/Cargo.toml @@ -13,24 +13,42 @@ repository = "https://github.com/aptos-labs/aptos-core" rust-version = { workspace = true } [dependencies] +ahash = { workspace = true } anyhow = { workspace = true } +aptos-indexer-processor-sdk = { workspace = true } aptos-indexer-test-transactions = { workspace = true } +aptos-indexer-testing-framework = { workspace = true } aptos-protos = { workspace = true } assert-json-diff = { workspace = true } bigdecimal = { workspace = true } chrono = { workspace = true } +clap = { workspace = true } diesel = { workspace = true } dirs = { workspace = true } field_count = { workspace = true } +futures = { workspace = true } itertools = { workspace = true } json-structural-diff = { workspace = true } +once_cell = { workspace = true } processor = { workspace = true } prost = { workspace = true } regex = { workspace = true } +sdk-processor = { workspace = true } serde = { workspace = true } serde_canonical_json = { workspace = true } serde_json = { workspace = true } +tempfile = { workspace = true } testcontainers = { workspace = true } testing-transactions = { workspace = true } tokio = { workspace = true } +tonic = { workspace = true } +url = { workspace = true } + [dev-dependencies] +ahash = { workspace = true } +aptos-indexer-processor-sdk = { workspace = true } +futures = { workspace = true } +sdk-processor = { workspace = true } +tempfile = { workspace = true } +tonic = { workspace = true } +url = { workspace = true } diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/events_processor/events_processor_308783012.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/events_processor/308783012/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_mainnet_txns/events_processor/events_processor_308783012.json rename to rust/integration-tests/expected_db_output_files/imported_mainnet_txns/events_processor/308783012/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/coin_supply.json new file mode 100644 index 000000000..c656edb6a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 308783012, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "106177548228160480", + "transaction_timestamp": "2023-10-24T09:08:03", + "transaction_epoch": 4534 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/current_fungible_asset_balances.json new file mode 100644 index 000000000..2e9144987 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/current_fungible_asset_balances.json @@ -0,0 +1,13 @@ +[ + { + "storage_id": "0xc617f51a505e596fb85ca0c323c884cbe718782a9606c8023b8910f7fa16fe87", + "owner_address": "0x28f87126ce5c2ead81ec4fef494c73d545757a9a634eb54d36ae5a9737f4f287", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "464000", + "last_transaction_timestamp": "2023-10-24T09:08:03", + "last_transaction_version": 308783012, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/fungible_asset_processor_308783012.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/fungible_asset_processor_308783012.json rename to rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_balances.json new file mode 100644 index 000000000..00d4eedf7 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_balances.json @@ -0,0 +1,14 @@ +[ + { + "transaction_version": 308783012, + "write_set_change_index": 0, + "storage_id": "0xc617f51a505e596fb85ca0c323c884cbe718782a9606c8023b8910f7fa16fe87", + "owner_address": "0x28f87126ce5c2ead81ec4fef494c73d545757a9a634eb54d36ae5a9737f4f287", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "464000", + "transaction_timestamp": "2023-10-24T09:08:03", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_1.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_metadata.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_1.json rename to rust/integration-tests/expected_db_output_files/imported_mainnet_txns/fungible_asset_processor/308783012/fungible_asset_metadata.json diff --git a/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/token_v2_processor/token_v2_processor_308783012.json b/rust/integration-tests/expected_db_output_files/imported_mainnet_txns/token_v2_processor/308783012/token_activities_v2.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_mainnet_txns/token_v2_processor/token_v2_processor_308783012.json rename to rust/integration-tests/expected_db_output_files/imported_mainnet_txns/token_v2_processor/308783012/token_activities_v2.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_1.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/1/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_1.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/1/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_1255836496.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/1255836496/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_1255836496.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/1255836496/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_278556781.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/278556781/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_278556781.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/278556781/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5523474016.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5523474016/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5523474016.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5523474016/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5979639459.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5979639459/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5979639459.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5979639459/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5992795934.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5992795934/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/events_processor_5992795934.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/events_processor/5992795934/events.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/coin_supply.json new file mode 100644 index 000000000..05dd7f35b --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 1, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18448344078275751615", + "transaction_timestamp": "2022-09-09T01:24:17", + "transaction_epoch": 1 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5523474016.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/current_fungible_asset_balances.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5523474016.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/current_fungible_asset_balances.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_23.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_23.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_43.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_balances.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_43.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_balances.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_65.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_metadata.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_65.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1/fungible_asset_metadata.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/coin_supply.json new file mode 100644 index 000000000..937a86719 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 1255836496, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "29152644549222814344", + "transaction_timestamp": "2024-06-18T05:07:55", + "transaction_epoch": 15650 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/current_fungible_asset_balances.json new file mode 100644 index 000000000..e5c643eb6 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/current_fungible_asset_balances.json @@ -0,0 +1,46 @@ +[ + { + "storage_id": "0x2086a7aaf18928233884d1725d4f92c5f26c67ac03cb98fe2dc40c99671282dc", + "owner_address": "0xf21d4c76354db6492841e31fefeaa5a3e8a1071d2bcbbdd1cf1cbc6fa3954b88", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "29450400", + "last_transaction_timestamp": "2024-06-18T05:07:55", + "last_transaction_version": 1255836496, + "token_standard": "v1" + }, + { + "storage_id": "0x56c216a20a151df2e917008e27f3b70250f1cbb80eeef24e64e2335630825fa3", + "owner_address": "0x6cbd58aec3b1eb5aff37ece4dff62b829ecbc6b851ee94056e852bcde5690ab4", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "17374075418", + "last_transaction_timestamp": "2024-06-18T05:07:55", + "last_transaction_version": 1255836496, + "token_standard": "v1" + }, + { + "storage_id": "0x7ea259eaaacce518a7479baca008e17fab2d0267a16e11979d52eb6c5433aad6", + "owner_address": "0xbe1390db94c2f8e83fd870c195656921ed4a2a5dee644c6d9c3168fea082a828", + "asset_type": "0x4551f2167c446b219c4dee2aa5496395c82a465cd57c5b362621af451c5d062b", + "is_primary": false, + "is_frozen": false, + "amount": "93054699", + "last_transaction_timestamp": "2024-06-18T05:07:55", + "last_transaction_version": 1255836496, + "token_standard": "v2" + }, + { + "storage_id": "0x8f4f0991e18bd9620a4b3756dbe15afd20135eaaa93e0d0b82e6e2412a8e12b8", + "owner_address": "0xbe1390db94c2f8e83fd870c195656921ed4a2a5dee644c6d9c3168fea082a828", + "asset_type": "0x4551f2167c446b219c4dee2aa5496395c82a465cd57c5b362621af451c5d062b", + "is_primary": false, + "is_frozen": false, + "amount": "17272186129", + "last_transaction_timestamp": "2024-06-18T05:07:55", + "last_transaction_version": 1255836496, + "token_standard": "v2" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_1255836496.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_1255836496.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_balances.json new file mode 100644 index 000000000..2dd21aa02 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_balances.json @@ -0,0 +1,50 @@ +[ + { + "transaction_version": 1255836496, + "write_set_change_index": 4, + "storage_id": "0x56c216a20a151df2e917008e27f3b70250f1cbb80eeef24e64e2335630825fa3", + "owner_address": "0x6cbd58aec3b1eb5aff37ece4dff62b829ecbc6b851ee94056e852bcde5690ab4", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "17374075418", + "transaction_timestamp": "2024-06-18T05:07:55", + "token_standard": "v1" + }, + { + "transaction_version": 1255836496, + "write_set_change_index": 5, + "storage_id": "0x7ea259eaaacce518a7479baca008e17fab2d0267a16e11979d52eb6c5433aad6", + "owner_address": "0xbe1390db94c2f8e83fd870c195656921ed4a2a5dee644c6d9c3168fea082a828", + "asset_type": "0x4551f2167c446b219c4dee2aa5496395c82a465cd57c5b362621af451c5d062b", + "is_primary": false, + "is_frozen": false, + "amount": "93054699", + "transaction_timestamp": "2024-06-18T05:07:55", + "token_standard": "v2" + }, + { + "transaction_version": 1255836496, + "write_set_change_index": 8, + "storage_id": "0x8f4f0991e18bd9620a4b3756dbe15afd20135eaaa93e0d0b82e6e2412a8e12b8", + "owner_address": "0xbe1390db94c2f8e83fd870c195656921ed4a2a5dee644c6d9c3168fea082a828", + "asset_type": "0x4551f2167c446b219c4dee2aa5496395c82a465cd57c5b362621af451c5d062b", + "is_primary": false, + "is_frozen": false, + "amount": "17272186129", + "transaction_timestamp": "2024-06-18T05:07:55", + "token_standard": "v2" + }, + { + "transaction_version": 1255836496, + "write_set_change_index": 16, + "storage_id": "0x2086a7aaf18928233884d1725d4f92c5f26c67ac03cb98fe2dc40c99671282dc", + "owner_address": "0xf21d4c76354db6492841e31fefeaa5a3e8a1071d2bcbbdd1cf1cbc6fa3954b88", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "29450400", + "transaction_timestamp": "2024-06-18T05:07:55", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_metadata.json new file mode 100644 index 000000000..3bbb1d851 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/1255836496/fungible_asset_metadata.json @@ -0,0 +1,19 @@ +[ + { + "asset_type": "0x4551f2167c446b219c4dee2aa5496395c82a465cd57c5b362621af451c5d062b", + "creator_address": "0x6cbd58aec3b1eb5aff37ece4dff62b829ecbc6b851ee94056e852bcde5690ab4", + "name": "Aptos Coin", + "symbol": "APT", + "decimals": 8, + "icon_uri": "", + "project_uri": "", + "last_transaction_version": 1255836496, + "last_transaction_timestamp": "2024-06-18T05:07:55", + "supply_aggregator_table_handle_v1": null, + "supply_aggregator_table_key_v1": null, + "token_standard": "v2", + "is_token_v2": null, + "maximum_v2": "340282366920938463463374607431768211455", + "supply_v2": "17374075418" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/coin_supply.json new file mode 100644 index 000000000..c7455ae56 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 278556781, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18544645433533405815", + "transaction_timestamp": "2022-10-13T01:46:57", + "transaction_epoch": 746 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/current_fungible_asset_balances.json new file mode 100644 index 000000000..f45ae6826 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/current_fungible_asset_balances.json @@ -0,0 +1,24 @@ +[ + { + "storage_id": "0xa0f5bae99aac34d548f1c5f487800e375e451c1d9576bcdae6f3902752c83c01", + "owner_address": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "10041540182", + "last_transaction_timestamp": "2022-10-13T01:46:57", + "last_transaction_version": 278556781, + "token_standard": "v1" + }, + { + "storage_id": "0xfc6edbad85409914ab088b68fed0528e4d8e36dcee31075bb8252b4f426a6cff", + "owner_address": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862", + "asset_type": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862::proton_cbdy::PRT_KFBCCC", + "is_primary": true, + "is_frozen": false, + "amount": "1000000000000000000", + "last_transaction_timestamp": "2022-10-13T01:46:57", + "last_transaction_version": 278556781, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_278556781.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_278556781.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_balances.json new file mode 100644 index 000000000..779d4957c --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_balances.json @@ -0,0 +1,26 @@ +[ + { + "transaction_version": 278556781, + "write_set_change_index": 3, + "storage_id": "0xa0f5bae99aac34d548f1c5f487800e375e451c1d9576bcdae6f3902752c83c01", + "owner_address": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "10041540182", + "transaction_timestamp": "2022-10-13T01:46:57", + "token_standard": "v1" + }, + { + "transaction_version": 278556781, + "write_set_change_index": 4, + "storage_id": "0xfc6edbad85409914ab088b68fed0528e4d8e36dcee31075bb8252b4f426a6cff", + "owner_address": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862", + "asset_type": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862::proton_cbdy::PRT_KFBCCC", + "is_primary": true, + "is_frozen": false, + "amount": "1000000000000000000", + "transaction_timestamp": "2022-10-13T01:46:57", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_metadata.json new file mode 100644 index 000000000..9733b88cd --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/278556781/fungible_asset_metadata.json @@ -0,0 +1,19 @@ +[ + { + "asset_type": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862::proton_cbdy::PRT_KFBCCC", + "creator_address": "0x589dabf3b43ef5c331ea3c0f9b6b005860c1f0ef94a5948d133e051b20c22862", + "name": "Aptos", + "symbol": "APT", + "decimals": 10, + "icon_uri": null, + "project_uri": null, + "last_transaction_version": 278556781, + "last_transaction_timestamp": "2022-10-13T01:46:57", + "supply_aggregator_table_handle_v1": null, + "supply_aggregator_table_key_v1": null, + "token_standard": "v1", + "is_token_v2": null, + "maximum_v2": null, + "supply_v2": null + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/coin_supply.json new file mode 100644 index 000000000..3d51eb2f6 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 5523474016, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "29159026553346716168", + "transaction_timestamp": "2024-07-29T00:02:18", + "transaction_epoch": 16643 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_85.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/current_fungible_asset_balances.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/token_v2_processor_85.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/current_fungible_asset_balances.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_activities.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_activities.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_activities.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_balances.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_balances.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5523474016/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/coin_supply.json new file mode 100644 index 000000000..04bab61ee --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 5979639459, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "29164832318786122251", + "transaction_timestamp": "2024-09-13T16:48:29", + "transaction_epoch": 17778 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/current_fungible_asset_balances.json new file mode 100644 index 000000000..9727ea023 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/current_fungible_asset_balances.json @@ -0,0 +1,24 @@ +[ + { + "storage_id": "0x239f9719aceb8223231f615e436fcfc8b7e7a6cb03350d00dc72b47678e5d78b", + "owner_address": "0xb7a4a81a3d513e3e18ee6bec61a001d7e18c5d92bb6645a2f21f0b0fec2531a6", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "10", + "last_transaction_timestamp": "2024-09-13T16:48:29", + "last_transaction_version": 5979639459, + "token_standard": "v1" + }, + { + "storage_id": "0x32edf0b123cd57094ba7b0b5a0b1524e0f2117b547adf65e8b0c08b39e30d242", + "owner_address": "0x54ce130990ecf55cd12de74bff03dcfaacf63066e0945d3c415d61644303da39", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "16673484350", + "last_transaction_timestamp": "2024-09-13T16:48:29", + "last_transaction_version": 5979639459, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5979639459.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5979639459.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_balances.json new file mode 100644 index 000000000..9305714f7 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_balances.json @@ -0,0 +1,26 @@ +[ + { + "transaction_version": 5979639459, + "write_set_change_index": 0, + "storage_id": "0x32edf0b123cd57094ba7b0b5a0b1524e0f2117b547adf65e8b0c08b39e30d242", + "owner_address": "0x54ce130990ecf55cd12de74bff03dcfaacf63066e0945d3c415d61644303da39", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "16673484350", + "transaction_timestamp": "2024-09-13T16:48:29", + "token_standard": "v1" + }, + { + "transaction_version": 5979639459, + "write_set_change_index": 2, + "storage_id": "0x239f9719aceb8223231f615e436fcfc8b7e7a6cb03350d00dc72b47678e5d78b", + "owner_address": "0xb7a4a81a3d513e3e18ee6bec61a001d7e18c5d92bb6645a2f21f0b0fec2531a6", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "10", + "transaction_timestamp": "2024-09-13T16:48:29", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5979639459/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/coin_supply.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/coin_supply.json new file mode 100644 index 000000000..78207671f --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 5992795934, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "29165678689185321503", + "transaction_timestamp": "2024-09-16T06:58:10", + "transaction_epoch": 17841 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/current_fungible_asset_balances.json new file mode 100644 index 000000000..fdb2aaccb --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/current_fungible_asset_balances.json @@ -0,0 +1,35 @@ +[ + { + "storage_id": "0x5120dc6832daa352228ba75c1e7e73f57a80b608c900a7060382516a5c035f20", + "owner_address": "0xd34ea8c6faa9d25a9f07504759c1d92bd5ad05af89062d57cf69dd4861fe3e3c", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "18901942640", + "last_transaction_timestamp": "2024-09-16T06:58:10", + "last_transaction_version": 5992795934, + "token_standard": "v1" + }, + { + "storage_id": "0x8bd5745daa2d6e5817819c6bf37600196e55cfba8c5bcdfdf55684bf4accbb9c", + "owner_address": "0x422e4585fdb8705aeaafb9501e7e03dc8125134da04ed8322244687c50c3fa55", + "asset_type": "0x618d700859af35c08518d1552c2601808261288cfd032461fb3424587484ac7f", + "is_primary": true, + "is_frozen": false, + "amount": "0", + "last_transaction_timestamp": "2024-09-16T06:58:10", + "last_transaction_version": 5992795934, + "token_standard": "v2" + }, + { + "storage_id": "0xfe90bdd996728b93e09f5d59fd91d6d44be85ab7acea5d1ed535b4c13b2c32c0", + "owner_address": "0x13fc6cb932ab90e65ce901460ce8d4b232d4e365294c6ea5afca94625adba47f", + "asset_type": "0x618d700859af35c08518d1552c2601808261288cfd032461fb3424587484ac7f", + "is_primary": true, + "is_frozen": false, + "amount": "9996985969300000000", + "last_transaction_timestamp": "2024-09-16T06:58:10", + "last_transaction_version": 5992795934, + "token_standard": "v2" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5992795934.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_activities.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/fungible_asset_processor_5992795934.json rename to rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_activities.json diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_balances.json new file mode 100644 index 000000000..750b30768 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_balances.json @@ -0,0 +1,38 @@ +[ + { + "transaction_version": 5992795934, + "write_set_change_index": 0, + "storage_id": "0x8bd5745daa2d6e5817819c6bf37600196e55cfba8c5bcdfdf55684bf4accbb9c", + "owner_address": "0x422e4585fdb8705aeaafb9501e7e03dc8125134da04ed8322244687c50c3fa55", + "asset_type": "0x618d700859af35c08518d1552c2601808261288cfd032461fb3424587484ac7f", + "is_primary": true, + "is_frozen": false, + "amount": "0", + "transaction_timestamp": "2024-09-16T06:58:10", + "token_standard": "v2" + }, + { + "transaction_version": 5992795934, + "write_set_change_index": 2, + "storage_id": "0x5120dc6832daa352228ba75c1e7e73f57a80b608c900a7060382516a5c035f20", + "owner_address": "0xd34ea8c6faa9d25a9f07504759c1d92bd5ad05af89062d57cf69dd4861fe3e3c", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "18901942640", + "transaction_timestamp": "2024-09-16T06:58:10", + "token_standard": "v1" + }, + { + "transaction_version": 5992795934, + "write_set_change_index": 4, + "storage_id": "0xfe90bdd996728b93e09f5d59fd91d6d44be85ab7acea5d1ed535b4c13b2c32c0", + "owner_address": "0x13fc6cb932ab90e65ce901460ce8d4b232d4e365294c6ea5afca94625adba47f", + "asset_type": "0x618d700859af35c08518d1552c2601808261288cfd032461fb3424587484ac7f", + "is_primary": true, + "is_frozen": false, + "amount": "9996985969300000000", + "transaction_timestamp": "2024-09-16T06:58:10", + "token_standard": "v2" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/fungible_asset_processor/5992795934/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1255836496/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1255836496/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/1255836496/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/278556781/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/278556781/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/278556781/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5523474016/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5523474016/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5523474016/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5979639459/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5979639459/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5979639459/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5992795934/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5992795934/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/imported_testnet_txns/token_v2_processor/5992795934/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_23.json b/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/23/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_23.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/23/events.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_43.json b/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/43/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_43.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/43/events.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_65.json b/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/65/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_65.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/65/events.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_85.json b/rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/85/events.json similarity index 100% rename from rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/events_processor_85.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/events_processor/85/events.json diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/coin_supply.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/coin_supply.json new file mode 100644 index 000000000..9b4e4e500 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 23, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18446744073709451425", + "transaction_timestamp": "2024-10-01T22:06:51", + "transaction_epoch": 2 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/current_fungible_asset_balances.json new file mode 100644 index 000000000..fe915e35c --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/current_fungible_asset_balances.json @@ -0,0 +1,13 @@ +[ + { + "storage_id": "0x9cfa839238cb942fbc487ff341fcdccabacd01e29864f594587900aa3a9d88b2", + "owner_address": "0x765d8c8d4d5859f43a56e2756fbf5f3d2483dbaa14f3fb62872df820d6e64eff", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "99999700", + "last_transaction_timestamp": "2024-10-01T22:06:51", + "last_transaction_version": 23, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_23.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_activities.json similarity index 91% rename from rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_23.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_activities.json index ce747c0d5..2bfb044d3 100644 --- a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_23.json +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_activities.json @@ -14,7 +14,7 @@ "entry_function_id_str": null, "block_height": 11, "token_standard": "v1", - "transaction_timestamp": "2024-09-27T07:15:12", + "transaction_timestamp": "2024-10-01T22:06:51", "storage_refund_amount": "0" } ] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_balances.json new file mode 100644 index 000000000..608809af1 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_balances.json @@ -0,0 +1,14 @@ +[ + { + "transaction_version": 23, + "write_set_change_index": 0, + "storage_id": "0x9cfa839238cb942fbc487ff341fcdccabacd01e29864f594587900aa3a9d88b2", + "owner_address": "0x765d8c8d4d5859f43a56e2756fbf5f3d2483dbaa14f3fb62872df820d6e64eff", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "99999700", + "transaction_timestamp": "2024-10-01T22:06:51", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/23/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/coin_supply.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/coin_supply.json new file mode 100644 index 000000000..d0ab00ec2 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 43, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18446744073709351225", + "transaction_timestamp": "2024-10-01T22:06:56", + "transaction_epoch": 2 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/current_fungible_asset_balances.json new file mode 100644 index 000000000..9dd98afb9 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/current_fungible_asset_balances.json @@ -0,0 +1,13 @@ +[ + { + "storage_id": "0xee7ccdc3a833754267c71df9534640b532352f734e07509cbe48561d23d05831", + "owner_address": "0x8f0de18409d6fca18c72fac4062fc0f9baa6404296fed93a3ad0250fb671f8b3", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "99999700", + "last_transaction_timestamp": "2024-10-01T22:06:56", + "last_transaction_version": 43, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_43.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_activities.json similarity index 91% rename from rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_43.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_activities.json index 1c5aaf797..09f4f5c43 100644 --- a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_43.json +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_activities.json @@ -14,7 +14,7 @@ "entry_function_id_str": null, "block_height": 20, "token_standard": "v1", - "transaction_timestamp": "2024-09-27T07:15:18", + "transaction_timestamp": "2024-10-01T22:06:56", "storage_refund_amount": "0" } ] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_balances.json new file mode 100644 index 000000000..b825d94b9 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_balances.json @@ -0,0 +1,14 @@ +[ + { + "transaction_version": 43, + "write_set_change_index": 0, + "storage_id": "0xee7ccdc3a833754267c71df9534640b532352f734e07509cbe48561d23d05831", + "owner_address": "0x8f0de18409d6fca18c72fac4062fc0f9baa6404296fed93a3ad0250fb671f8b3", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "99999700", + "transaction_timestamp": "2024-10-01T22:06:56", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/43/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/coin_supply.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/coin_supply.json new file mode 100644 index 000000000..3bc7c8265 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 65, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18446744073809350825", + "transaction_timestamp": "2024-10-01T22:07:03", + "transaction_epoch": 2 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/current_fungible_asset_balances.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/current_fungible_asset_balances.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_65.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_activities.json similarity index 91% rename from rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_65.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_activities.json index 35d37b7c1..ece462aa5 100644 --- a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_65.json +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_activities.json @@ -14,7 +14,7 @@ "entry_function_id_str": null, "block_height": 30, "token_standard": "v1", - "transaction_timestamp": "2024-09-27T07:15:25", + "transaction_timestamp": "2024-10-01T22:07:03", "storage_refund_amount": "0" } ] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_balances.json new file mode 100644 index 000000000..cf9283b5e --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_balances.json @@ -0,0 +1,14 @@ +[ + { + "transaction_version": 65, + "write_set_change_index": 0, + "storage_id": "0xba2fa98d311f0adb1d6608dfbc6d66b6e583c0b8f6bbadea7d241f7e1b0b1080", + "owner_address": "0xa531b7fdd7917f73ca216d89a8d9ce0cf7e7cfb9086ca6f6cbf9521532748d16", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "99999700", + "transaction_timestamp": "2024-10-01T22:07:03", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/65/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/coin_supply.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/coin_supply.json new file mode 100644 index 000000000..74249401b --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/coin_supply.json @@ -0,0 +1,10 @@ +[ + { + "transaction_version": 85, + "coin_type_hash": "91ceb1308a98389691e05158b07ed5f079ab78461a6bb8d5a4054b1bb5cb8bb6", + "coin_type": "0x1::aptos_coin::AptosCoin", + "supply": "18446744073909449225", + "transaction_timestamp": "2024-10-01T22:07:09", + "transaction_epoch": 2 + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/current_fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/current_fungible_asset_balances.json new file mode 100644 index 000000000..36d44a3e7 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/current_fungible_asset_balances.json @@ -0,0 +1,13 @@ +[ + { + "storage_id": "0xba2fa98d311f0adb1d6608dfbc6d66b6e583c0b8f6bbadea7d241f7e1b0b1080", + "owner_address": "0xa531b7fdd7917f73ca216d89a8d9ce0cf7e7cfb9086ca6f6cbf9521532748d16", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "199999400", + "last_transaction_timestamp": "2024-10-01T22:07:09", + "last_transaction_version": 85, + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_85.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_activities.json similarity index 91% rename from rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_85.json rename to rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_activities.json index 16d6f8f04..593947fa6 100644 --- a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/fungible_asset_processor_85.json +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_activities.json @@ -14,7 +14,7 @@ "entry_function_id_str": null, "block_height": 39, "token_standard": "v1", - "transaction_timestamp": "2024-09-27T07:15:31", + "transaction_timestamp": "2024-10-01T22:07:09", "storage_refund_amount": "0" } ] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_balances.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_balances.json new file mode 100644 index 000000000..3b92bffd5 --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_balances.json @@ -0,0 +1,14 @@ +[ + { + "transaction_version": 85, + "write_set_change_index": 0, + "storage_id": "0xba2fa98d311f0adb1d6608dfbc6d66b6e583c0b8f6bbadea7d241f7e1b0b1080", + "owner_address": "0xa531b7fdd7917f73ca216d89a8d9ce0cf7e7cfb9086ca6f6cbf9521532748d16", + "asset_type": "0x1::aptos_coin::AptosCoin", + "is_primary": true, + "is_frozen": false, + "amount": "199999400", + "transaction_timestamp": "2024-10-01T22:07:09", + "token_standard": "v1" + } +] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_metadata.json b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_metadata.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/fungible_asset_processor/85/fungible_asset_metadata.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/23/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/23/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/23/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/43/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/43/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/43/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/65/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/65/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/65/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/85/token_activities_v2.json b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/85/token_activities_v2.json new file mode 100644 index 000000000..0637a088a --- /dev/null +++ b/rust/integration-tests/expected_db_output_files/scripted_txns/token_v2_processor/85/token_activities_v2.json @@ -0,0 +1 @@ +[] \ No newline at end of file diff --git a/rust/integration-tests/src/diff_test_helper/event_processor.rs b/rust/integration-tests/src/diff_test_helper/event_processor.rs new file mode 100644 index 000000000..28e9ea85c --- /dev/null +++ b/rust/integration-tests/src/diff_test_helper/event_processor.rs @@ -0,0 +1,30 @@ +use crate::models::queryable_models::Event; +use anyhow::Result; +use diesel::{ + pg::PgConnection, + query_dsl::methods::{FilterDsl, ThenOrderDsl}, + ExpressionMethods, RunQueryDsl, +}; +use processor::schema::events::dsl::*; +use serde_json::Value; +use std::collections::HashMap; + +#[allow(dead_code)] +pub fn load_data(conn: &mut PgConnection, txn_version: &str) -> Result> { + let mut result_map: HashMap = HashMap::new(); + + let events_result = events + .filter(transaction_version.eq(txn_version.parse::().unwrap())) + .then_order_by(event_index.asc()) + .load::(conn); + + let all_events = events_result?; + let events_json_data = serde_json::to_string_pretty(&all_events)?; + + result_map.insert( + "events".to_string(), + serde_json::from_str(&events_json_data)?, + ); + + Ok(result_map) +} diff --git a/rust/integration-tests/src/diff_test_helper/fungible_asset_processor.rs b/rust/integration-tests/src/diff_test_helper/fungible_asset_processor.rs new file mode 100644 index 000000000..24a730350 --- /dev/null +++ b/rust/integration-tests/src/diff_test_helper/fungible_asset_processor.rs @@ -0,0 +1,95 @@ +use crate::models::queryable_models::{ + CoinSupply, CurrentFungibleAssetBalance, FungibleAssetActivity, FungibleAssetBalance, + FungibleAssetMetadataModel, +}; +use anyhow::Result; +use diesel::{ + pg::PgConnection, + query_dsl::methods::{FilterDsl, ThenOrderDsl}, + ExpressionMethods, RunQueryDsl, +}; +use processor::schema::{ + coin_supply::dsl as cs_dsl, current_fungible_asset_balances_legacy::dsl as cfab_dsl, + fungible_asset_activities::dsl as faa_dsl, fungible_asset_balances::dsl as fab_dsl, + fungible_asset_metadata::dsl as fam_dsl, +}; +use serde_json::Value; +use std::collections::HashMap; + +#[allow(dead_code)] +pub fn load_data(conn: &mut PgConnection, txn_version: &str) -> Result> { + let mut result_map: HashMap = HashMap::new(); + + // Query from fungible_asset_activities + let fungible_asset_activities_result = faa_dsl::fungible_asset_activities + .filter(faa_dsl::transaction_version.eq(txn_version.parse::().unwrap())) + .then_order_by(faa_dsl::event_index.asc()) + .load::(conn); + let all_fungible_asset_activities = fungible_asset_activities_result?; + let fungible_asset_activities_json = + serde_json::to_string_pretty(&all_fungible_asset_activities)?; + result_map.insert( + "fungible_asset_activities".to_string(), + serde_json::from_str(&fungible_asset_activities_json)?, + ); + + // Query from fungible_asset_metadata + let fungible_asset_metadata_result = fam_dsl::fungible_asset_metadata + .filter(fam_dsl::last_transaction_version.eq(txn_version.parse::().unwrap())) + .load::(conn); + let all_fungible_asset_metadata = fungible_asset_metadata_result?; + let fungible_asset_metadata_json = serde_json::to_string_pretty(&all_fungible_asset_metadata)?; + result_map.insert( + "fungible_asset_metadata".to_string(), + serde_json::from_str(&fungible_asset_metadata_json)?, + ); + + // Query from fungible_asset_balances + let fungible_asset_balances_result = fab_dsl::fungible_asset_balances + .filter(fab_dsl::transaction_version.eq(txn_version.parse::().unwrap())) + .load::(conn); + let all_fungible_asset_balances = fungible_asset_balances_result?; + let fungible_asset_balances_json = serde_json::to_string_pretty(&all_fungible_asset_balances)?; + result_map.insert( + "fungible_asset_balances".to_string(), + serde_json::from_str(&fungible_asset_balances_json)?, + ); + + // Query from current_fungible_asset_balances + let current_fungible_asset_balances_result = cfab_dsl::current_fungible_asset_balances_legacy + .filter(cfab_dsl::last_transaction_version.eq(txn_version.parse::().unwrap())) + .load::(conn); + let all_current_fungible_asset_balances = current_fungible_asset_balances_result?; + let current_fungible_asset_balances_json = + serde_json::to_string_pretty(&all_current_fungible_asset_balances)?; + result_map.insert( + "current_fungible_asset_balances".to_string(), + serde_json::from_str(¤t_fungible_asset_balances_json)?, + ); + + // Query from current_unified_fungible_asset_balances + // TODO: handle v1 and v2 + // let current_unified_fungible_asset_balances_result = cu_fab_dsl::current_fungible_asset_balances + // .filter(cu_fab_dsl::transaction_version.eq(txn_version.parse::().unwrap())) + // .load::(conn); + // let all_current_unified_fungible_asset_balances = current_unified_fungible_asset_balances_result?; + // let current_unified_fungible_asset_balances_json = serde_json::to_string_pretty(&all_current_unified_fungible_asset_balances)?; + // result_map.insert( + // "current_unified_fungible_asset_balances".to_string(), + // serde_json::from_str(¤t_unified_fungible_asset_balances_json)?, + // ); + + // Query from coin_supply + let coin_supply_result = cs_dsl::coin_supply + .filter(cs_dsl::transaction_version.eq(txn_version.parse::().unwrap())) + .load::(conn); + let all_coin_supply = coin_supply_result?; + let coin_supply_json = serde_json::to_string_pretty(&all_coin_supply)?; + result_map.insert( + "coin_supply".to_string(), + serde_json::from_str(&coin_supply_json)?, + ); + + // Return the complete map containing all table data + Ok(result_map) +} diff --git a/rust/integration-tests/src/diff_test_helper/mod.rs b/rust/integration-tests/src/diff_test_helper/mod.rs index a140cebda..78624537a 100644 --- a/rust/integration-tests/src/diff_test_helper/mod.rs +++ b/rust/integration-tests/src/diff_test_helper/mod.rs @@ -1,10 +1,3 @@ -use diesel::pg::PgConnection; -use serde_json::Value; - -pub mod processors; - -pub trait ProcessorTestHelper: Send + Sync { - // TODO: This only supports one table per processor. We need to support multiple tables. - #[allow(dead_code)] - fn load_data(&self, conn: &mut PgConnection, txn_version: &str) -> anyhow::Result; -} +pub mod event_processor; +pub mod fungible_asset_processor; +pub mod token_v2_processor; diff --git a/rust/integration-tests/src/diff_test_helper/processors/event_processor.rs b/rust/integration-tests/src/diff_test_helper/processors/event_processor.rs deleted file mode 100644 index 2a4656ddb..000000000 --- a/rust/integration-tests/src/diff_test_helper/processors/event_processor.rs +++ /dev/null @@ -1,25 +0,0 @@ -use crate::{diff_test_helper::ProcessorTestHelper, models::queryable_models::Event}; -use anyhow::Result; -use diesel::{ - pg::PgConnection, - query_dsl::methods::{FilterDsl, ThenOrderDsl}, - ExpressionMethods, RunQueryDsl, -}; -use processor::schema::events::dsl::*; -use serde_json::Value; - -// Example implementation for the EventsProcessor -pub struct EventsProcessorTestHelper; - -impl ProcessorTestHelper for EventsProcessorTestHelper { - fn load_data(&self, conn: &mut PgConnection, txn_version: &str) -> Result { - let events_result = events - .filter(transaction_version.eq(txn_version.parse::().unwrap())) - .then_order_by(event_index.asc()) - .load::(conn); - - let all_events = events_result?; - let json_data = serde_json::to_string_pretty(&all_events)?; - Ok(serde_json::from_str(&json_data)?) - } -} diff --git a/rust/integration-tests/src/diff_test_helper/processors/fungible_asset_processor.rs b/rust/integration-tests/src/diff_test_helper/processors/fungible_asset_processor.rs deleted file mode 100644 index 1c489ef81..000000000 --- a/rust/integration-tests/src/diff_test_helper/processors/fungible_asset_processor.rs +++ /dev/null @@ -1,26 +0,0 @@ -use crate::{ - diff_test_helper::ProcessorTestHelper, models::queryable_models::FungibleAssetActivity, -}; -use anyhow::Result; -use diesel::{ - pg::PgConnection, - query_dsl::methods::{FilterDsl, ThenOrderDsl}, - ExpressionMethods, RunQueryDsl, -}; -use processor::schema::fungible_asset_activities::dsl::*; -use serde_json::Value; - -pub struct FungibleAssetProcessorTestHelper; - -impl ProcessorTestHelper for FungibleAssetProcessorTestHelper { - fn load_data(&self, conn: &mut PgConnection, txn_version: &str) -> Result { - let fungible_asset_activities_result = fungible_asset_activities - .filter(transaction_version.eq(txn_version.parse::().unwrap())) - .then_order_by(event_index.asc()) - .load::(conn); - - let all_fungible_asset_activities = fungible_asset_activities_result?; - let json_data = serde_json::to_string_pretty(&all_fungible_asset_activities)?; - Ok(serde_json::from_str(&json_data)?) - } -} diff --git a/rust/integration-tests/src/diff_test_helper/processors/mod.rs b/rust/integration-tests/src/diff_test_helper/processors/mod.rs deleted file mode 100644 index 78624537a..000000000 --- a/rust/integration-tests/src/diff_test_helper/processors/mod.rs +++ /dev/null @@ -1,3 +0,0 @@ -pub mod event_processor; -pub mod fungible_asset_processor; -pub mod token_v2_processor; diff --git a/rust/integration-tests/src/diff_test_helper/processors/token_v2_processor.rs b/rust/integration-tests/src/diff_test_helper/processors/token_v2_processor.rs deleted file mode 100644 index 8921c18d2..000000000 --- a/rust/integration-tests/src/diff_test_helper/processors/token_v2_processor.rs +++ /dev/null @@ -1,24 +0,0 @@ -use crate::{diff_test_helper::ProcessorTestHelper, models::queryable_models::TokenActivityV2}; -use anyhow::Result; -use diesel::{ - pg::PgConnection, - query_dsl::methods::{FilterDsl, ThenOrderDsl}, - ExpressionMethods, RunQueryDsl, -}; -use processor::schema::token_activities_v2::dsl::*; -use serde_json::Value; - -pub struct TokenV2ProcessorTestHelper; - -impl ProcessorTestHelper for TokenV2ProcessorTestHelper { - fn load_data(&self, conn: &mut PgConnection, txn_version: &str) -> Result { - let token_activities_v2_result = token_activities_v2 - .filter(transaction_version.eq(txn_version.parse::().unwrap())) - .then_order_by(event_index.asc()) - .load::(conn); - - let all_collections_v2 = token_activities_v2_result?; - let json_data = serde_json::to_string_pretty(&all_collections_v2)?; - Ok(serde_json::from_str(&json_data)?) - } -} diff --git a/rust/integration-tests/src/diff_test_helper/token_v2_processor.rs b/rust/integration-tests/src/diff_test_helper/token_v2_processor.rs new file mode 100644 index 000000000..7c96f7122 --- /dev/null +++ b/rust/integration-tests/src/diff_test_helper/token_v2_processor.rs @@ -0,0 +1,30 @@ +use crate::models::queryable_models::TokenActivityV2; +use anyhow::Result; +use diesel::{ + pg::PgConnection, + query_dsl::methods::{FilterDsl, ThenOrderDsl}, + ExpressionMethods, RunQueryDsl, +}; +use processor::schema::token_activities_v2::dsl::*; +use serde_json::Value; +use std::collections::HashMap; + +#[allow(dead_code)] +pub fn load_data(conn: &mut PgConnection, txn_version: &str) -> Result> { + let mut result_map: HashMap = HashMap::new(); + + let token_activities_v2_result = token_activities_v2 + .filter(transaction_version.eq(txn_version.parse::().unwrap())) + .then_order_by(event_index.asc()) + .load::(conn); + + let all_collections_v2 = token_activities_v2_result?; + let token_activities_v2_json_data = serde_json::to_string_pretty(&all_collections_v2)?; + + result_map.insert( + "token_activities_v2".to_string(), + serde_json::from_str(&token_activities_v2_json_data)?, + ); + + Ok(result_map) +} diff --git a/rust/integration-tests/src/diff_tests/all_tests.rs b/rust/integration-tests/src/diff_tests/all_tests.rs index a140d6d4c..c86e075ee 100644 --- a/rust/integration-tests/src/diff_tests/all_tests.rs +++ b/rust/integration-tests/src/diff_tests/all_tests.rs @@ -4,14 +4,11 @@ mod test { use crate::{ diff_test_helper::{ - processors::{ - event_processor::EventsProcessorTestHelper, - fungible_asset_processor::FungibleAssetProcessorTestHelper, - token_v2_processor::TokenV2ProcessorTestHelper, - }, - ProcessorTestHelper, + event_processor::load_data as load_event_data, + fungible_asset_processor::load_data as load_fungible_asset_data, + token_v2_processor::load_data as load_token_v2_data, }, - diff_tests::{ + diff_tests::diff_tests_helper::{ get_expected_imported_mainnet_txns, get_expected_imported_testnet_txns, get_expected_scripted_txns, remove_inserted_at, remove_transaction_timestamp, }, @@ -20,19 +17,31 @@ mod test { use aptos_indexer_test_transactions::{ ALL_IMPORTED_MAINNET_TXNS, ALL_IMPORTED_TESTNET_TXNS, ALL_SCRIPTED_TRANSACTIONS, }; + use aptos_indexer_testing_framework::{ + cli_parser::get_test_config, sdk_test_context::generate_output_file, + }; use assert_json_diff::assert_json_eq; use diesel::pg::PgConnection; use processor::processors::token_v2_processor::TokenV2ProcessorConfig; - use std::{collections::HashMap, fs, sync::Arc}; + use std::fs; + + const DEFAULT_OUTPUT_FOLDER: &str = "expected_db_output_files"; #[tokio::test] async fn test_all_testnet_txns_schema_output_for_all_processors() { + let (generate_output_flag, custom_output_path) = get_test_config(); + let output_path = custom_output_path + .unwrap_or_else(|| DEFAULT_OUTPUT_FOLDER.to_string() + "/imported_testnet_txns"); + let processor_configs = get_processor_configs(); let test_context = TestContext::new(ALL_IMPORTED_TESTNET_TXNS).await.unwrap(); run_processor_tests( processor_configs, &test_context, + generate_output_flag, + output_path, + false, get_expected_imported_testnet_txns, ) .await; @@ -40,12 +49,18 @@ mod test { #[tokio::test] async fn test_all_mainnet_txns_schema_output_for_all_processors() { + let (generate_output_flag, custom_output_path) = get_test_config(); + let output_path = custom_output_path + .unwrap_or_else(|| DEFAULT_OUTPUT_FOLDER.to_string() + "/imported_mainnet_txns"); + let processor_configs = get_processor_configs(); let test_context = TestContext::new(ALL_IMPORTED_MAINNET_TXNS).await.unwrap(); - run_processor_tests( processor_configs, &test_context, + generate_output_flag, + output_path, + false, get_expected_imported_mainnet_txns, ) .await; @@ -53,68 +68,107 @@ mod test { #[tokio::test] async fn test_all_scripted_txns_schema_output_for_all_processors() { + let (generate_output_flag, custom_output_path) = get_test_config(); + let output_path = custom_output_path + .unwrap_or_else(|| DEFAULT_OUTPUT_FOLDER.to_string() + "/scripted_txns"); + let processor_configs = get_processor_configs(); let test_context = TestContext::new(ALL_SCRIPTED_TRANSACTIONS).await.unwrap(); - run_processor_tests(processor_configs, &test_context, get_expected_scripted_txns).await; + run_processor_tests( + processor_configs, + &test_context, + generate_output_flag, + output_path, + true, + get_expected_scripted_txns, + ) + .await; } // Helper function to reduce duplicate code for running tests on all processors async fn run_processor_tests( processor_configs: Vec, test_context: &TestContext, - get_expected_json_path_fn: fn(&str, &str) -> String, + generate_output_flag: bool, + output_path: String, + _scripted: bool, + get_expected_json_path_fn: fn(&str, &str, &str) -> String, ) { - let processor_map = get_processor_map(); for processor_config in processor_configs { let processor_name = processor_config.config.name(); let test_type = TestType::Diff(DiffTest); + let output_path = output_path.clone(); - if let Some(test_helper) = processor_map.get(processor_name).cloned() { - test_context + let db_values_fn = match processor_name { + "events_processor" => load_event_data, + "fungible_asset_processor" => load_fungible_asset_data, + "token_v2_processor" => load_token_v2_data, + _ => panic!("Unknown processor: {}", processor_name), + }; + + test_context .run( processor_config, test_type, move |conn: &mut PgConnection, txn_version: &str| { - let mut json_data = match test_helper.load_data(conn, txn_version) { - Ok(data) => data, + + let mut db_values = match db_values_fn(conn, txn_version) { + Ok(db_data) => db_data, Err(e) => { eprintln!( "[ERROR] Failed to load data for processor {} and transaction version {}: {}", processor_name, txn_version, e ); return Err(e); - } + }, }; - let expected_json_path = get_expected_json_path_fn(processor_name, txn_version); - let mut expected_json = match read_and_parse_json(&expected_json_path) { - Ok(json) => json, - Err(e) => { - eprintln!( - "[ERROR] Error handling JSON for processor {} and transaction version {}: {}", - processor_name, txn_version, e - ); - return Err(e); + // Iterate over each table in the map and validate its data + for (table_name, db_value) in db_values.iter_mut() { + if generate_output_flag { + println!("[TEST] Generating output files for all tables."); + remove_inserted_at(db_value); + // Iterate over each table's data in the HashMap and generate an output file + generate_output_file( + processor_name, + table_name, + txn_version, + db_value, + output_path.clone(), + )?; } - }; - // TODO: we need to enhance json diff, as we might have more complex diffs. - remove_inserted_at(&mut json_data); - remove_transaction_timestamp(&mut json_data); - remove_transaction_timestamp(&mut expected_json); - assert_json_eq!(&json_data, &expected_json); + // Generate the expected JSON file path for each table + let expected_file_path = &get_expected_json_path_fn(processor_name, txn_version, table_name); + + // Read and parse the expected JSON file for the current table + let mut expected_json = match read_and_parse_json(expected_file_path) { + Ok(json) => json, + Err(e) => { + eprintln!( + "[ERROR] Error handling JSON for processor {} table {} and transaction version {}: {}", + processor_name, table_name, txn_version, e + ); + panic!("Failed to read and parse JSON for table: {}", table_name); + }, + }; + + // TODO: Clean up non-deterministic fields (e.g., timestamps, `inserted_at`) + remove_inserted_at(db_value); + remove_transaction_timestamp(db_value); + remove_inserted_at(&mut expected_json); + remove_transaction_timestamp(&mut expected_json); + + // Validate the actual vs expected JSON for the current table + assert_json_eq!(db_value, expected_json); + } - println!( - "[INFO] Test passed for processor {} and transaction version: {}", - processor_name, txn_version - ); Ok(()) }, ) .await .unwrap(); - } } } @@ -135,24 +189,6 @@ mod test { } } - fn get_processor_map() -> HashMap>> { - let mut processor_map: HashMap>> = HashMap::new(); - processor_map.insert( - "events_processor".to_string(), - Arc::new(Box::new(EventsProcessorTestHelper) as Box), - ); - processor_map.insert( - "fungible_asset_processor".to_string(), - Arc::new(Box::new(FungibleAssetProcessorTestHelper) as Box), - ); - processor_map.insert( - "token_v2_processor".to_string(), - Arc::new(Box::new(TokenV2ProcessorTestHelper) as Box), - ); - - processor_map - } - fn get_processor_configs() -> Vec { vec![ TestProcessorConfig { diff --git a/rust/integration-tests/src/diff_tests/mod.rs b/rust/integration-tests/src/diff_tests/mod.rs index 748ea82f7..5c40dba34 100644 --- a/rust/integration-tests/src/diff_tests/mod.rs +++ b/rust/integration-tests/src/diff_tests/mod.rs @@ -1,49 +1,59 @@ -use serde_json::Value; - mod all_tests; -#[allow(dead_code)] -pub fn remove_inserted_at(value: &mut Value) { - if let Some(array) = value.as_array_mut() { - for item in array.iter_mut() { - if let Some(obj) = item.as_object_mut() { - obj.remove("inserted_at"); +#[cfg(test)] +pub mod diff_tests_helper { + use serde_json::Value; + + pub fn remove_inserted_at(value: &mut Value) { + if let Some(array) = value.as_array_mut() { + for item in array.iter_mut() { + if let Some(obj) = item.as_object_mut() { + obj.remove("inserted_at"); + } } } } -} -#[allow(dead_code)] -pub fn remove_transaction_timestamp(value: &mut Value) { - if let Some(array) = value.as_array_mut() { - for item in array.iter_mut() { - if let Some(obj) = item.as_object_mut() { - obj.remove("transaction_timestamp"); + pub fn remove_transaction_timestamp(value: &mut Value) { + if let Some(array) = value.as_array_mut() { + for item in array.iter_mut() { + if let Some(obj) = item.as_object_mut() { + obj.remove("transaction_timestamp"); + } } } } -} -#[allow(dead_code)] -pub fn get_expected_imported_testnet_txns(processor_name: &str, txn_version: &str) -> String { - format!( - "expected_db_output_files/imported_testnet_txns/{}/{}_{}.json", - processor_name, processor_name, txn_version - ) -} + pub fn get_expected_imported_testnet_txns( + processor_name: &str, + txn_version: &str, + table_name: &str, + ) -> String { + format!( + "expected_db_output_files/imported_testnet_txns/{}/{}/{}.json", + processor_name, txn_version, table_name + ) + } -#[allow(dead_code)] -pub fn get_expected_imported_mainnet_txns(processor_name: &str, txn_version: &str) -> String { - format!( - "expected_db_output_files/imported_mainnet_txns/{}/{}_{}.json", - processor_name, processor_name, txn_version - ) -} + pub fn get_expected_imported_mainnet_txns( + processor_name: &str, + txn_version: &str, + table_name: &str, + ) -> String { + format!( + "expected_db_output_files/imported_mainnet_txns/{}/{}/{}.json", + processor_name, txn_version, table_name + ) + } -#[allow(dead_code)] -pub fn get_expected_scripted_txns(processor_name: &str, txn_version: &str) -> String { - format!( - "expected_db_output_files/scripted_txns/{}/{}_{}.json", - processor_name, processor_name, txn_version - ) + pub fn get_expected_scripted_txns( + processor_name: &str, + txn_version: &str, + table_name: &str, + ) -> String { + format!( + "expected_db_output_files/scripted_txns/{}/{}/{}.json", + processor_name, txn_version, table_name + ) + } } diff --git a/rust/integration-tests/src/lib.rs b/rust/integration-tests/src/lib.rs index 55285dc33..650777ecd 100644 --- a/rust/integration-tests/src/lib.rs +++ b/rust/integration-tests/src/lib.rs @@ -120,7 +120,6 @@ impl TestContext { processor .process_transactions(vec![txn.clone()], version, version, None) .await?; - // } last_version = Some(version); diff --git a/rust/integration-tests/src/models/queryable_models.rs b/rust/integration-tests/src/models/queryable_models.rs index 42f820aa8..5105665d5 100644 --- a/rust/integration-tests/src/models/queryable_models.rs +++ b/rust/integration-tests/src/models/queryable_models.rs @@ -6,7 +6,10 @@ use bigdecimal::BigDecimal; use diesel::{Identifiable, Insertable, Queryable}; use field_count::FieldCount; -use processor::schema::{events, fungible_asset_activities, token_activities_v2}; +use processor::schema::{ + coin_supply, current_fungible_asset_balances_legacy, events, fungible_asset_activities, + fungible_asset_balances, fungible_asset_metadata, token_activities_v2, +}; use serde::{Deserialize, Serialize}; /** * Event model @@ -74,3 +77,93 @@ pub struct TokenActivityV2 { pub transaction_timestamp: chrono::NaiveDateTime, pub inserted_at: chrono::NaiveDateTime, } + +#[derive(Clone, Debug, Deserialize, FieldCount, Identifiable, Insertable, Serialize, Queryable)] +#[diesel(primary_key(transaction_version, write_set_change_index))] +#[diesel(table_name = fungible_asset_balances)] +pub struct FungibleAssetBalance { + pub transaction_version: i64, + pub write_set_change_index: i64, + pub storage_id: String, + pub owner_address: String, + pub asset_type: String, + pub is_primary: bool, + pub is_frozen: bool, + pub amount: BigDecimal, + pub transaction_timestamp: chrono::NaiveDateTime, + pub token_standard: String, + pub inserted_at: chrono::NaiveDateTime, +} + +#[derive(Clone, Debug, Deserialize, FieldCount, Identifiable, Insertable, Serialize, Queryable)] +#[diesel(primary_key(storage_id))] +#[diesel(table_name = current_fungible_asset_balances_legacy)] +pub struct CurrentFungibleAssetBalance { + pub storage_id: String, + pub owner_address: String, + pub asset_type: String, + pub is_primary: bool, + pub is_frozen: bool, + pub amount: BigDecimal, + pub last_transaction_timestamp: chrono::NaiveDateTime, + pub last_transaction_version: i64, + pub token_standard: String, + pub inserted_at: chrono::NaiveDateTime, +} + +// #[derive(Clone, Debug, Deserialize, FieldCount, Identifiable, Insertable, Serialize, Queryable, Default)] +// #[diesel(primary_key(storage_id))] +// #[diesel(table_name = current_fungible_asset_balances)] +// pub struct CurrentUnifiedFungibleAssetBalance { +// pub storage_id: String, +// pub owner_address: String, +// pub asset_type: Option, +// pub coin_type: Option, // Changed from asset_type_v1/v2 to match schema +// pub is_primary: Option, +// pub is_frozen: bool, +// pub amount_v1: Option, +// pub amount_v2: Option, +// pub amount: Option, // Added amount field to match schema +// pub last_transaction_version_v1: Option, +// pub last_transaction_version_v2: Option, +// pub last_transaction_version: Option, // Added to match schema +// pub last_transaction_timestamp_v1: Option, +// pub last_transaction_timestamp_v2: Option, +// pub last_transaction_timestamp: Option, // Added to match schema +// pub inserted_at: chrono::NaiveDateTime, +// } + +#[derive(Clone, Debug, Deserialize, FieldCount, Identifiable, Insertable, Serialize, Queryable)] +#[diesel(primary_key(asset_type))] +#[diesel(table_name = fungible_asset_metadata)] +pub struct FungibleAssetMetadataModel { + pub asset_type: String, + pub creator_address: String, + pub name: String, + pub symbol: String, + pub decimals: i32, + pub icon_uri: Option, + pub project_uri: Option, + pub last_transaction_version: i64, + pub last_transaction_timestamp: chrono::NaiveDateTime, + pub supply_aggregator_table_handle_v1: Option, + pub supply_aggregator_table_key_v1: Option, + pub token_standard: String, + pub is_token_v2: Option, + pub inserted_at: chrono::NaiveDateTime, + pub supply_v2: Option, + pub maximum_v2: Option, +} + +#[derive(Clone, Debug, Deserialize, FieldCount, Identifiable, Insertable, Serialize, Queryable)] +#[diesel(primary_key(transaction_version, coin_type_hash))] +#[diesel(table_name = coin_supply)] +pub struct CoinSupply { + pub transaction_version: i64, + pub coin_type_hash: String, + pub coin_type: String, + pub supply: BigDecimal, + pub transaction_timestamp: chrono::NaiveDateTime, + pub transaction_epoch: i64, + pub inserted_at: chrono::NaiveDateTime, +} diff --git a/rust/integration-tests/src/scenarios_tests/event_processor_tests.rs b/rust/integration-tests/src/scenarios_tests/event_processor_tests.rs index de6b1a3cf..727e967b3 100644 --- a/rust/integration-tests/src/scenarios_tests/event_processor_tests.rs +++ b/rust/integration-tests/src/scenarios_tests/event_processor_tests.rs @@ -37,7 +37,6 @@ mod test { processor_config, test_type, move |conn: &mut PgConnection, version: &str| { - println!("version: {}", version); // Load and validate events let withdraw_events = load_transaction_events( conn, diff --git a/rust/processor/src/db/postgres/schema.rs b/rust/processor/src/db/postgres/schema.rs index 43f091757..42634a353 100644 --- a/rust/processor/src/db/postgres/schema.rs +++ b/rust/processor/src/db/postgres/schema.rs @@ -837,8 +837,8 @@ diesel::table! { supply_aggregator_table_key_v1 -> Nullable, #[max_length = 10] token_standard -> Varchar, - inserted_at -> Timestamp, is_token_v2 -> Nullable, + inserted_at -> Timestamp, supply_v2 -> Nullable, maximum_v2 -> Nullable, }