feat: add broadcast related error
This commit is contained in:
parent
77cfee718c
commit
fa17a862ce
@ -382,7 +382,7 @@ interface EsploraClient {
|
|||||||
[Throws=EsploraError]
|
[Throws=EsploraError]
|
||||||
Update full_scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);
|
Update full_scan(Wallet wallet, u64 stop_gap, u64 parallel_requests);
|
||||||
|
|
||||||
[Throws=Alpha3Error]
|
[Throws=EsploraError]
|
||||||
void broadcast([ByRef] Transaction transaction);
|
void broadcast([ByRef] Transaction transaction);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use crate::error::{Alpha3Error, EsploraError};
|
use crate::error::EsploraError;
|
||||||
use crate::wallet::{Update, Wallet};
|
use crate::wallet::{Update, Wallet};
|
||||||
|
|
||||||
use crate::bitcoin::Transaction;
|
use crate::bitcoin::Transaction;
|
||||||
@ -52,11 +52,11 @@ impl EsploraClient {
|
|||||||
|
|
||||||
// pub fn sync();
|
// 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();
|
let bdk_transaction: BdkTransaction = transaction.into();
|
||||||
self.0
|
self.0
|
||||||
.broadcast(&bdk_transaction)
|
.broadcast(&bdk_transaction)
|
||||||
.map_err(|_| Alpha3Error::Generic)
|
.map_err(EsploraError::from)
|
||||||
}
|
}
|
||||||
|
|
||||||
// pub fn estimate_fee();
|
// pub fn estimate_fee();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user