feat: add broadcast related error

This commit is contained in:
Matthew committed 2024-04-19 08:36:07 -05:00
1 parent 77cfee718c
commit fa17a862ce
2 files changed
+4 -4

No files matched your search

+1 -1
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);
};
+3 -3
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();