Refactor: Fix up imports
This commit is contained in:
parent
202dcfa2b5
commit
aadc622006
@ -11,9 +11,10 @@ use bdk::blockchain::{
|
|||||||
electrum::ElectrumBlockchainConfig, esplora::EsploraBlockchainConfig,
|
electrum::ElectrumBlockchainConfig, esplora::EsploraBlockchainConfig,
|
||||||
rpc::RpcConfig as BdkRpcConfig, ConfigurableBlockchain,
|
rpc::RpcConfig as BdkRpcConfig, ConfigurableBlockchain,
|
||||||
};
|
};
|
||||||
|
use bdk::FeeRate;
|
||||||
use std::convert::{From, TryFrom};
|
use std::convert::{From, TryFrom};
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::{Mutex, MutexGuard};
|
use std::sync::{Arc, Mutex, MutexGuard};
|
||||||
|
|
||||||
pub(crate) struct Blockchain {
|
pub(crate) struct Blockchain {
|
||||||
blockchain_mutex: Mutex<AnyBlockchain>,
|
blockchain_mutex: Mutex<AnyBlockchain>,
|
||||||
@ -64,6 +65,12 @@ impl Blockchain {
|
|||||||
self.get_blockchain().broadcast(&tx)
|
self.get_blockchain().broadcast(&tx)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(crate) fn estimate_fee(&self, target: u64) -> Result<Arc<FeeRate>, BdkError> {
|
||||||
|
let result: Result<FeeRate, bdk::Error> =
|
||||||
|
self.get_blockchain().estimate_fee(target as usize);
|
||||||
|
result.map(Arc::new)
|
||||||
|
}
|
||||||
|
|
||||||
pub(crate) fn get_height(&self) -> Result<u32, BdkError> {
|
pub(crate) fn get_height(&self) -> Result<u32, BdkError> {
|
||||||
self.get_blockchain().get_height()
|
self.get_blockchain().get_height()
|
||||||
}
|
}
|
||||||
|
@ -24,9 +24,8 @@ use bdk::wallet::AddressInfo as BdkAddressInfo;
|
|||||||
use bdk::{Balance as BdkBalance, BlockTime, Error as BdkError, FeeRate, KeychainKind};
|
use bdk::{Balance as BdkBalance, BlockTime, Error as BdkError, FeeRate, KeychainKind};
|
||||||
use std::convert::From;
|
use std::convert::From;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::ops::Deref;
|
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::Arc;
|
||||||
|
|
||||||
uniffi_macros::include_scaffolding!("bdk");
|
uniffi_macros::include_scaffolding!("bdk");
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user