feat: add broadcast related error

This commit is contained in:
Matthew 2024-04-17 20:03:59 -05:00
parent 77cfee718c
commit fa17a862ce
No known key found for this signature in database
GPG Key ID: 8D4FCD82DD54DDD2
2 changed files with 4 additions and 4 deletions

View File

@ -382,7 +382,7 @@ interface EsploraClient {
[Throws=EsploraError]
Update full_scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);
[Throws=Alpha3Error]
[Throws=EsploraError]
void broadcast([ByRef] Transaction transaction);
};

View File

@ -1,4 +1,4 @@
use crate::error::{Alpha3Error, EsploraError};
use crate::error::EsploraError;
use crate::wallet::{Update, Wallet};
use crate::bitcoin::Transaction;
@ -52,11 +52,11 @@ impl EsploraClient {
// pub fn sync();
pub fn broadcast(&self, transaction: &Transaction) -> Result<(), Alpha3Error> {
pub fn broadcast(&self, transaction: &Transaction) -> Result<(), EsploraError> {
let bdk_transaction: BdkTransaction = transaction.into();
self.0
.broadcast(&bdk_transaction)
.map_err(|_| Alpha3Error::Generic)
.map_err(EsploraError::from)
}
// pub fn estimate_fee();