diff --git a/Cargo.toml b/Cargo.toml index 9caf3c9..bc5f5be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,8 @@ edition = "2021" rust-version = "1.63" homepage = "https://bitcoindevkit.org" repository = "https://github.com/bitcoindevkit/bdk-tx" +documentation = "https://docs.rs/bdk_tx" +description = "Bitcoin transaction building library." license = "MIT OR Apache-2.0" readme = "README.md" @@ -16,9 +18,9 @@ bdk_coin_select = "0.4.0" anyhow = "1" bdk_tx = { path = "." } bitcoin = { version = "0.32", features = ["rand-std"] } -bdk_testenv = "0.11.1" -bdk_bitcoind_rpc = "0.18.0" -bdk_chain = { version = "0.21" } +bdk_testenv = "0.13.0" +bdk_bitcoind_rpc = "0.20.0" +bdk_chain = { version = "0.23.0" } [features] default = ["std"] diff --git a/examples/common.rs b/examples/common.rs index 27ef00c..cebda98 100644 --- a/examples/common.rs +++ b/examples/common.rs @@ -1,7 +1,9 @@ use std::sync::Arc; -use bdk_bitcoind_rpc::Emitter; -use bdk_chain::{bdk_core, Anchor, Balance, ChainPosition, ConfirmationBlockTime}; +use bdk_bitcoind_rpc::{Emitter, NO_EXPECTED_MEMPOOL_TXIDS}; +use bdk_chain::{ + bdk_core, Anchor, Balance, CanonicalizationParams, ChainPosition, ConfirmationBlockTime, +}; use bdk_testenv::{bitcoincore_rpc::RpcApi, TestEnv}; use bdk_tx::{CanonicalUnspents, Input, InputCandidates, RbfParams, TxStatus, TxWithStatus}; use bitcoin::{absolute, Address, BlockHash, OutPoint, Transaction, Txid}; @@ -38,7 +40,7 @@ impl Wallet { pub fn sync(&mut self, env: &TestEnv) -> anyhow::Result<()> { let client = env.rpc_client(); let last_cp = self.chain.tip(); - let mut emitter = Emitter::new(client, last_cp, 0); + let mut emitter = Emitter::new(client, last_cp, 0, NO_EXPECTED_MEMPOOL_TXIDS); while let Some(event) = emitter.next_block()? { let _ = self .graph @@ -46,7 +48,9 @@ impl Wallet { let _ = self.chain.apply_update(event.checkpoint); } let mempool = emitter.mempool()?; - let _ = self.graph.batch_insert_relevant_unconfirmed(mempool); + let _ = self + .graph + .batch_insert_relevant_unconfirmed(mempool.new_txs); Ok(()) } @@ -60,6 +64,7 @@ impl Wallet { self.graph.graph().balance( &self.chain, self.chain.tip().block_id(), + CanonicalizationParams::default(), outpoints, |_, _| true, ) @@ -121,7 +126,11 @@ impl Wallet { } self.graph .graph() - .list_canonical_txs(&self.chain, self.chain.tip().block_id()) + .list_canonical_txs( + &self.chain, + self.chain.tip().block_id(), + CanonicalizationParams::default(), + ) .map(|c_tx| (c_tx.tx_node.tx, status_from_position(c_tx.chain_position))) } diff --git a/src/lib.rs b/src/lib.rs index 2e52602..bcdf894 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,8 @@ //! `bdk_tx` +// FIXME: try to remove clippy "allows" +#![allow(clippy::large_enum_variant)] +#![allow(clippy::result_large_err)] #![warn(missing_docs)] #![no_std] @@ -32,14 +35,17 @@ pub use selection::*; pub use selector::*; pub use signer::*; +#[cfg(feature = "std")] pub(crate) mod collections { #![allow(unused)] - - #[cfg(feature = "std")] pub use std::collections::*; +} - #[cfg(not(feature = "std"))] +#[cfg(not(feature = "std"))] +pub(crate) mod collections { + #![allow(unused)] pub type HashMap = alloc::collections::BTreeMap; + pub type HashSet = alloc::collections::BTreeSet; pub use alloc::collections::*; }