diff --git a/Cargo.lock b/Cargo.lock index e8eda29..4660eae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -403,8 +403,7 @@ dependencies = [ [[package]] name = "bp-esplora" version = "0.11.0-beta.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9e6234da60b0b790b2221567e14a7a89ac522bfd79f95d94a2ed9760d931a4" +source = "git+https://github.com/zoedberg/bp-esplora-client?branch=add_config#f395a36a7cba4c4d8d59954882815d6b627acc8f" dependencies = [ "amplify", "bp-std", diff --git a/Cargo.toml b/Cargo.toml index 5b9d6bc..162eb3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -92,6 +92,7 @@ serde = ["serde_crate", "serde_yaml", "bp-std/serde", "descriptors/serde", "rgb- features = ["all"] [patch.crates-io] +bp-esplora = { git = "https://github.com/zoedberg/bp-esplora-client", branch = "add_config" } strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "develop" } strict_types = { git = "https://github.com/strict-types/strict-types", branch = "develop" } commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "develop" } diff --git a/src/resolvers/any.rs b/src/resolvers/any.rs index b85376e..97d4da4 100644 --- a/src/resolvers/any.rs +++ b/src/resolvers/any.rs @@ -48,19 +48,21 @@ pub struct AnyResolver { impl AnyResolver { #[cfg(feature = "electrum_blocking")] - pub fn electrum_blocking(url: &str) -> Result { + pub fn electrum_blocking(url: &str, config: Option) -> Result { Ok(AnyResolver { - inner: Box::new(electrum::Client::new(url).map_err(|e| e.to_string())?), + inner: Box::new( + electrum::Client::from_config(url, config.unwrap_or_default()) + .map_err(|e| e.to_string())?, + ), terminal_txes: Default::default(), }) } #[cfg(feature = "esplora_blocking")] - pub fn esplora_blocking(url: &str) -> Result { + pub fn esplora_blocking(url: &str, config: Option) -> Result { Ok(AnyResolver { inner: Box::new( - esplora::Builder::new(url) - .build_blocking() + esplora::BlockingClient::from_config(url, config.unwrap_or_default()) .map_err(|e| e.to_string())?, ), terminal_txes: Default::default(),