Skip to content

Commit

Permalink
Bump bitcoin crate from v0.30.2 to v0.31.2 (#23)
Browse files Browse the repository at this point in the history
* chore: bump bitcoin to 0.31.2

* chore: remove unused Error enum variants
  • Loading branch information
tvolk131 authored Sep 16, 2024
1 parent 18b0a83 commit 7b94149
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 17 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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"] }

Expand Down
16 changes: 1 addition & 15 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::large_enum_variant)]
#![allow(clippy::result_large_err)]

pub mod api;
Expand Down Expand Up @@ -81,28 +82,17 @@ 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),
/// HTTP response 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),
}
Expand All @@ -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)]
Expand Down

0 comments on commit 7b94149

Please sign in to comment.