Skip to content

Commit d087317

Browse files
sergeyboyko0791dvdplmdependabot[bot]vorot93Andronik Ordian
authored
Update parity-util-mem to 0.9.0 (#1)
* The time crate after 0.2 is unergonomic to use; just use chrono (paritytech#458) The 0.2 series of `time` doesn't make it easy to "just" create a timestamp. The `chrono` crate uses `time` v0.1 and is, I believe, what users like us should be using. So let's just do that. * build(deps): update send_wrapper requirement from 0.3.0 to 0.5.0 (paritytech#461) Updates the requirements on [send_wrapper](https://github.com/thk1/send_wrapper) to permit the latest version. - [Release notes](https://github.com/thk1/send_wrapper/releases) - [Changelog](https://github.com/thk1/send_wrapper/blob/master/CHANGELOG.md) - [Commits](thk1/send_wrapper@v0.3.0...v0.5.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * rlp: add bytes impls (paritytech#459) * rlp: add bytes impls * add tests * rlp: Fix buffer indexing (paritytech#462) * Fix buffer indexing * test for clear * rlp: store test bytes in hex literals (paritytech#465) * Make RLP optional in several crates (paritytech#466) * bump versions and update changelogs (paritytech#463) * update other dependencies (paritytech#471) * ethereum-types/rlp should pull primitive-types/rlp (paritytech#474) * uint: optimize FromStr, make it no_std-compatible (paritytech#468) * Add from_str bench * uint: optimize FromStr, make it no_std-compatible * custom error type * fmt::Display is actually available in core * Error::source for FromHexError * uppercase consts * additional tests * kvdb-rocksdb: replace tempdir with tempfile(paritytech#350) (paritytech#477) * chore(deps): cargo upgrade parking_lot --all (paritytech#470) * chore(deps): cargo upgrade parking_lot --all * chore(deps): bump versions breaking change. * chore: update changelog * kvdb * kvdb-memorydb * kvdb-rocksdb * parity-util-mem * fix nits * fix: kvdb-web add missing changelog entry * fix: bad merge * fix more nits: use breaking label * [kvdb-memorydb]: add `wasm-bindgen` feature flag * grumbles: remove `wasm-bindgen` feature flag * Add hack only in `kvdb-web` * Remove feature flag `wasm-bindgen` from `kvdb-memorydb` * Bump bytes to 1.0 (paritytech#482) * Implement Num from num-traits (paritytech#480) * parity-crypto: remove UB test (paritytech#484) * parity-crypto: remove UB test * rlp: fix unused import * parity-crypto: upgrade deps (paritytech#483) * update some dev-dependencies (paritytech#493) Signed-off-by: koushiro <[email protected]> * fix: make from_str parse 0x-prefixed strings (paritytech#487) * fix: make from_str parse 0x-prefixed strings * fix(uint): make from_str parse 0x-prefixed strings * chore: address review styling comments * fix: tabs instead of spaces * chore: cargo fmt * fix: use strip_prefix instead of starts_with * build(deps): update impl-trait-for-tuples requirement (paritytech#490) Updates the requirements on [impl-trait-for-tuples](https://github.com/bkchr/impl-trait-for-tuples) to permit the latest version. - [Release notes](https://github.com/bkchr/impl-trait-for-tuples/releases) - [Commits](https://github.com/bkchr/impl-trait-for-tuples/commits/v0.2) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * primitive-types: address nits of paritytech#480 (paritytech#485) * primitive-types: address nits of paritytech#480 * fix ethereum-types * Remove deprecated FromStr/TryFrom impls for Secret (paritytech#495) * Remove deprecated FromStr/TryFrom impls for Secret * update CHANGELOG * build(deps): update secp256k1 requirement from 0.19.0 to 0.20.0 (paritytech#496) Updates the requirements on [secp256k1](https://github.com/rust-bitcoin/rust-secp256k1) to permit the latest version. - [Release notes](https://github.com/rust-bitcoin/rust-secp256k1/releases) - [Changelog](https://github.com/rust-bitcoin/rust-secp256k1/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-bitcoin/rust-secp256k1/commits) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian <[email protected]> * build(deps): update smallvec requirement from 0.6.10 to 1.6.0 (paritytech#494) Updates the requirements on [smallvec](https://github.com/servo/rust-smallvec) to permit the latest version. - [Release notes](https://github.com/servo/rust-smallvec/releases) - [Commits](https://github.com/servo/rust-smallvec/commits/v1.6.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian <[email protected]> * build(deps): update rand requirement from 0.7.2 to 0.8.0 (paritytech#488) * build(deps): update rand requirement from 0.7.2 to 0.8.0 Updates the requirements on [rand](https://github.com/rust-random/rand) to permit the latest version. - [Release notes](https://github.com/rust-random/rand/releases) - [Changelog](https://github.com/rust-random/rand/blob/master/CHANGELOG.md) - [Commits](rust-random/rand@0.7.3...0.8.0) Signed-off-by: dependabot[bot] <[email protected]> * Seed from u64 * uint: use rand 0.7 for quickcheck feature * kvdb-rocksdb: fix compilation for benches * parity-crypto: remove unused dep and fix a warning * cargo fmt and another unused dep Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Andronik Ordian <[email protected]> Co-authored-by: David Palm <[email protected]> * build(deps): update rand_xorshift requirement from 0.2.0 to 0.3.0 (paritytech#491) Updates the requirements on [rand_xorshift](https://github.com/rust-random/rngs) to permit the latest version. - [Release notes](https://github.com/rust-random/rngs/releases) - [Commits](https://github.com/rust-random/rngs/commits/rand_xorshift-0.3.0) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update changelogs and bump uint (paritytech#486) * update changelogs and bump uint * update ethereum-types changelog * update uint changelog * tabs * fixed-hash: bump to 0.7 * bump keccak-hash to 0.6.0 * contract-address: bump keccak-hash to 0.6 * update changelogs after publishing * bump fs-swap (paritytech#498) * triehash: patch release (paritytech#499) * fix clippy warning (paritytech#504) * add a test for paritytech#507 (paritytech#508) * add a test for paritytech#507 * CI: test uint on a big-endian platform * a workaround for gmp * grumbles * bump byteorder to 1.4.2 * ethereum-types: fix wasm builds for serialize feature (paritytech#503) * ethbloom: do not pull std for 'serialize' feature * ethereum-types: do not pull std for 'serialize' feature * CI: check wasm builds for ethbloom and ethereum-types * fix wasm target * CI: remove redundant check * CI: fix wasm target install * update changelogs * remove parity-runtime (paritytech#511) * Update codec and crates depending (paritytech#510) Co-authored-by: Andronik Ordian <[email protected]> Co-authored-by: David <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Artem Vorotnikov <[email protected]> Co-authored-by: Andronik Ordian <[email protected]> Co-authored-by: Frost Red Lee <[email protected]> Co-authored-by: Niklas Adolfsson <[email protected]> Co-authored-by: Sam Wilson <[email protected]> Co-authored-by: Qinxuan Chen <[email protected]> Co-authored-by: Georgios Konstantopoulos <[email protected]> Co-authored-by: Xiliang Chen <[email protected]> Co-authored-by: honeywest <[email protected]> Co-authored-by: Guillaume Thiolliere <[email protected]>
1 parent 72702ef commit d087317

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+850
-674
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ matrix:
1818
- cargo install cross
1919
script:
2020
- cross test --target=aarch64-linux-android -p parity-util-mem
21+
- cross test --target=mips64-unknown-linux-gnuabi64 -p uint
2122
- os: osx
2223
osx_image: xcode11.3
2324
addons:
@@ -26,6 +27,7 @@ matrix:
2627
allow_failures:
2728
- rust: nightly
2829
install:
30+
- rustup target add wasm32-unknown-unknown
2931
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | sh
3032
- source ~/.nvm/nvm.sh
3133
- nvm install --lts
@@ -42,6 +44,7 @@ script:
4244
cd contract-address/ && cargo test --features=external_doc && cd ..;
4345
fi
4446
- cd ethbloom/ && cargo test --no-default-features --features="rustc-hex" && cargo check --benches && cd ..
47+
- cd ethereum-types/ && cargo build --no-default-features --features="serialize,rlp" --target=wasm32-unknown-unknown && cd ..
4548
- cd fixed-hash/ && cargo test --all-features && cargo test --no-default-features --features="byteorder,rustc-hex" && cd ..
4649
- cd uint/ && cargo test --all-features && cargo test --no-default-features && cd ..
4750
- cd keccak-hash/ && cargo test --no-default-features && cd ..

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ members = [
1414
"plain_hasher",
1515
"rlp",
1616
"rlp-derive",
17-
"runtime",
1817
"transaction-pool",
1918
"trace-time",
2019
"triehash",

contract-address/CHANGELOG.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
11
# Changelog
22

3-
The format is based on [Keep a Changelog].
3+
The format is based on [Keep a Changelog].
44

55
[Keep a Changelog]: http://keepachangelog.com/en/1.0.0/
66

77
## [Unreleased]
88

9-
## [0.9.0] - 2020-03-16
9+
## [0.6.0] - 2021-01-27
10+
### Breaking
11+
- Updated `ethereum-types` to 0.11. [#510](https://github.com/paritytech/parity-common/pull/510)
12+
- Updated `keccak-hash` to 0.7. [#510](https://github.com/paritytech/parity-common/pull/510)
13+
14+
## [0.5.0] - 2021-01-05
15+
### Breaking
16+
- Updated `ethereum-types` to 0.10. [#463](https://github.com/paritytech/parity-common/pull/463)
17+
18+
## [0.4.0] - 2020-03-16
1019
- License changed from MIT to dual MIT/Apache2. [#342](https://github.com/paritytech/parity-common/pull/342)
1120
- Updated dependencies. [#361](https://github.com/paritytech/parity-common/pull/361)

contract-address/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "contract-address"
3-
version = "0.4.0"
3+
version = "0.6.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
homepage = "https://github.com/paritytech/parity-common"
@@ -11,9 +11,9 @@ edition = "2018"
1111
readme = "README.md"
1212

1313
[dependencies]
14-
ethereum-types = { version = "0.9.0", path = "../ethereum-types" }
15-
rlp = { version = "0.4", path = "../rlp" }
16-
keccak-hash = { version = "0.5", path = "../keccak-hash", default-features = false }
14+
ethereum-types = { version = "0.11.0", path = "../ethereum-types" }
15+
rlp = { version = "0.5", path = "../rlp" }
16+
keccak-hash = { version = "0.7", path = "../keccak-hash", default-features = false }
1717

1818
[features]
1919
default = []

ethbloom/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ The format is based on [Keep a Changelog].
66

77
## [Unreleased]
88

9+
## [0.11.0] - 2021-01-27
10+
### Breaking
11+
- Updated `impl-codec` to 0.5. [#510](https://github.com/paritytech/parity-common/pull/510)
12+
13+
### Potentially-breaking
14+
- `serialize` feature no longer pulls `std`. [#503](https://github.com/paritytech/parity-common/pull/503)
15+
16+
## [0.10.0] - 2021-01-05
17+
### Breaking
18+
- Updated `rlp` to 0.5. [#463](https://github.com/paritytech/parity-common/pull/463)
19+
920
## [0.9.2] - 2020-05-18
1021
- Added `codec` feature. [#393](https://github.com/paritytech/parity-common/pull/393)
1122

ethbloom/Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ethbloom"
3-
version = "0.9.2"
3+
version = "0.11.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
description = "Ethereum bloom filter"
66
license = "MIT OR Apache-2.0"
@@ -12,22 +12,23 @@ edition = "2018"
1212
[dependencies]
1313
tiny-keccak = { version = "2.0", features = ["keccak"] }
1414
crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"] }
15-
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false }
15+
fixed-hash = { path = "../fixed-hash", version = "0.7", default-features = false }
1616
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3", default-features = false, optional = true }
17-
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }
18-
impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", default-features = false, optional = true }
17+
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.3", default-features = false, optional = true }
18+
impl-codec = { version = "0.5.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }
1919

2020
[dev-dependencies]
2121
criterion = "0.3.0"
22-
rand = "0.7.2"
22+
rand = "0.8.0"
2323
hex-literal = "0.3.1"
2424

2525
[features]
26-
default = ["std", "serialize", "rustc-hex"]
26+
default = ["std", "rlp", "serialize", "rustc-hex"]
2727
std = ["fixed-hash/std", "crunchy/std"]
28-
serialize = ["std", "impl-serde"]
28+
serialize = ["impl-serde"]
2929
rustc-hex = ["fixed-hash/rustc-hex"]
3030
arbitrary = ["fixed-hash/arbitrary"]
31+
rlp = ["impl-rlp"]
3132
codec = ["impl-codec"]
3233

3334
[[bench]]

ethbloom/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ use crunchy::unroll;
5656
use fixed_hash::*;
5757
#[cfg(feature = "codec")]
5858
use impl_codec::impl_fixed_hash_codec;
59+
#[cfg(feature = "rlp")]
5960
use impl_rlp::impl_fixed_hash_rlp;
6061
#[cfg(feature = "serialize")]
6162
use impl_serde::impl_fixed_hash_serde;
@@ -69,6 +70,7 @@ construct_fixed_hash! {
6970
/// Bloom hash type with 256 bytes (2048 bits) size.
7071
pub struct Bloom(BLOOM_SIZE);
7172
}
73+
#[cfg(feature = "rlp")]
7274
impl_fixed_hash_rlp!(Bloom, BLOOM_SIZE);
7375
#[cfg(feature = "serialize")]
7476
impl_fixed_hash_serde!(Bloom, BLOOM_SIZE);

ethereum-types/CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@ The format is based on [Keep a Changelog].
66

77
## [Unreleased]
88

9+
## [0.11.0] - 2021-01-27
10+
### Breaking
11+
- Updated `ethbloom` to 0.11. [#510](https://github.com/paritytech/parity-common/pull/510)
12+
- Updated `primitive-types` to 0.9. [#510](https://github.com/paritytech/parity-common/pull/510)
13+
- Updated `impl-codec` to 0.5. [#510](https://github.com/paritytech/parity-common/pull/510)
14+
15+
### Potentially-breaking
16+
- `serialize` feature no longer pulls `std`. [#503](https://github.com/paritytech/parity-common/pull/503)
17+
18+
## [0.10.0] - 2021-01-05
19+
### Breaking
20+
- Updated `rlp` to 0.5. [#463](https://github.com/paritytech/parity-common/pull/463)
21+
- Updated `uint` to 0.9. [#486](https://github.com/paritytech/parity-common/pull/486)
22+
923
## [0.9.2] - 2020-05-18
1024
- Added `codec` feature. [#393](https://github.com/paritytech/parity-common/pull/393)
1125

ethereum-types/Cargo.toml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
[package]
22
name = "ethereum-types"
3-
version = "0.9.2"
3+
version = "0.11.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
homepage = "https://github.com/paritytech/parity-common"
77
description = "Ethereum types"
88
edition = "2018"
99

1010
[dependencies]
11-
ethbloom = { path = "../ethbloom", version = "0.9", default-features = false }
12-
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false, features = ["byteorder", "rustc-hex"] }
13-
uint-crate = { path = "../uint", package = "uint", version = "0.8", default-features = false }
14-
primitive-types = { path = "../primitive-types", version = "0.7", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
11+
ethbloom = { path = "../ethbloom", version = "0.11", default-features = false }
12+
fixed-hash = { path = "../fixed-hash", version = "0.7", default-features = false, features = ["byteorder", "rustc-hex"] }
13+
uint-crate = { path = "../uint", package = "uint", version = "0.9", default-features = false }
14+
primitive-types = { path = "../primitive-types", version = "0.9", features = ["byteorder", "rustc-hex"], default-features = false }
1515
impl-serde = { path = "../primitive-types/impls/serde", version = "0.3.0", default-features = false, optional = true }
16-
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.2", default-features = false }
17-
impl-codec = { version = "0.4.1", path = "../primitive-types/impls/codec", default-features = false, optional = true }
16+
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.3", default-features = false, optional = true }
17+
impl-codec = { version = "0.5.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }
1818

1919
[dev-dependencies]
2020
serde_json = "1.0.41"
2121

2222
[features]
23-
default = ["std", "serialize"]
23+
default = ["std", "rlp", "serialize"]
2424
std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"]
25-
serialize = ["std", "impl-serde", "primitive-types/serde", "ethbloom/serialize"]
25+
serialize = ["impl-serde", "primitive-types/serde_no_std", "ethbloom/serialize"]
2626
arbitrary = ["ethbloom/arbitrary", "fixed-hash/arbitrary", "uint-crate/arbitrary"]
27+
rlp = ["impl-rlp", "ethbloom/rlp", "primitive-types/rlp"]
2728
codec = ["impl-codec", "ethbloom/codec"]
29+
num-traits = ["primitive-types/num-traits"]

ethereum-types/src/hash.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use crate::{U128, U256, U512, U64};
1010
use fixed_hash::*;
1111
#[cfg(feature = "codec")]
1212
use impl_codec::impl_fixed_hash_codec;
13+
#[cfg(feature = "rlp")]
1314
use impl_rlp::impl_fixed_hash_rlp;
1415
#[cfg(feature = "serialize")]
1516
use impl_serde::impl_fixed_hash_serde;
@@ -22,20 +23,23 @@ pub trait BigEndianHash {
2223
}
2324

2425
construct_fixed_hash! { pub struct H32(4); }
26+
#[cfg(feature = "rlp")]
2527
impl_fixed_hash_rlp!(H32, 4);
2628
#[cfg(feature = "serialize")]
2729
impl_fixed_hash_serde!(H32, 4);
2830
#[cfg(feature = "codec")]
2931
impl_fixed_hash_codec!(H32, 4);
3032

3133
construct_fixed_hash! { pub struct H64(8); }
34+
#[cfg(feature = "rlp")]
3235
impl_fixed_hash_rlp!(H64, 8);
3336
#[cfg(feature = "serialize")]
3437
impl_fixed_hash_serde!(H64, 8);
3538
#[cfg(feature = "codec")]
3639
impl_fixed_hash_codec!(H64, 8);
3740

3841
construct_fixed_hash! { pub struct H128(16); }
42+
#[cfg(feature = "rlp")]
3943
impl_fixed_hash_rlp!(H128, 16);
4044
#[cfg(feature = "serialize")]
4145
impl_fixed_hash_serde!(H128, 16);
@@ -46,6 +50,7 @@ pub use primitive_types::H160;
4650
pub use primitive_types::H256;
4751

4852
construct_fixed_hash! { pub struct H264(33); }
53+
#[cfg(feature = "rlp")]
4954
impl_fixed_hash_rlp!(H264, 33);
5055
#[cfg(feature = "serialize")]
5156
impl_fixed_hash_serde!(H264, 33);
@@ -55,6 +60,7 @@ impl_fixed_hash_codec!(H264, 33);
5560
pub use primitive_types::H512;
5661

5762
construct_fixed_hash! { pub struct H520(65); }
63+
#[cfg(feature = "rlp")]
5864
impl_fixed_hash_rlp!(H520, 65);
5965
#[cfg(feature = "serialize")]
6066
impl_fixed_hash_serde!(H520, 65);
@@ -128,6 +134,11 @@ mod tests {
128134
}
129135
}
130136

137+
#[test]
138+
fn test_parse_0x() {
139+
assert!("0x0000000000000000000000000000000000000000000000000000000000000000".parse::<H256>().is_ok())
140+
}
141+
131142
#[test]
132143
fn test_serialize_invalid() {
133144
assert!(ser::from_str::<H256>("\"0x000000000000000000000000000000000000000000000000000000000000000\"")

ethereum-types/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ mod uint;
1313

1414
pub use ethbloom::{Bloom, BloomRef, Input as BloomInput};
1515
pub use hash::{BigEndianHash, H128, H160, H256, H264, H32, H512, H520, H64};
16-
pub use uint::{FromDecStrErr, U128, U256, U512, U64};
16+
pub use uint::{FromDecStrErr, FromStrRadixErr, FromStrRadixErrKind, U128, U256, U512, U64};
1717

1818
pub type Address = H160;
1919
pub type Secret = H256;

ethereum-types/src/uint.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,19 @@
88

99
#[cfg(feature = "codec")]
1010
use impl_codec::impl_uint_codec;
11+
#[cfg(feature = "rlp")]
1112
use impl_rlp::impl_uint_rlp;
1213
#[cfg(feature = "serialize")]
1314
use impl_serde::impl_uint_serde;
1415
use uint_crate::*;
1516

16-
pub use uint_crate::FromDecStrErr;
17+
pub use uint_crate::{FromDecStrErr, FromStrRadixErr, FromStrRadixErrKind};
1718

1819
construct_uint! {
1920
/// Unsigned 64-bit integer.
2021
pub struct U64(1);
2122
}
23+
#[cfg(feature = "rlp")]
2224
impl_uint_rlp!(U64, 1);
2325
#[cfg(feature = "serialize")]
2426
impl_uint_serde!(U64, 1);

fixed-hash/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ The format is based on [Keep a Changelog].
66

77
## [Unreleased]
88

9+
## [0.7.0] - 2021-01-05
10+
### Breaking
11+
- Updated `rand` to 0.8. [#488](https://github.com/paritytech/parity-common/pull/488)
12+
913
## [0.6.1] - 2020-04-27
1014
- Added `arbitrary` feature. [#378](https://github.com/paritytech/parity-common/pull/378)
1115

fixed-hash/Cargo.toml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "fixed-hash"
3-
version = "0.6.1"
3+
version = "0.7.0"
44
authors = ["Parity Technologies <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
homepage = "https://github.com/paritytech/parity-common"
@@ -14,16 +14,17 @@ edition = "2018"
1414
features = ["quickcheck", "api-dummy"]
1515

1616
[dependencies]
17-
byteorder = { version = "1.3.2", optional = true, default-features = false }
17+
byteorder = { version = "1.4.2", optional = true, default-features = false }
1818
quickcheck = { version = "0.9.0", optional = true }
19-
rand = { version = "0.7.2", optional = true, default-features = false }
19+
rand = { version = "0.8.0", optional = true, default-features = false }
2020
rustc-hex = { version = "2.0.1", optional = true, default-features = false }
2121
static_assertions = "1.0.0"
2222
arbitrary = { version = "0.4", optional = true }
2323

2424
[dev-dependencies]
25-
rand_xorshift = "0.2.0"
25+
rand_xorshift = "0.3.0"
2626
criterion = "0.3.0"
27+
rand = { version = "0.8.0", default-features = false, features = ["std_rng"] }
2728

2829
[features]
2930
default = ["std", "rand", "rustc-hex", "byteorder"]

fixed-hash/src/hash.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
/// ```
2525
/// use fixed_hash::construct_fixed_hash;
2626
/// construct_fixed_hash!{
27-
/// /// My unformatted 160 bytes sized hash type.
28-
/// #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))]
29-
/// pub struct H160(20);
27+
/// /// My unformatted 160 bytes sized hash type.
28+
/// #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))]
29+
/// pub struct H160(20);
3030
/// }
3131
/// assert_eq!(std::mem::size_of::<H160>(), 20);
3232
/// ```
@@ -588,6 +588,7 @@ macro_rules! impl_rustc_hex_for_fixed_hash {
588588
/// - When encountering invalid non hex-digits
589589
/// - Upon empty string input or invalid input length in general
590590
fn from_str(input: &str) -> $crate::core_::result::Result<$name, $crate::rustc_hex::FromHexError> {
591+
let input = input.strip_prefix("0x").unwrap_or(input);
591592
let mut iter = $crate::rustc_hex::FromHexIter::new(input);
592593
let mut result = Self::zero();
593594
for byte in result.as_mut() {

fixed-hash/src/tests.rs

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -244,23 +244,8 @@ mod rand {
244244

245245
#[test]
246246
fn random() {
247-
let default_seed = <StdRng as SeedableRng>::Seed::default();
248-
let mut rng = StdRng::from_seed(default_seed);
249-
assert_eq!(H32::random_using(&mut rng), H32::from([0x76, 0xa0, 0x40, 0x53]));
250-
}
251-
252-
#[test]
253-
fn randomize() {
254-
let default_seed = <StdRng as SeedableRng>::Seed::default();
255-
let mut rng = StdRng::from_seed(default_seed);
256-
assert_eq!(
257-
{
258-
let mut ret = H32::zero();
259-
ret.randomize_using(&mut rng);
260-
ret
261-
},
262-
H32::from([0x76, 0xa0, 0x40, 0x53])
263-
)
247+
let mut rng = StdRng::seed_from_u64(123);
248+
assert_eq!(H32::random_using(&mut rng), H32::from([0xeb, 0x96, 0xaf, 0x1c]));
264249
}
265250
}
266251

keccak-hash/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ The format is based on [Keep a Changelog].
66

77
## [Unreleased]
88

9+
## [0.7.0] - 2021-01-27
10+
### Breaking
11+
- Updated `primitive-types` to 0.9. [#510](https://github.com/paritytech/parity-common/pull/510)
12+
13+
## [0.6.0] - 2021-01-05
14+
### Breaking
15+
- Updated `primitive-types` to 0.8. [#463](https://github.com/paritytech/parity-common/pull/463)
16+
917
## [0.5.1] - 2020-04-10
1018
- Added `keccak256_range` and `keccak512_range` functions. [#370](https://github.com/paritytech/parity-common/pull/370)
1119

0 commit comments

Comments
 (0)