Skip to content

Commit

Permalink
indexers: remove Sync requirement from AnyResolver
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Sep 25, 2024
1 parent 94d6951 commit 0399795
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/indexers/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
// limitations under the License.

use std::collections::HashMap;
use std::sync::Arc;

use bp::Tx;
use bpstd::Network;
Expand All @@ -45,15 +44,15 @@ pub trait RgbResolver: Send {
#[derive(From)]
#[non_exhaustive]
pub struct AnyResolver {
inner: Arc<dyn RgbResolver + Sync>,
inner: Box<dyn RgbResolver>,
terminal_txes: HashMap<Txid, Tx>,
}

impl AnyResolver {
#[cfg(feature = "electrum_blocking")]
pub fn electrum_blocking(url: &str, config: Option<electrum::Config>) -> Result<Self, String> {
Ok(AnyResolver {
inner: Arc::new(
inner: Box::new(
electrum::Client::from_config(url, config.unwrap_or_default())
.map_err(|e| e.to_string())?,
),
Expand All @@ -64,7 +63,7 @@ impl AnyResolver {
#[cfg(feature = "esplora_blocking")]
pub fn esplora_blocking(url: &str, config: Option<esplora::Config>) -> Result<Self, String> {
Ok(AnyResolver {
inner: Arc::new(
inner: Box::new(
esplora::BlockingClient::from_config(url, config.unwrap_or_default())
.map_err(|e| e.to_string())?,
),
Expand All @@ -75,7 +74,7 @@ impl AnyResolver {
#[cfg(feature = "mempool_blocking")]
pub fn mempool_blocking(url: &str, config: Option<esplora::Config>) -> Result<Self, String> {
Ok(AnyResolver {
inner: Arc::new(super::mempool_blocking::MemPoolClient::new(
inner: Box::new(super::mempool_blocking::MemPoolClient::new(
url,
config.unwrap_or_default(),
)?),
Expand Down

0 comments on commit 0399795

Please sign in to comment.