From 7b9414912cf16ab5cb8ae5de198e2f64c3987f68 Mon Sep 17 00:00:00 2001 From: Tommy Volk Date: Mon, 16 Sep 2024 14:11:26 -0500 Subject: [PATCH] Bump `bitcoin` crate from v0.30.2 to v0.31.2 (#23) * chore: bump bitcoin to 0.31.2 * chore: remove unused Error enum variants --- Cargo.toml | 4 ++-- src/lib.rs | 16 +--------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 8944644..e462ac8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ anyhow = "1.0.70" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" bech32 = "0.11" -bitcoin = { version = "0.30.2", default-features = false, features = ["serde", "rand"] } +bitcoin = { version = "0.31.2", default-features = false, features = ["std", "serde", "rand"] } ureq = { version = "2.5.0", features = ["json"], optional = true } reqwest = { version = "0.12.3", optional = true, default-features = false, features = ["json"] } email_address = "=0.2.5" @@ -33,7 +33,7 @@ aes = { version = "0.8" } [dev-dependencies] tokio = { version = "1.20.1", features = ["full"] } -bitcoin = { version = "0.30.2", features = ["serde", "std"] } +bitcoin = { version = "0.31.2", features = ["serde", "std"] } lightning-invoice = { version = "0.27.0", features = ["std", "serde"] } nostr = { version = "0.25.0", default-features = false, features = ["std"] } diff --git a/src/lib.rs b/src/lib.rs index ab64163..292721b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,3 +1,4 @@ +#![allow(clippy::large_enum_variant)] #![allow(clippy::result_large_err)] pub mod api; @@ -81,9 +82,6 @@ pub enum Error { /// Error during ureq HTTP request #[cfg(feature = "blocking")] Ureq(ureq::Error), - /// Transport error during the ureq HTTP call - #[cfg(feature = "blocking")] - UreqTransport(ureq::Transport), /// Error during reqwest HTTP request #[cfg(any(feature = "async", feature = "async-https"))] Reqwest(reqwest::Error), @@ -91,18 +89,10 @@ pub enum Error { HttpResponse(u16), /// IO error during ureq response read Io(io::Error), - /// No header found in ureq response - NoHeader, /// Error decoding JSON Json(serde_json::Error), /// Invalid Response InvalidResponse, - /// Invalid number returned - Parsing(std::num::ParseIntError), - /// Invalid Bitcoin data returned - BitcoinEncoding(bitcoin::consensus::encode::Error), - /// Invalid Hex data returned - Hex(bitcoin::hashes::hex::Error), /// Other error Other(String), } @@ -127,14 +117,10 @@ macro_rules! impl_error { } impl std::error::Error for Error {} -#[cfg(feature = "blocking")] -impl_error!(::ureq::Transport, UreqTransport, Error); #[cfg(any(feature = "async", feature = "async-https"))] impl_error!(::reqwest::Error, Reqwest, Error); impl_error!(io::Error, Io, Error); impl_error!(serde_json::Error, Json, Error); -impl_error!(std::num::ParseIntError, Parsing, Error); -impl_error!(bitcoin::hashes::hex::Error, Hex, Error); #[cfg(all(feature = "blocking", any(feature = "async", feature = "async-https")))] #[cfg(test)]