Skip to content

Commit 4893fe6

Browse files
committed
Remove bitcoin-internals dependency
1 parent 7221d2d commit 4893fe6

File tree

4 files changed

+27
-10
lines changed

4 files changed

+27
-10
lines changed

Cargo-minimal.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,6 @@ dependencies = [
204204
"anyhow",
205205
"bincode",
206206
"bitcoin",
207-
"bitcoin-internals",
208207
"hex-conservative",
209208
"miniscript",
210209
"secp256k1",

Cargo-recent.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,6 @@ dependencies = [
200200
"anyhow",
201201
"bincode",
202202
"bitcoin",
203-
"bitcoin-internals",
204203
"hex-conservative",
205204
"miniscript",
206205
"secp256k1",

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,14 @@ rustdoc-args = ["--cfg", "docsrs"]
1818

1919
[features]
2020
default = ["std"]
21-
std = ["bitcoin/std", "bitcoin-internals/std", "miniscript?/std"]
21+
std = ["bitcoin/std", "miniscript?/std"]
2222
rand = ["std", "bitcoin/rand-std"]
23-
serde = ["dep:actual-serde", "bitcoin/serde", "bitcoin-internals/serde"]
23+
serde = ["dep:actual-serde", "bitcoin/serde"]
2424
base64 = ["bitcoin/base64"]
2525
miniscript = ["dep:miniscript", "miniscript?/no-std"]
2626

2727
[dependencies]
2828
bitcoin = { version = "0.32.6", default-features = false }
29-
bitcoin-internals = { version = "0.3.0", features = ["alloc"] }
3029
# Workaround for minimal version resolution bug in bitcoin 0.32.x series.
3130
# bitcoin 0.32.6 depends on hex-conservative 0.2.0, which incorrectly specifies
3231
# arrayvec = "0.7" instead of "0.7.2". Is fixed in hex-conservative 0.2.1.

src/v0/bitcoin/mod.rs

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,11 @@ pub enum GetKeyError {
853853
NotSupported,
854854
}
855855

856-
bitcoin_internals::impl_from_infallible!(GetKeyError);
856+
impl From<core::convert::Infallible> for GetKeyError {
857+
fn from(never: core::convert::Infallible) -> Self {
858+
match never {}
859+
}
860+
}
857861

858862
impl fmt::Display for GetKeyError {
859863
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@@ -966,7 +970,11 @@ pub enum SignError {
966970
Unsupported,
967971
}
968972

969-
bitcoin_internals::impl_from_infallible!(SignError);
973+
impl From<core::convert::Infallible> for SignError {
974+
fn from(never: core::convert::Infallible) -> Self {
975+
match never {}
976+
}
977+
}
970978

971979
impl fmt::Display for SignError {
972980
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -1055,7 +1063,11 @@ pub enum ExtractTxError {
10551063
},
10561064
}
10571065

1058-
bitcoin_internals::impl_from_infallible!(ExtractTxError);
1066+
impl From<core::convert::Infallible> for ExtractTxError {
1067+
fn from(never: core::convert::Infallible) -> Self {
1068+
match never {}
1069+
}
1070+
}
10591071

10601072
impl fmt::Display for ExtractTxError {
10611073
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -1107,7 +1119,11 @@ pub enum IndexOutOfBoundsError {
11071119
},
11081120
}
11091121

1110-
bitcoin_internals::impl_from_infallible!(IndexOutOfBoundsError);
1122+
impl From<core::convert::Infallible> for IndexOutOfBoundsError {
1123+
fn from(never: core::convert::Infallible) -> Self {
1124+
match never {}
1125+
}
1126+
}
11111127

11121128
impl fmt::Display for IndexOutOfBoundsError {
11131129
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
@@ -1160,7 +1176,11 @@ mod display_from_str {
11601176
Base64Encoding(bitcoin::base64::DecodeError),
11611177
}
11621178

1163-
bitcoin_internals::impl_from_infallible!(PsbtParseError);
1179+
impl From<core::convert::Infallible> for PsbtParseError {
1180+
fn from(never: core::convert::Infallible) -> Self {
1181+
match never {}
1182+
}
1183+
}
11641184

11651185
impl Display for PsbtParseError {
11661186
fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {

0 commit comments

Comments
 (0)