Roll blockchain tests proc macro into normal macro
This means one less crate in the repo. Had to do a Default on TestClient to satisfy clippy.
This commit is contained in:
@@ -45,13 +45,6 @@ use crate::FeeRate;
|
||||
/// See the [`blockchain::electrum`](crate::blockchain::electrum) module for a usage example.
|
||||
pub struct ElectrumBlockchain(Client);
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(feature = "test-electrum")]
|
||||
#[bdk_blockchain_tests(crate)]
|
||||
fn local_electrs() -> ElectrumBlockchain {
|
||||
ElectrumBlockchain::from(Client::new(&testutils::get_electrum_url()).unwrap())
|
||||
}
|
||||
|
||||
impl std::convert::From<Client> for ElectrumBlockchain {
|
||||
fn from(client: Client) -> Self {
|
||||
ElectrumBlockchain(client)
|
||||
@@ -175,3 +168,11 @@ impl ConfigurableBlockchain for ElectrumBlockchain {
|
||||
)?))
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "test-electrum", test))]
|
||||
testutils::bdk_blockchain_tests! {
|
||||
bdk => crate,
|
||||
fn test_instance() -> ElectrumBlockchain {
|
||||
ElectrumBlockchain::from(Client::new(&testutils::get_electrum_url()).unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,8 +234,6 @@ pub extern crate sled;
|
||||
extern crate testutils;
|
||||
#[allow(unused_imports)]
|
||||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
extern crate testutils_macros;
|
||||
#[allow(unused_imports)]
|
||||
#[cfg(test)]
|
||||
#[macro_use]
|
||||
|
||||
Reference in New Issue
Block a user