[tests] Add a proc macro to generate tests for OnlineBlockchain types

This commit is contained in:
Alekos Filini
2020-08-10 10:49:34 +02:00
parent c90c752f21
commit 9e5023670e
16 changed files with 1018 additions and 17 deletions

View File

@@ -15,6 +15,13 @@ use crate::FeeRate;
pub struct ElectrumBlockchain(Option<Client>);
#[cfg(test)]
#[cfg(feature = "test-electrum")]
#[magical_blockchain_tests(crate)]
fn local_electrs() -> ElectrumBlockchain {
ElectrumBlockchain::from(Client::new(&testutils::get_electrum_url(), None).unwrap())
}
impl std::convert::From<Client> for ElectrumBlockchain {
fn from(client: Client) -> Self {
ElectrumBlockchain(Some(client))