Skip to content

Commit

Permalink
f
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlinjin committed Apr 25, 2024
1 parent 3e5c071 commit b336db8
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions crates/chain/src/spk_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@

use core::{fmt::Debug, ops::RangeBounds};

use alloc::{borrow::ToOwned, boxed::Box, collections::BTreeMap, sync::Arc, vec::Vec};
use alloc::{boxed::Box, collections::BTreeMap, sync::Arc, vec::Vec};
use bitcoin::{OutPoint, Script, ScriptBuf, Txid};

use crate::{
keychain::KeychainTxOutIndex, local_chain::CheckPoint, ConfirmationTimeHeightAnchor, TxGraph,
};
use crate::{local_chain::CheckPoint, ConfirmationTimeHeightAnchor, TxGraph};

/// Data required to perform a spk-based blockchain client sync.
///
Expand Down Expand Up @@ -149,12 +147,14 @@ impl SyncRequest {
/// Populate the request with revealed script pubkeys from `index` with the given `spk_range`.
///
/// This consumes the [`SyncRequest`] and returns the updated one.
#[cfg(feature = "miniscript")]
#[must_use]
pub fn populate_with_revealed_spks<K: Clone + Ord + Debug + Send + Sync>(
self,
index: &KeychainTxOutIndex<K>,
index: &crate::keychain::KeychainTxOutIndex<K>,
spk_range: impl RangeBounds<K>,
) -> Self {
use alloc::borrow::ToOwned;
self.chain_spks(
index
.revealed_spks(spk_range)
Expand Down Expand Up @@ -205,8 +205,14 @@ impl<K: Ord + Clone> FullScanRequest<K> {
/// Unbounded script pubkey iterators for each keychain (`K`) are extracted using
/// [`KeychainTxOutIndex::all_unbounded_spk_iters`] and is used to populate the
/// [`FullScanRequest`].
///
/// [`KeychainTxOutIndex::all_unbounded_spk_iters`]: crate::keychain::KeychainTxOutIndex::all_unbounded_spk_iters
#[cfg(feature = "miniscript")]
#[must_use]
pub fn from_keychain_txout_index(chain_tip: CheckPoint, index: &KeychainTxOutIndex<K>) -> Self
pub fn from_keychain_txout_index(
chain_tip: CheckPoint,
index: &crate::keychain::KeychainTxOutIndex<K>,
) -> Self
where
K: Debug,
{
Expand Down

0 comments on commit b336db8

Please sign in to comment.