Skip to content

Commit 38d5a5e

Browse files
committed
rust: use bitcoin::bech32 re-export
No need to depend on it explicitly, which removes the need to keep the versions in sync.
1 parent 3d18dfd commit 38d5a5e

File tree

8 files changed

+6
-8
lines changed

8 files changed

+6
-8
lines changed

src/rust/Cargo.lock

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rust/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ members = [
2929
resolver = "2"
3030

3131
[workspace.dependencies]
32-
bech32 = { version = "0.11.0", default-features = false }
3332
# The secp-recovery feature is currently only needed in tests to make use of `RecoverableSignature`.
3433
# Attempting to enable it conditionally only for tests somehow leads to linking errors (duplicate secp256k1 symbols).
3534
bitcoin = { version = "0.32.7", default-features = false, features = ["secp-recovery"] }

src/rust/bitbox02-rust/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ num-bigint = { workspace = true, optional = true }
4343
num-traits = { version = "0.2", default-features = false }
4444
# If you change this, also change src/rust/.cargo/config.toml.
4545
bip32-ed25519 = { git = "https://github.com/BitBoxSwiss/rust-bip32-ed25519", tag = "v0.2.1", optional = true }
46-
bech32 = { workspace = true, optional = true }
4746
blake2 = { version = "0.10.6", default-features = false, optional = true }
4847
minicbor = { version = "0.24.0", default-features = false, features = ["alloc"], optional = true }
4948
crc = { version = "3.0.1", optional = true }
@@ -82,13 +81,11 @@ app-ethereum = [
8281
]
8382

8483
app-bitcoin = [
85-
"dep:bech32",
8684
"dep:miniscript",
8785
"dep:streaming-silent-payments",
8886
"bitbox02/app-bitcoin",
8987
]
9088
app-litecoin = [
91-
"dep:bech32",
9289
"bitbox02/app-litecoin",
9390
]
9491

@@ -97,7 +94,6 @@ app-u2f = [
9794
]
9895

9996
app-cardano = [
100-
"dep:bech32",
10197
"dep:blake2",
10298
"dep:minicbor",
10399
"dep:crc",

src/rust/bitbox02-rust/src/hww/api/bitcoin/common.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ use super::{multisig, params::Params, script};
2929

3030
use sha2::{Digest, Sha256};
3131

32+
use bitcoin::bech32;
3233
use bitcoin::hashes::Hash;
3334

3435
const HASH160_LEN: usize = 20;

src/rust/bitbox02-rust/src/hww/api/cardano/address.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ use pb::CardanoNetwork;
2525
use pb::cardano_response::Response;
2626
use pb::cardano_script_config::Config;
2727

28+
use bitcoin::bech32;
29+
2830
use blake2::{
2931
Blake2bVar,
3032
digest::{Update, VariableOutput},

src/rust/bitbox02-rust/src/hww/api/cardano/sign_transaction.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ use super::pb;
2121
use alloc::string::String;
2222
use alloc::vec::Vec;
2323

24+
use bitcoin::bech32;
25+
2426
use blake2::{
2527
Blake2bVar,
2628
digest::{Update, VariableOutput},

src/rust/streaming-silent-payments/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ license = "Apache-2.0"
2121

2222
[dependencies]
2323
bitcoin = { workspace = true }
24-
bech32 = { workspace = true }
2524
bitbox02 = { path = "../bitbox02" }
2625

2726
[dev-dependencies]

src/rust/streaming-silent-payments/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ extern crate alloc;
1919
mod hash;
2020

2121
pub use bitcoin;
22+
use bitcoin::bech32;
2223
use bitcoin::hashes::Hash;
2324
use bitcoin::secp256k1::{self, PublicKey, Scalar, Secp256k1, SecretKey, XOnlyPublicKey};
2425

0 commit comments

Comments
 (0)