From bc3d8de81ec32216208869d9863d265fbf898d47 Mon Sep 17 00:00:00 2001 From: Giems <109511301+Giems@users.noreply.github.com> Date: Tue, 20 Aug 2024 11:15:45 +0200 Subject: [PATCH] cr fixes --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- crates/sui-indexer/src/handlers/checkpoint_handler.rs | 8 ++------ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 066d46510dc18..44dd32541a47d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4610,7 +4610,7 @@ dependencies = [ [[package]] name = "firebase" version = "0.1.0" -source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=017d52bca2e11f6cdd98fe5fc5186e01b95c730f#017d52bca2e11f6cdd98fe5fc5186e01b95c730f" +source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=bd401bc3807bba5bb5203f42cc7b8cf836be83f5#bd401bc3807bba5bb5203f42cc7b8cf836be83f5" dependencies = [ "fcm", "reqwest 0.12.4", @@ -8481,7 +8481,7 @@ dependencies = [ [[package]] name = "odin" version = "0.1.0" -source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=017d52bca2e11f6cdd98fe5fc5186e01b95c730f#017d52bca2e11f6cdd98fe5fc5186e01b95c730f" +source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=bd401bc3807bba5bb5203f42cc7b8cf836be83f5#bd401bc3807bba5bb5203f42cc7b8cf836be83f5" dependencies = [ "async-nats", "bitcode", @@ -11867,7 +11867,7 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "structs" version = "0.1.0" -source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=017d52bca2e11f6cdd98fe5fc5186e01b95c730f#017d52bca2e11f6cdd98fe5fc5186e01b95c730f" +source = "git+ssh://git@github.com/nightly-labs/alexandria.git?rev=bd401bc3807bba5bb5203f42cc7b8cf836be83f5#bd401bc3807bba5bb5203f42cc7b8cf836be83f5" dependencies = [ "bitcode", "dotenvy", diff --git a/Cargo.toml b/Cargo.toml index 9124092502b41..6c02cfcd7dfcc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -716,7 +716,7 @@ semver = "1.0.16" spinners = "4.1.0" include_dir = "0.7.3" -odin = { git = "ssh://git@github.com/nightly-labs/alexandria.git", rev = "017d52bca2e11f6cdd98fe5fc5186e01b95c730f", package = "odin" } +odin = { git = "ssh://git@github.com/nightly-labs/alexandria.git", rev = "bd401bc3807bba5bb5203f42cc7b8cf836be83f5", package = "odin" } [patch.crates-io] quinn-proto = { git = "https://github.com/quinn-rs/quinn.git", rev = "f0fa66f871b80b9d2d7075d76967c649aecc0b77" } diff --git a/crates/sui-indexer/src/handlers/checkpoint_handler.rs b/crates/sui-indexer/src/handlers/checkpoint_handler.rs index 15957ee76d9dc..3009faeca7b26 100644 --- a/crates/sui-indexer/src/handlers/checkpoint_handler.rs +++ b/crates/sui-indexer/src/handlers/checkpoint_handler.rs @@ -1145,8 +1145,7 @@ pub fn generate_updates_from_checkpoint_data( .or_insert_with(Vec::new) .push(SuiIndexerNotification::CoinSwap(CoinSwap { sui_address: sui_address.clone(), - spent_token_type: base_coin_type.to_string(), - spent_amount: -base_amount, + spent: vec![(base_coin_type.to_string(), -base_amount)], received: vec![(quote_coin_type.to_string(), quote_amount)], })); } @@ -1216,15 +1215,12 @@ pub fn generate_updates_from_checkpoint_data( } // 3. - let (base_coin_type, base_amount) = negative_changes.remove(0); - notifications .entry(transaction_id) .or_insert_with(Vec::new) .push(SuiIndexerNotification::CoinSwap(CoinSwap { sui_address: sui_address.clone(), - spent_token_type: base_coin_type.clone(), - spent_amount: -base_amount, + spent: negative_changes, received: positive_changes, })); }