Make bdk_esplora wasm compatible again
There's a huge todo!() for the AsyncClient
This commit is contained in:
parent
a38f63359d
commit
0ba41c5751
8
.github/workflows/cont_integration.yml
vendored
8
.github/workflows/cont_integration.yml
vendored
@ -77,8 +77,12 @@ jobs:
|
||||
run: rustup target add wasm32-unknown-unknown
|
||||
- name: Update toolchain
|
||||
run: rustup update
|
||||
- name: Check
|
||||
run: cargo check --target wasm32-unknown-unknown --features async-interface,use-esplora-async,dev-getrandom-wasm --no-default-features
|
||||
- name: Check bdk
|
||||
working-directory: ./crates/bdk
|
||||
run: cargo check --target wasm32-unknown-unknown --features dev-getrandom-wasm
|
||||
- name: Check esplora
|
||||
working-directory: ./crates/esplora
|
||||
run: cargo check --target wasm32-unknown-unknown --features async --no-default-features
|
||||
|
||||
fmt:
|
||||
name: Rust fmt
|
||||
|
@ -39,6 +39,12 @@ keys-bip39 = ["bip39"]
|
||||
hardware-signer = ["hwi"]
|
||||
test-hardware-signer = ["hardware-signer"]
|
||||
|
||||
|
||||
# This feature is used to run `cargo check` in our CI targeting wasm. It's not recommended
|
||||
# for libraries to explicitly include the "getrandom/js" feature, so we only do it when
|
||||
# necessary for running our CI. See: https://docs.rs/getrandom/0.2.8/getrandom/#webassembly-support
|
||||
dev-getrandom-wasm = ["getrandom/js"]
|
||||
|
||||
[dev-dependencies]
|
||||
lazy_static = "1.4"
|
||||
env_logger = "0.7"
|
||||
|
@ -13,4 +13,9 @@ readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
bdk_chain = { path = "../chain", version = "0.3.1", features = ["serde", "miniscript"] }
|
||||
esplora-client = { version = "0.3" }
|
||||
esplora-client = { version = "0.3", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["async", "blocking"]
|
||||
async = ["esplora-client/async"]
|
||||
blocking = ["esplora-client/blocking"]
|
||||
|
@ -77,6 +77,7 @@ pub trait EsploraExt {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "blocking")]
|
||||
impl EsploraExt for esplora_client::BlockingClient {
|
||||
fn scan<K: Ord + Clone>(
|
||||
&self,
|
||||
@ -302,3 +303,18 @@ fn map_confirmation_time(tx_status: &TxStatus, height_at_start: u32) -> Confirma
|
||||
_ => ConfirmationTime::Unconfirmed,
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "async")]
|
||||
impl EsploraExt for esplora_client::AsyncClient {
|
||||
fn scan<K: Ord + Clone>(
|
||||
&self,
|
||||
_local_chain: &BTreeMap<u32, BlockHash>,
|
||||
_keychain_spks: BTreeMap<K, impl IntoIterator<Item = (u32, Script)>>,
|
||||
_txids: impl IntoIterator<Item = Txid>,
|
||||
_outpoints: impl IntoIterator<Item = OutPoint>,
|
||||
_stop_gap: usize,
|
||||
_parallel_requests: usize,
|
||||
) -> Result<KeychainScan<K, ConfirmationTime>, Error> {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user