From 6ea6deac3be6be2fda681a07daa115b6d333b9d1 Mon Sep 17 00:00:00 2001 From: Alekos Filini Date: Wed, 9 Sep 2020 18:17:49 +0200 Subject: [PATCH] [blockchain] Simplify the architecture of blockchain traits Instead of having two traits, `Blockchain` and `OnlineBlockchain` that need to be implemented by the user, only the relevant one (`OnlineBlockchain`, here renamed to `Blockchain`) will need to be implemented, since we provide a blanket implementation for the "marker" trait (previously `Blockchain`, here renamed to `BlockchainMarker`). Users of the library will probably never need to implement `BlockchainMarker` by itself, since we expose the `OfflineBlockchain` type that already does that and should be good for any "offline" wallet. Still, it's exposed since they might need to import it to define types with generics. --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index e09fedd..bf50d96 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -363,7 +363,7 @@ pub fn handle_matches( matches: ArgMatches<'_>, ) -> Result where - C: crate::blockchain::OnlineBlockchain, + C: crate::blockchain::Blockchain, D: crate::database::BatchDatabase, { if let Some(_sub_matches) = matches.subcommand_matches("get_new_address") { -- 2.49.0