Skip to content

Commit

Permalink
impl Bloom codec
Browse files Browse the repository at this point in the history
  • Loading branch information
sekisamu committed Nov 26, 2019
1 parent d52614e commit 9037f8e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ethbloom/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"
fixed-hash = { path = "../fixed-hash", version = "0.5", default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.2", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }
impl-codec = { version = "0.4", default-features = false, optional = true }

[dev-dependencies]
criterion = "0.3.0"
Expand All @@ -23,7 +24,7 @@ hex-literal = "0.2.1"

[features]
default = ["std", "serialize", "libc", "rustc-hex"]
std = ["fixed-hash/std", "crunchy/std"]
std = ["fixed-hash/std", "crunchy/std", "impl-codec/std"]
serialize = ["std", "impl-serde"]
libc = ["fixed-hash/libc"]
rustc-hex = ["fixed-hash/rustc-hex"]
Expand Down
3 changes: 3 additions & 0 deletions ethbloom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ use impl_rlp::impl_fixed_hash_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_fixed_hash_serde;
use tiny_keccak::{Hasher, Keccak};
#[macro_use]
extern crate impl_codec;

// 3 according to yellowpaper
const BLOOM_BITS: u32 = 3;
Expand All @@ -63,6 +65,7 @@ construct_fixed_hash! {
pub struct Bloom(BLOOM_SIZE);
}
impl_fixed_hash_rlp!(Bloom, BLOOM_SIZE);
impl_fixed_hash_codec!(Bloom, BLOOM_SIZE);

/// Returns log2.
fn log2(x: usize) -> u32 {
Expand Down

0 comments on commit 9037f8e

Please sign in to comment.