From 375b3b2d12ba04170f488ca6bec5d9aa5ede063b Mon Sep 17 00:00:00 2001 From: Artemiy Artamonov Date: Mon, 26 Jun 2023 23:31:15 +0300 Subject: [PATCH] Deps: make blake2b optional --- Cargo.toml | 6 ++++-- src/lib.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 37cc346..0930a06 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,16 +17,18 @@ include = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [features] -default = ["std"] +default = ["std", "blake2b"] std = [] # SMT implemented in C smtc = [] # A storage optimized SMT implemented in trie (https://ouvrard-pierre-alain.medium.com/sparse-merkle-tree-86e6e2fc26da) trie = [] +# enable blake2b hash implementation +blake2b = ["dep:blake2b-rs"] [dependencies] cfg-if = "1" -blake2b-rs = "0.2" +blake2b-rs = { version = "0.2", optional = true } [dev-dependencies] proptest = "0.9" diff --git a/src/lib.rs b/src/lib.rs index 2b879d1..bf1ad3a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -61,6 +61,7 @@ #![cfg_attr(not(feature = "std"), no_std)] +#[cfg(feature = "blake2b")] pub mod blake2b; #[cfg(feature = "smtc")] pub mod ckb_smt;