Skip to content
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/persist_test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ fn spk_at_index(descriptor: &Descriptor<DescriptorPublicKey>, index: u32) -> Scr
/// We create a dummy [`ChangeSet`], persist it and check if loaded [`ChangeSet`] matches
/// the persisted one. We then create another such dummy [`ChangeSet`], persist it and load it to
/// check if merged [`ChangeSet`] is returned.
#[allow(deprecated)]
pub fn persist_wallet_changeset<Store, CreateStore>(filename: &str, create_store: CreateStore)
where
CreateStore: Fn(&Path) -> anyhow::Result<Store>,
Expand Down Expand Up @@ -250,6 +251,7 @@ where
/// We create a dummy [`ChangeSet`] for first wallet and persist it then we create a dummy
/// [`ChangeSet`] for second wallet and persist that. Finally we load these two [`ChangeSet`]s and
/// check if they were persisted correctly.
#[allow(deprecated)]
pub fn persist_multiple_wallet_changesets<Store, CreateStores>(
filename: &str,
create_dbs: CreateStores,
Expand Down Expand Up @@ -357,6 +359,7 @@ where
///
/// We create a dummy [`ChangeSet`] with only descriptor fields populated, persist it and check if
/// loaded [`ChangeSet`] has the same descriptors as what we persisted.
#[allow(deprecated)]
pub fn persist_keychains<Store, CreateStore>(filename: &str, create_store: CreateStore)
where
CreateStore: Fn(&Path) -> anyhow::Result<Store>,
Expand Down Expand Up @@ -399,6 +402,7 @@ where
///
/// We create a dummy [`ChangeSet`] with only descriptor field populated, persist it and check if
/// loaded [`ChangeSet`] has the same descriptor as what we persisted.
#[allow(deprecated)]
pub fn persist_single_keychain<Store, CreateStore>(filename: &str, create_store: CreateStore)
where
CreateStore: Fn(&Path) -> anyhow::Result<Store>,
Expand Down
6 changes: 6 additions & 0 deletions src/wallet/changeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ type IndexedTxGraphChangeSet =
#[derive(Default, Debug, Clone, PartialEq, Deserialize, Serialize)]
pub struct ChangeSet {
/// Descriptor for recipient addresses.
#[deprecated(since = "3.0.0", note = "To be removed in v5.0")]
pub descriptor: Option<Descriptor<DescriptorPublicKey>>,
/// Descriptor for change addresses.
#[deprecated(since = "3.0.0", note = "To be removed in v5.0")]
pub change_descriptor: Option<Descriptor<DescriptorPublicKey>>,
/// Stores the network type of the transaction data.
pub network: Option<bitcoin::Network>,
Expand All @@ -122,6 +124,7 @@ pub struct ChangeSet {

impl Merge for ChangeSet {
/// Merge another [`ChangeSet`] into itself.
#[allow(deprecated)]
fn merge(&mut self, other: Self) {
if other.descriptor.is_some() {
debug_assert!(
Expand Down Expand Up @@ -154,6 +157,7 @@ impl Merge for ChangeSet {
Merge::merge(&mut self.indexer, other.indexer);
}

#[allow(deprecated)]
fn is_empty(&self) -> bool {
self.descriptor.is_none()
&& self.change_descriptor.is_none()
Expand Down Expand Up @@ -215,6 +219,7 @@ impl ChangeSet {
}

/// Recover a [`ChangeSet`] from sqlite database.
#[allow(deprecated)]
pub fn from_sqlite(db_tx: &chain::rusqlite::Transaction) -> chain::rusqlite::Result<Self> {
use bitcoin::{OutPoint, Txid};
use chain::rusqlite::OptionalExtension;
Expand Down Expand Up @@ -269,6 +274,7 @@ impl ChangeSet {
}

/// Persist [`ChangeSet`] to sqlite database.
#[allow(deprecated)]
pub fn persist_to_sqlite(
&self,
db_tx: &chain::rusqlite::Transaction,
Expand Down
2 changes: 2 additions & 0 deletions src/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ impl Wallet {
/// Create a new [`Wallet`] with given `params`.
///
/// Refer to [`Wallet::create`] for more.
#[allow(deprecated)]
pub fn create_with_params(params: CreateParams) -> Result<Self, DescriptorError> {
let secp = SecpCtx::new();
let network = params.network;
Expand Down Expand Up @@ -428,6 +429,7 @@ impl Wallet {
/// Load [`Wallet`] from the given previously persisted [`ChangeSet`] and `params`.
///
/// Returns `Ok(None)` if the changeset is empty. Refer to [`Wallet::load`] for more.
#[allow(deprecated)]
pub fn load_with_params(
changeset: ChangeSet,
params: LoadParams,
Expand Down
1 change: 1 addition & 0 deletions src/wallet/persisted.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ impl<E: fmt::Display> fmt::Display for CreateWithPersistError<E> {
impl<E: fmt::Debug + fmt::Display> std::error::Error for CreateWithPersistError<E> {}

/// Helper function to display basic information about a [`ChangeSet`].
#[allow(deprecated)]
fn changeset_info(f: &mut fmt::Formatter<'_>, changeset: &ChangeSet) -> fmt::Result {
let network = changeset
.network
Expand Down