Skip to content

Commit 19d9578

Browse files
committed
Merge #6: Update Cargo.toml for initial release
d7eae73 Fix crate collections for no-std (valued mammal) ea61aff fix: temporarily allow clippy lints (valued mammal) 0954b39 Bump deps and update example code (valued mammal) effba3d chore: Update `Cargo.toml` for initial release (志宇) Pull request description: ACKs for top commit: ValuedMammal: self-ACK d7eae73 Tree-SHA512: 4c53bbf6c09a369fc9dd12dd6ad2a8c1ada2be23306a57ebca9280f625d319296c78abac45ce425fe7635dc1a4c7ce70a8ddb2a21d05243707cfda30a71de850
2 parents 6b1816a + d7eae73 commit 19d9578

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

Cargo.toml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ edition = "2021"
55
rust-version = "1.63"
66
homepage = "https://bitcoindevkit.org"
77
repository = "https://github.com/bitcoindevkit/bdk-tx"
8+
documentation = "https://docs.rs/bdk_tx"
9+
description = "Bitcoin transaction building library."
810
license = "MIT OR Apache-2.0"
911
readme = "README.md"
1012

@@ -16,9 +18,9 @@ bdk_coin_select = "0.4.0"
1618
anyhow = "1"
1719
bdk_tx = { path = "." }
1820
bitcoin = { version = "0.32", features = ["rand-std"] }
19-
bdk_testenv = "0.11.1"
20-
bdk_bitcoind_rpc = "0.18.0"
21-
bdk_chain = { version = "0.21" }
21+
bdk_testenv = "0.13.0"
22+
bdk_bitcoind_rpc = "0.20.0"
23+
bdk_chain = { version = "0.23.0" }
2224

2325
[features]
2426
default = ["std"]

examples/common.rs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
use std::sync::Arc;
22

3-
use bdk_bitcoind_rpc::Emitter;
4-
use bdk_chain::{bdk_core, Anchor, Balance, ChainPosition, ConfirmationBlockTime};
3+
use bdk_bitcoind_rpc::{Emitter, NO_EXPECTED_MEMPOOL_TXIDS};
4+
use bdk_chain::{
5+
bdk_core, Anchor, Balance, CanonicalizationParams, ChainPosition, ConfirmationBlockTime,
6+
};
57
use bdk_testenv::{bitcoincore_rpc::RpcApi, TestEnv};
68
use bdk_tx::{CanonicalUnspents, Input, InputCandidates, RbfParams, TxStatus, TxWithStatus};
79
use bitcoin::{absolute, Address, BlockHash, OutPoint, Transaction, Txid};
@@ -38,15 +40,17 @@ impl Wallet {
3840
pub fn sync(&mut self, env: &TestEnv) -> anyhow::Result<()> {
3941
let client = env.rpc_client();
4042
let last_cp = self.chain.tip();
41-
let mut emitter = Emitter::new(client, last_cp, 0);
43+
let mut emitter = Emitter::new(client, last_cp, 0, NO_EXPECTED_MEMPOOL_TXIDS);
4244
while let Some(event) = emitter.next_block()? {
4345
let _ = self
4446
.graph
4547
.apply_block_relevant(&event.block, event.block_height());
4648
let _ = self.chain.apply_update(event.checkpoint);
4749
}
4850
let mempool = emitter.mempool()?;
49-
let _ = self.graph.batch_insert_relevant_unconfirmed(mempool);
51+
let _ = self
52+
.graph
53+
.batch_insert_relevant_unconfirmed(mempool.new_txs);
5054
Ok(())
5155
}
5256

@@ -60,6 +64,7 @@ impl Wallet {
6064
self.graph.graph().balance(
6165
&self.chain,
6266
self.chain.tip().block_id(),
67+
CanonicalizationParams::default(),
6368
outpoints,
6469
|_, _| true,
6570
)
@@ -121,7 +126,11 @@ impl Wallet {
121126
}
122127
self.graph
123128
.graph()
124-
.list_canonical_txs(&self.chain, self.chain.tip().block_id())
129+
.list_canonical_txs(
130+
&self.chain,
131+
self.chain.tip().block_id(),
132+
CanonicalizationParams::default(),
133+
)
125134
.map(|c_tx| (c_tx.tx_node.tx, status_from_position(c_tx.chain_position)))
126135
}
127136

src/lib.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
//! `bdk_tx`
22
3+
// FIXME: try to remove clippy "allows"
4+
#![allow(clippy::large_enum_variant)]
5+
#![allow(clippy::result_large_err)]
36
#![warn(missing_docs)]
47
#![no_std]
58

@@ -32,14 +35,17 @@ pub use selection::*;
3235
pub use selector::*;
3336
pub use signer::*;
3437

38+
#[cfg(feature = "std")]
3539
pub(crate) mod collections {
3640
#![allow(unused)]
37-
38-
#[cfg(feature = "std")]
3941
pub use std::collections::*;
42+
}
4043

41-
#[cfg(not(feature = "std"))]
44+
#[cfg(not(feature = "std"))]
45+
pub(crate) mod collections {
46+
#![allow(unused)]
4247
pub type HashMap<K, V> = alloc::collections::BTreeMap<K, V>;
48+
pub type HashSet<T> = alloc::collections::BTreeSet<T>;
4349
pub use alloc::collections::*;
4450
}
4551

0 commit comments

Comments
 (0)