From 519878d1413a8e220461852cf24c8f5bca23cc12 Mon Sep 17 00:00:00 2001 From: bytenotbark <158315302+bytenotbark@users.noreply.github.com> Date: Thu, 30 May 2024 01:47:19 -0700 Subject: [PATCH] Fix WalletClient::get_transfers with Out=true in Category Selector (#127) * Update models.rs Convert GotTransfer::suggested_confirmations_threshold to Option from u64 to enable Wallet.gettransfers(...) with Out: true in the Category Selector * Update all_clients_interaction.rs update test --------- Co-authored-by: h4sh3d --- src/models.rs | 2 +- tests/clients_tests/all_clients_interaction.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models.rs b/src/models.rs index 570d034..3d98065 100644 --- a/src/models.rs +++ b/src/models.rs @@ -516,7 +516,7 @@ pub struct GotTransfer { /// JSON object containing the major & minor subaddress index. pub subaddr_index: subaddress::Index, /// Estimation of the confirmations needed for the transaction to be included in a block. - pub suggested_confirmations_threshold: u64, + pub suggested_confirmations_threshold: Option, /// POSIX timestamp for when this transfer was first confirmed in a block (or timestamp submission if not mined yet). #[serde(with = "chrono::serde::ts_seconds")] pub timestamp: DateTime, diff --git a/tests/clients_tests/all_clients_interaction.rs b/tests/clients_tests/all_clients_interaction.rs index b7962df..128b6cb 100644 --- a/tests/clients_tests/all_clients_interaction.rs +++ b/tests/clients_tests/all_clients_interaction.rs @@ -445,7 +445,7 @@ pub async fn run() { note: "".to_string(), payment_id: HashString(PaymentId::zero()), subaddr_index: Index { major: 0, minor: 0 }, - suggested_confirmations_threshold: 1, + suggested_confirmations_threshold: Some(1), // this is any date, since it will not be tested against anything timestamp: DateTime::from_naive_utc_and_offset( NaiveDateTime::from_timestamp_opt(0, 0).unwrap(),