Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/cont_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,8 @@ jobs:
if: matrix.rust.version == '1.75.0'
run: |
cargo update -p minreq --precise "2.13.2"
cargo update -p home --precise "0.5.9"
cargo update -p native-tls --precise "0.2.13"
cargo update -p idna_adapter --precise "1.2.0"
cargo update -p native-tls --precise "0.2.13"
cargo update -p zerofrom --precise "0.1.5"
cargo update -p litemap --precise "0.7.4"
- name: Build
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ tokio = { version = "1", features = ["time"], optional = true }

[dev-dependencies]
tokio = { version = "1.20.1", features = ["full"] }
electrsd = { version = "0.33.0", features = ["legacy", "esplora_a33e97e1", "corepc-node_28_0"] }
electrsd = { version = "0.36.1", features = ["legacy", "esplora_a33e97e1", "corepc-node_29_0"] }
lazy_static = "1.4.0"

[features]
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ To build with the MSRV you will need to pin dependencies as follows:

```shell
cargo update -p minreq --precise "2.13.2"
cargo update -p home --precise "0.5.9"
cargo update -p native-tls --precise "0.2.13"
cargo update -p idna_adapter --precise "1.2.0"
cargo update -p native-tls --precise "0.2.13"
cargo update -p zerofrom --precise "0.1.5"
cargo update -p litemap --precise "0.7.4"
```
12 changes: 6 additions & 6 deletions src/async.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,11 @@ impl<S: Sleeper> AsyncClient<S> {
maxfeerate: Option<f64>,
maxburnamount: Option<f64>,
) -> Result<SubmitPackageResult, Error> {
let serialized_txs = transactions
.iter()
.map(|tx| serialize_hex(&tx))
.collect::<Vec<_>>();

let mut queryparams = HashSet::<(&str, String)>::new();
if let Some(maxfeerate) = maxfeerate {
queryparams.insert(("maxfeerate", maxfeerate.to_string()));
Expand All @@ -402,15 +407,10 @@ impl<S: Sleeper> AsyncClient<S> {
queryparams.insert(("maxburnamount", maxburnamount.to_string()));
}

let serialized_txs = transactions
.iter()
.map(|tx| serialize_hex(&tx))
.collect::<Vec<_>>();

let response = self
.post_request_bytes(
"/txs/package",
serde_json::to_string(&serialized_txs).unwrap_or_default(),
serde_json::to_string(&serialized_txs).map_err(Error::SerdeJson)?,
Some(queryparams),
)
.await?;
Expand Down
2 changes: 1 addition & 1 deletion src/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ impl BlockingClient {
let mut request = self.post_request(
"/txs/package",
serde_json::to_string(&serialized_txs)
.unwrap_or_default()
.map_err(Error::SerdeJson)?
.into_bytes(),
)?;

Expand Down
9 changes: 6 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,12 @@ impl Builder {
pub enum Error {
/// Error during `minreq` HTTP request
#[cfg(feature = "blocking")]
Minreq(::minreq::Error),
/// Error during reqwest HTTP request
Minreq(minreq::Error),
/// Error during `reqwest` HTTP request
#[cfg(feature = "async")]
Reqwest(::reqwest::Error),
Reqwest(reqwest::Error),
/// Error during JSON (de)serialization
SerdeJson(serde_json::Error),
/// HTTP response error
HttpResponse {
/// The HTTP status code returned by the server.
Expand Down Expand Up @@ -263,6 +265,7 @@ impl std::error::Error for Error {}
impl_error!(::minreq::Error, Minreq, Error);
#[cfg(feature = "async")]
impl_error!(::reqwest::Error, Reqwest, Error);
impl_error!(serde_json::Error, SerdeJson, Error);
impl_error!(std::num::ParseIntError, Parsing, Error);
impl_error!(bitcoin::consensus::encode::Error, BitcoinEncoding, Error);
impl_error!(bitcoin::hex::HexToArrayError, HexToArray, Error);
Expand Down
Loading