From 166fcb874677ae178c6fb7efa043661399dd660b Mon Sep 17 00:00:00 2001 From: Georges Palauqui Date: Sat, 19 Oct 2024 11:15:54 +0200 Subject: [PATCH] refactor const_sv2 to std logic --- protocols/v2/const-sv2/Cargo.toml | 6 ++++-- protocols/v2/const-sv2/src/lib.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/protocols/v2/const-sv2/Cargo.toml b/protocols/v2/const-sv2/Cargo.toml index da7294550..eb93ee859 100644 --- a/protocols/v2/const-sv2/Cargo.toml +++ b/protocols/v2/const-sv2/Cargo.toml @@ -14,13 +14,15 @@ keywords = ["stratum", "mining", "bitcoin", "protocol"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -secp256k1 = { version = "0.28.2", default-features = false, features =["hashes", "alloc","rand","rand-std"] } +secp256k1 = { version = "0.28.2", default-features = false, features = ["hashes", "rand"] } #[dev-dependencies] #cbindgen = "0.16.0" [features] -no_std = [] +default = ["std"] +alloc = ["secp256k1/alloc"] +std = ["alloc", "secp256k1/rand-std"] [package.metadata.docs.rs] all-features = true \ No newline at end of file diff --git a/protocols/v2/const-sv2/src/lib.rs b/protocols/v2/const-sv2/src/lib.rs index 2e248a633..211af7981 100644 --- a/protocols/v2/const-sv2/src/lib.rs +++ b/protocols/v2/const-sv2/src/lib.rs @@ -36,7 +36,7 @@ //! `channel_id`. In this case, the first 4 bytes of the payload represent the //! `channel_id` the message is destined for. -#![cfg_attr(feature = "no_std", no_std)] +#![cfg_attr(not(feature = "std"), no_std)] /// Identifier for the extension_type field in the SV2 frame, indicating no /// extensions.