From a87520248bc8ca5c2a2ef03373f3c40c964403bf Mon Sep 17 00:00:00 2001 From: Artem Vorotnikov Date: Mon, 7 Feb 2022 12:13:18 +0300 Subject: [PATCH 1/2] ethereum-types: make ethbloom optional --- ethereum-types/Cargo.toml | 4 ++-- ethereum-types/src/lib.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ethereum-types/Cargo.toml b/ethereum-types/Cargo.toml index 251bfc11c..0867332d8 100644 --- a/ethereum-types/Cargo.toml +++ b/ethereum-types/Cargo.toml @@ -9,7 +9,7 @@ edition = "2021" rust-version = "1.56.1" [dependencies] -ethbloom = { path = "../ethbloom", version = "0.12", default-features = false } +ethbloom = { path = "../ethbloom", version = "0.12", optional = true, default-features = false } fixed-hash = { path = "../fixed-hash", version = "0.7", default-features = false, features = ["byteorder", "rustc-hex"] } uint-crate = { path = "../uint", package = "uint", version = "0.9", default-features = false } primitive-types = { path = "../primitive-types", version = "0.11", features = ["byteorder", "rustc-hex"], default-features = false } @@ -22,7 +22,7 @@ scale-info = { version = "1.0", features = ["derive"], default-features = false, serde_json = "1.0.41" [features] -default = ["std", "rlp", "serialize"] +default = ["std", "ethbloom", "rlp", "serialize"] std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"] serialize = ["impl-serde", "primitive-types/serde_no_std", "ethbloom/serialize"] arbitrary = ["ethbloom/arbitrary", "fixed-hash/arbitrary", "uint-crate/arbitrary"] diff --git a/ethereum-types/src/lib.rs b/ethereum-types/src/lib.rs index 56963f28d..ee4dccc75 100644 --- a/ethereum-types/src/lib.rs +++ b/ethereum-types/src/lib.rs @@ -11,6 +11,7 @@ mod hash; mod uint; +#[cfg(feature = "ethbloom")] pub use ethbloom::{Bloom, BloomRef, Input as BloomInput}; pub use hash::{BigEndianHash, H128, H160, H256, H264, H32, H512, H520, H64}; pub use uint::{FromDecStrErr, FromStrRadixErr, FromStrRadixErrKind, U128, U256, U512, U64}; From e69c45f5902f0720e73cb3b10213cadc36253ae9 Mon Sep 17 00:00:00 2001 From: Andronik Date: Wed, 31 Aug 2022 19:56:17 +0200 Subject: [PATCH 2/2] Apply suggestions from code review --- ethereum-types/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethereum-types/Cargo.toml b/ethereum-types/Cargo.toml index 0867332d8..659079e4a 100644 --- a/ethereum-types/Cargo.toml +++ b/ethereum-types/Cargo.toml @@ -6,7 +6,7 @@ license = "MIT OR Apache-2.0" homepage = "https://github.com/paritytech/parity-common" description = "Ethereum types" edition = "2021" -rust-version = "1.56.1" +rust-version = "1.60.0" [dependencies] ethbloom = { path = "../ethbloom", version = "0.12", optional = true, default-features = false } @@ -23,7 +23,7 @@ serde_json = "1.0.41" [features] default = ["std", "ethbloom", "rlp", "serialize"] -std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"] +std = ["uint-crate/std", "fixed-hash/std", "ethbloom?/std", "primitive-types/std"] serialize = ["impl-serde", "primitive-types/serde_no_std", "ethbloom/serialize"] arbitrary = ["ethbloom/arbitrary", "fixed-hash/arbitrary", "uint-crate/arbitrary"] rlp = ["impl-rlp", "ethbloom/rlp", "primitive-types/rlp"]