Skip to content
Draft
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
4 changes: 2 additions & 2 deletions crates/esplora/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ workspace = true

[dependencies]
bdk_core = { path = "../core", version = "0.6.1", default-features = false }
esplora-client = { version = "0.12.3", default-features = false }
esplora-client = { git = "https://github.com/luisschwab/rust-esplora-client", branch = "chore/api-fixups" }
async-trait = { version = "0.1.66", optional = true }
futures = { version = "0.3.26", optional = true }
serde_json = { version = "1.0", features = ["alloc"] }

[dev-dependencies]
esplora-client = { version = "0.12.0" }
esplora-client = { git = "https://github.com/luisschwab/rust-esplora-client", branch = "chore/api-fixups" }
bdk_chain = { path = "../chain" }
bdk_testenv = { path = "../testenv" }
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros"] }
Expand Down
6 changes: 3 additions & 3 deletions crates/esplora/src/async_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use bdk_core::{
bitcoin::{BlockHash, OutPoint, Txid},
BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate,
};
use esplora_client::Sleeper;
use esplora_client::{EsploraTx, Sleeper};
use futures::{stream::FuturesOrdered, TryStreamExt};

use crate::{insert_anchor_or_seen_at_from_status, insert_prevouts};
Expand Down Expand Up @@ -314,7 +314,7 @@ where
I: Iterator<Item = Indexed<SpkWithExpectedTxids>> + Send,
S: Sleeper + Clone + Send + Sync,
{
type TxsOfSpkIndex = (u32, Vec<esplora_client::Tx>, HashSet<Txid>);
type TxsOfSpkIndex = (u32, Vec<EsploraTx>, HashSet<Txid>);

let mut update = TxUpdate::<ConfirmationBlockTime>::default();
let mut last_active_index = Option::<u32>::None;
Expand All @@ -335,7 +335,7 @@ where
let mut last_seen = None;
let mut spk_txs = Vec::new();
loop {
let txs = client.scripthash_txs(&spk, last_seen).await?;
let txs = client.get_scripthash_txs(&spk, last_seen).await?;
let tx_count = txs.len();
last_seen = txs.last().map(|tx| tx.txid);
spk_txs.extend(txs);
Expand Down
8 changes: 4 additions & 4 deletions crates/esplora/src/blocking_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use bdk_core::{
bitcoin::{BlockHash, OutPoint, Txid},
BlockId, CheckPoint, ConfirmationBlockTime, Indexed, TxUpdate,
};
use esplora_client::{OutputStatus, Tx};
use esplora_client::{EsploraTx, OutputStatus};
use std::thread::JoinHandle;

use crate::{insert_anchor_or_seen_at_from_status, insert_prevouts};
Expand Down Expand Up @@ -282,7 +282,7 @@ fn fetch_txs_with_keychain_spks<I: Iterator<Item = Indexed<SpkWithExpectedTxids>
last_revealed: Option<u32>,
parallel_requests: usize,
) -> Result<(TxUpdate<ConfirmationBlockTime>, Option<u32>), Error> {
type TxsOfSpkIndex = (u32, Vec<esplora_client::Tx>, HashSet<Txid>);
type TxsOfSpkIndex = (u32, Vec<EsploraTx>, HashSet<Txid>);

let mut update = TxUpdate::<ConfirmationBlockTime>::default();
let mut last_active_index = Option::<u32>::None;
Expand All @@ -303,7 +303,7 @@ fn fetch_txs_with_keychain_spks<I: Iterator<Item = Indexed<SpkWithExpectedTxids>
let mut last_txid = None;
let mut spk_txs = Vec::new();
loop {
let txs = client.scripthash_txs(&spk, last_txid)?;
let txs = client.get_scripthash_txs(&spk, last_txid)?;
let tx_count = txs.len();
last_txid = txs.last().map(|tx| tx.txid);
spk_txs.extend(txs);
Expand Down Expand Up @@ -414,7 +414,7 @@ fn fetch_txs_with_txids<I: IntoIterator<Item = Txid>>(
.map(|t| (txid, t))
})
})
.collect::<Vec<JoinHandle<Result<(Txid, Option<Tx>), Error>>>>();
.collect::<Vec<JoinHandle<Result<(Txid, Option<EsploraTx>), Error>>>>();

if handles.is_empty() {
break;
Expand Down
4 changes: 2 additions & 2 deletions crates/esplora/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
//! [`esplora_client::AsyncClient`].
#![cfg_attr(coverage_nightly, feature(coverage_attribute))]

use bdk_core::bitcoin::{Amount, OutPoint, TxOut, Txid};
use bdk_core::bitcoin::{OutPoint, TxOut, Txid};
use bdk_core::{BlockId, ConfirmationBlockTime, TxUpdate};
use esplora_client::TxStatus;

Expand Down Expand Up @@ -76,7 +76,7 @@ fn insert_prevouts(
OutPoint::new(prev_txid, prev_vout),
TxOut {
script_pubkey: prev_txout.scriptpubkey,
value: Amount::from_sat(prev_txout.value),
value: prev_txout.value,
},
);
}
Expand Down
Loading