Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions bdk-ffi/src/kyoto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use crate::bitcoin::BlockHash;
use crate::bitcoin::Transaction;
use crate::bitcoin::Wtxid;
use crate::error::CbfError;
use crate::types::BlockId;
use crate::types::Update;
use crate::wallet::Wallet;
use crate::FeeRate;
Expand Down Expand Up @@ -185,7 +186,7 @@ impl CbfBuilder {
trusted_peers.push(peer.clone().into());
}

let scan_type = match self.scan_type {
let scan_type = match self.scan_type.clone() {
ScanType::Sync => bdk_kyoto::ScanType::Sync,
ScanType::Recovery {
used_script_index,
Expand All @@ -212,6 +213,10 @@ impl CbfBuilder {
used_script_index,
checkpoint: HeaderCheckpoint::taproot_activation(),
},
RecoveryPoint::Other { birthday } => bdk_kyoto::ScanType::Recovery {
used_script_index,
checkpoint: HeaderCheckpoint::new(birthday.height, birthday.hash.0),
},
}
}
}
Expand Down Expand Up @@ -457,7 +462,7 @@ impl From<Warn> for Warning {

/// Sync a wallet from the last known block hash or recover a wallet from a specified recovery
/// point.
#[derive(Debug, Clone, Copy, Default, uniffi::Enum)]
#[derive(Debug, Clone, Default, uniffi::Enum)]
pub enum ScanType {
/// Sync an existing wallet from the last stored chain checkpoint.
#[default]
Expand All @@ -472,12 +477,15 @@ pub enum ScanType {
},
}

#[derive(Debug, Clone, Copy, Default, uniffi::Enum)]
#[derive(Debug, Clone, Default, uniffi::Enum)]
pub enum RecoveryPoint {
GenesisBlock,
#[default]
SegwitActivation,
TaprootActivation,
Other {
birthday: BlockId,
},
}

/// A peer to connect to over the Bitcoin peer-to-peer network.
Expand Down
Loading