Split get_tx into its own trait

to make supporting verify_tx easier
This commit is contained in:
LLFourn
2022-02-23 10:38:35 +11:00
parent dcd90f8b61
commit c0e75fc1a8
10 changed files with 65 additions and 69 deletions

View File

@@ -87,10 +87,6 @@ impl Blockchain for EsploraBlockchain {
.collect()
}
fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error> {
Ok(self.url_client._get_tx(txid)?)
}
fn broadcast(&self, tx: &Transaction) -> Result<(), Error> {
let _txid = self.url_client._broadcast(tx)?;
Ok(())
@@ -108,6 +104,12 @@ impl GetHeight for EsploraBlockchain {
}
}
impl GetTx for EsploraBlockchain {
fn get_tx(&self, txid: &Txid) -> Result<Option<Transaction>, Error> {
Ok(self.url_client._get_tx(txid)?)
}
}
impl WalletSync for EsploraBlockchain {
fn wallet_setup<D: BatchDatabase>(
&self,