From 56f5cd3e2e33af84edfb55f06a3c03da90ac9993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thoralf=20M=C3=BCller?= Date: Mon, 6 Nov 2023 17:28:48 +0100 Subject: [PATCH] Cleanup sync options for single address --- sdk/src/wallet/operations/syncing/options.rs | 22 -------------------- sdk/tests/wallet/syncing.rs | 2 +- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/sdk/src/wallet/operations/syncing/options.rs b/sdk/src/wallet/operations/syncing/options.rs index 658685f23c..cd5e0c65d5 100644 --- a/sdk/src/wallet/operations/syncing/options.rs +++ b/sdk/src/wallet/operations/syncing/options.rs @@ -3,9 +3,6 @@ use serde::{Deserialize, Serialize}; -use crate::types::block::address::Bech32Address; - -const DEFAULT_ADDRESS_START_INDEX: u32 = 0; const DEFAULT_FORCE_SYNCING: bool = false; const DEFAULT_SYNC_INCOMING_TRANSACTIONS: bool = false; const DEFAULT_SYNC_ONLY_MOST_BASIC_OUTPUTS: bool = false; @@ -16,18 +13,6 @@ const DEFAULT_SYNC_NATIVE_TOKEN_FOUNDRIES: bool = false; #[derive(Debug, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct SyncOptions { - /// Specific Bech32 encoded addresses of the account to sync, if addresses are provided, then `address_start_index` - /// will be ignored - #[serde(default)] - pub addresses: Vec, - /// Address index from which to start syncing addresses. 0 by default, using a higher index will be faster because - /// addresses with a lower index will be skipped, but could result in a wrong balance for that reason - #[serde(default = "default_address_start_index")] - pub address_start_index: u32, - /// Address index from which to start syncing internal addresses. 0 by default, using a higher index will be faster - /// because addresses with a lower index will be skipped, but could result in a wrong balance for that reason - #[serde(default = "default_address_start_index")] - pub address_start_index_internal: u32, /// Usually syncing is skipped if it's called in between 200ms, because there can only be new changes every /// milestone and calling it twice "at the same time" will not return new data /// When this to true, we will sync anyways, even if it's called 0ms after the las sync finished. @@ -58,10 +43,6 @@ pub struct SyncOptions { pub sync_native_token_foundries: bool, } -fn default_address_start_index() -> u32 { - DEFAULT_ADDRESS_START_INDEX -} - fn default_force_syncing() -> bool { DEFAULT_FORCE_SYNCING } @@ -85,9 +66,6 @@ fn default_sync_native_token_foundries() -> bool { impl Default for SyncOptions { fn default() -> Self { Self { - addresses: Vec::new(), - address_start_index: default_address_start_index(), - address_start_index_internal: default_address_start_index(), sync_incoming_transactions: default_sync_incoming_transactions(), sync_pending_transactions: default_sync_pending_transactions(), wallet: WalletSyncOptions::default(), diff --git a/sdk/tests/wallet/syncing.rs b/sdk/tests/wallet/syncing.rs index fedf45842f..6a417f379d 100644 --- a/sdk/tests/wallet/syncing.rs +++ b/sdk/tests/wallet/syncing.rs @@ -25,7 +25,7 @@ // assert_eq!(default_sync, wallet.default_sync_options().await); // let custom_options = SyncOptions { -// address_start_index: 10, +// sync_only_most_basic_outputs: true, // ..Default::default() // }; // wallet.set_default_sync_options(custom_options.clone()).await?;