From a7c8177aecb3af95b0c19f02022e2c08f312ec6e Mon Sep 17 00:00:00 2001 From: Jose Daniel Hernandez Date: Wed, 12 Jun 2024 16:06:12 +0300 Subject: [PATCH] Fix feature compilation for several crates Fix feature compilation for: - `lib` without the `zkp-prover` feature enabled. - `mempool` without any feature enabled. - `primitives` with only the `slot` feature enabled. - `utils` without any feature enabled. - `zkp-component` without any feature enabled. --- lib/src/client.rs | 20 ++++++-------------- mempool/Cargo.toml | 2 +- primitives/Cargo.toml | 2 +- utils/Cargo.toml | 2 +- zkp-component/Cargo.toml | 1 + 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/lib/src/client.rs b/lib/src/client.rs index 3ffdf03dc6..25b3fb3527 100644 --- a/lib/src/client.rs +++ b/lib/src/client.rs @@ -382,13 +382,9 @@ impl ClientInner { .await }; #[cfg(not(feature = "zkp-prover"))] - let zkp_component = ZKPComponent::new( - blockchain_proxy.clone(), - Arc::clone(&network), - executor.clone(), - zkp_storage, - ) - .await; + let zkp_component = + ZKPComponent::new(blockchain_proxy.clone(), Arc::clone(&network), zkp_storage) + .await; let syncer = SyncerProxy::new_history( blockchain_proxy.clone(), Arc::clone(&network), @@ -432,13 +428,9 @@ impl ClientInner { .await }; #[cfg(not(feature = "zkp-prover"))] - let zkp_component = ZKPComponent::new( - blockchain_proxy.clone(), - Arc::clone(&network), - executor.clone(), - zkp_storage, - ) - .await; + let zkp_component = + ZKPComponent::new(blockchain_proxy.clone(), Arc::clone(&network), zkp_storage) + .await; let syncer = SyncerProxy::new_full( blockchain_proxy.clone(), diff --git a/mempool/Cargo.toml b/mempool/Cargo.toml index 950dc0223c..8ed488336b 100644 --- a/mempool/Cargo.toml +++ b/mempool/Cargo.toml @@ -43,7 +43,7 @@ nimiq-network-interface = { workspace = true } nimiq-primitives = { workspace = true, features = ["coin", "networks"] } nimiq-serde = { workspace = true } nimiq-transaction = { workspace = true } -nimiq-utils = { workspace = true, features = ["time"] } +nimiq-utils = { workspace = true, features = ["spawn", "time"] } [dev-dependencies] hex = "0.4" diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 6194f36cc9..d6da56bb0c 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -56,7 +56,7 @@ key-nibbles = ["hex", "nimiq-keys", "nimiq-database-value", "nimiq-serde"] networks = ["thiserror"] policy = ["nimiq-keys", "nimiq-utils", "parking_lot"] serde-derive = ["nimiq-serde", "serde", "serde_bytes", "serde_repr"] -slots = ["nimiq-bls", "nimiq-keys", "nimiq-utils", "policy"] +slots = ["nimiq-bls", "nimiq-keys", "nimiq-serde", "nimiq-utils", "policy"] tendermint = ["networks", "nimiq-bls", "serde-derive"] transaction = ["nimiq-serde", "thiserror"] tree-proof = [] diff --git a/utils/Cargo.toml b/utils/Cargo.toml index 99ddfec9d5..1508a64b0d 100644 --- a/utils/Cargo.toml +++ b/utils/Cargo.toml @@ -59,7 +59,7 @@ merkle = [ "nimiq-hash", ] otp = ["clear_on_drop", "nimiq-hash", "rand"] -spawn = ["tokio", "wasm-bindgen-futures"] +spawn = ["tokio", "tokio/rt", "wasm-bindgen-futures"] tagged-signing = ["hex"] time = [] diff --git a/zkp-component/Cargo.toml b/zkp-component/Cargo.toml index 6f83d2a411..7c441c233c 100644 --- a/zkp-component/Cargo.toml +++ b/zkp-component/Cargo.toml @@ -57,6 +57,7 @@ nimiq-transaction = { workspace = true } nimiq-utils = { workspace = true, features = [ "math", "merkle", + "spawn", "time", ] } nimiq-zkp = { workspace = true }