Skip to content

Commit 0e203cf

Browse files
committed
Add scanning field to wallet info
1 parent 1e3935a commit 0e203cf

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

integration_test/src/main.rs

+3
Original file line numberDiff line numberDiff line change
@@ -872,6 +872,9 @@ fn test_create_wallet(cl: &Client) {
872872
assert_eq!(wallet_info.hd_seed_id.is_some(), has_hd_seed);
873873
let has_avoid_reuse = wallet_param.avoid_reuse.unwrap_or(false);
874874
assert_eq!(wallet_info.avoid_reuse.unwrap_or(false), has_avoid_reuse);
875+
assert_eq!(
876+
wallet_info.scanning.unwrap_or(json::ScanningDetails::NotScanning(false)),
877+
json::ScanningDetails::NotScanning(false));
875878
}
876879

877880
let mut wallet_list = cl.list_wallets().unwrap();

json/src/lib.rs

+10
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,18 @@ pub struct GetWalletInfoResult {
150150
pub hd_seed_id: Option<bitcoin::XpubIdentifier>,
151151
pub private_keys_enabled: bool,
152152
pub avoid_reuse: Option<bool>,
153+
pub scanning: Option<ScanningDetails>,
153154
}
154155

156+
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
157+
#[serde(untagged)]
158+
pub enum ScanningDetails {
159+
Scanning { duration: usize, progress: f32 },
160+
NotScanning(bool),
161+
}
162+
163+
impl Eq for ScanningDetails {}
164+
155165
#[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
156166
#[serde(rename_all = "camelCase")]
157167
pub struct GetBlockResult {

0 commit comments

Comments
 (0)