Get block hash by its height

Create blockchain::GetBlockHash trait
with a method to get block hash given
a block height. Then, implement this
trait for all backends (Electrum, RPC
, Esplora, CBF). Referenced in issue 603.
This commit is contained in:
Vladimir Fomene
2022-06-16 20:42:02 +01:00
parent 1c94108d7e
commit 2af678aa84
9 changed files with 93 additions and 2 deletions

View File

@@ -120,6 +120,13 @@ impl GetTx for AnyBlockchain {
}
}
#[maybe_async]
impl GetBlockHash for AnyBlockchain {
fn get_block_hash(&self, height: u64) -> Result<BlockHash, Error> {
maybe_await!(impl_inner_method!(self, get_block_hash, height))
}
}
#[maybe_async]
impl WalletSync for AnyBlockchain {
fn wallet_sync<D: BatchDatabase>(