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:
LLFourn committed 2021-05-18 20:02:33 +10:00
1 parent aaa9943a5f
commit 465ef6e674
7 files changed
+517 -596

No files matched your search

+8 -7
View File
@@ -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())
}
}
-2
View File
@@ -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]