[electrum_redesign] Introduce redesigned ElectrumExt

There are a number of improvements that can be done, but it is in a
decent state to be usable.

Possible improvements:

* Remove requirement to retry obtaining ALL data after reorg is
  detected. Transactions can be anchored to a lower block (not block
  tip), and an `assume_final_depth` value can be used.

* The logic to finalize an update with confirmation time can be improved
  during reorgs to not require returning an error.
This commit is contained in:
志宇
2023-05-12 00:08:16 +08:00
parent 7261669c09
commit 2e3cee4bd0
2 changed files with 515 additions and 7 deletions

View File

@@ -20,12 +20,6 @@
//! [`batch_transaction_get`]: ElectrumApi::batch_transaction_get
//! [`bdk_electrum_example`]: https://github.com/LLFourn/bdk_core_staging/tree/master/bdk_electrum_example
use std::{
collections::{BTreeMap, HashMap},
fmt::Debug,
};
pub use bdk_chain;
use bdk_chain::{
bitcoin::{hashes::hex::FromHex, BlockHash, OutPoint, Script, Transaction, Txid},
chain_graph::{self, ChainGraph},
@@ -34,8 +28,15 @@ use bdk_chain::{
tx_graph::TxGraph,
BlockId, ConfirmationTime, TxHeight,
};
pub use electrum_client;
use electrum_client::{Client, ElectrumApi, Error};
use std::{
collections::{BTreeMap, HashMap},
fmt::Debug,
};
pub mod v2;
pub use bdk_chain;
pub use electrum_client;
/// Trait to extend [`electrum_client::Client`] functionality.
///