Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,5 @@ script:
- cd rlp/ && cargo test --no-default-features && cargo check --benches && cd ..
- cd triehash/ && cargo check --benches && cd ..
- cd kvdb-web/ && wasm-pack test --headless --firefox && cd ..

- cd ethbloom/ && cargo test --all-features && cd ..
- cd ethereum-types/ && cargo test --all-features && cd ..
3 changes: 3 additions & 0 deletions ethbloom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.9.2] - 2020-05-18
- Added `codec` feature. [#393](https://github.com/paritytech/parity-common/pull/393)

## [0.9.1] - 2020-04-27
- Added `arbitrary` feature. [#378](https://github.com/paritytech/parity-common/pull/378)

Expand Down
4 changes: 3 additions & 1 deletion ethbloom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethbloom"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Ethereum bloom filter"
license = "MIT OR Apache-2.0"
Expand All @@ -15,6 +15,7 @@ crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }
impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", default-features = false, optional = true }

[dev-dependencies]
criterion = "0.3.0"
Expand All @@ -27,6 +28,7 @@ std = ["fixed-hash/std", "crunchy/std"]
serialize = ["std", "impl-serde"]
rustc-hex = ["fixed-hash/rustc-hex"]
arbitrary = ["fixed-hash/arbitrary"]
codec = ["impl-codec"]

[[bench]]
name = "bloom"
Expand Down
9 changes: 6 additions & 3 deletions ethbloom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ use core::{mem, ops};

use crunchy::unroll;
use fixed_hash::*;
#[cfg(feature = "codec")]
use impl_codec::impl_fixed_hash_codec;
use impl_rlp::impl_fixed_hash_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_fixed_hash_serde;
Expand All @@ -68,6 +70,10 @@ construct_fixed_hash! {
pub struct Bloom(BLOOM_SIZE);
}
impl_fixed_hash_rlp!(Bloom, BLOOM_SIZE);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(Bloom, BLOOM_SIZE);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(Bloom, BLOOM_SIZE);

/// Returns log2.
fn log2(x: usize) -> u32 {
Expand Down Expand Up @@ -264,9 +270,6 @@ impl<'a> From<&'a Bloom> for BloomRef<'a> {
}
}

#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(Bloom, BLOOM_SIZE);

#[cfg(test)]
mod tests {
use super::{Bloom, Input};
Expand Down
3 changes: 3 additions & 0 deletions ethereum-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.9.2] - 2020-05-18
- Added `codec` feature. [#393](https://github.com/paritytech/parity-common/pull/393)

## [0.9.1] - 2020-04-27
- Added `arbitrary` feature. [#378](https://github.com/paritytech/parity-common/pull/378)

Expand Down
4 changes: 3 additions & 1 deletion ethereum-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethereum-types"
version = "0.9.1"
version = "0.9.2"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
Expand All @@ -14,6 +14,7 @@ uint-crate = { path = "../uint", package = "uint", version = "0.8", default-feat
primitive-types = { path = "../primitive-types", version = "0.7", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3.0", default-features = false, optional = true }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }
impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", default-features = false, optional = true }

[dev-dependencies]
serde_json = "1.0.41"
Expand All @@ -23,3 +24,4 @@ default = ["std", "serialize"]
std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"]
serialize = ["std", "impl-serde", "primitive-types/serde", "ethbloom/serialize"]
arbitrary = ["ethbloom/arbitrary", "fixed-hash/arbitrary", "uint-crate/arbitrary"]
codec = ["impl-codec", "ethbloom/codec"]
12 changes: 12 additions & 0 deletions ethereum-types/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

use crate::{U128, U256, U512, U64};
use fixed_hash::*;
#[cfg(feature = "codec")]
use impl_codec::impl_fixed_hash_codec;
use impl_rlp::impl_fixed_hash_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_fixed_hash_serde;
Expand All @@ -23,16 +25,22 @@ construct_fixed_hash! { pub struct H32(4); }
impl_fixed_hash_rlp!(H32, 4);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H32, 4);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(H32, 4);

construct_fixed_hash! { pub struct H64(8); }
impl_fixed_hash_rlp!(H64, 8);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H64, 8);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(H64, 8);

construct_fixed_hash! { pub struct H128(16); }
impl_fixed_hash_rlp!(H128, 16);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H128, 16);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(H128, 16);

pub use primitive_types::H160;
pub use primitive_types::H256;
Expand All @@ -41,13 +49,17 @@ construct_fixed_hash! { pub struct H264(33); }
impl_fixed_hash_rlp!(H264, 33);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H264, 33);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(H264, 33);

pub use primitive_types::H512;

construct_fixed_hash! { pub struct H520(65); }
impl_fixed_hash_rlp!(H520, 65);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H520, 65);
#[cfg(feature = "codec")]
impl_fixed_hash_codec!(H520, 65);

macro_rules! impl_uint_conversions {
($hash: ident, $uint: ident) => {
Expand Down
4 changes: 4 additions & 0 deletions ethereum-types/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#[cfg(feature = "codec")]
use impl_codec::impl_uint_codec;
use impl_rlp::impl_uint_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_uint_serde;
Expand All @@ -20,6 +22,8 @@ construct_uint! {
impl_uint_rlp!(U64, 1);
#[cfg(feature = "serialize")]
impl_uint_serde!(U64, 1);
#[cfg(feature = "codec")]
impl_uint_codec!(U64, 1);

pub use primitive_types::{U128, U256, U512};

Expand Down