Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update parity-util-mem to 0.9.0 #1

Merged
merged 33 commits into from
Aug 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
903c06e
The time crate after 0.2 is unergonomic to use; just use chrono (#458)
dvdplm Nov 30, 2020
6bdc113
build(deps): update send_wrapper requirement from 0.3.0 to 0.5.0 (#461)
dependabot[bot] Dec 1, 2020
93ede8b
rlp: add bytes impls (#459)
vorot93 Dec 1, 2020
2394a11
rlp: Fix buffer indexing (#462)
vorot93 Dec 4, 2020
1a7fc68
rlp: store test bytes in hex literals (#465)
vorot93 Dec 4, 2020
85bcb11
Make RLP optional in several crates (#466)
vorot93 Dec 7, 2020
4978bf0
bump versions and update changelogs (#463)
ordian Dec 7, 2020
64dd79e
update other dependencies (#471)
ordian Dec 7, 2020
54076a5
ethereum-types/rlp should pull primitive-types/rlp (#474)
vorot93 Dec 8, 2020
7a54f5b
uint: optimize FromStr, make it no_std-compatible (#468)
vorot93 Dec 9, 2020
129912c
kvdb-rocksdb: replace tempdir with tempfile(#350) (#477)
frostRed Dec 10, 2020
763c967
chore(deps): cargo upgrade parking_lot --all (#470)
niklasad1 Dec 13, 2020
935a92c
Bump bytes to 1.0 (#482)
vorot93 Dec 23, 2020
da4262d
Implement Num from num-traits (#480)
SamWilsn Dec 25, 2020
6560949
parity-crypto: remove UB test (#484)
ordian Dec 28, 2020
f9d468e
parity-crypto: upgrade deps (#483)
ordian Dec 28, 2020
e64bf1a
update some dev-dependencies (#493)
koushiro Dec 29, 2020
0264ebf
fix: make from_str parse 0x-prefixed strings (#487)
gakonst Dec 30, 2020
b52051d
build(deps): update impl-trait-for-tuples requirement (#490)
dependabot[bot] Dec 30, 2020
36004c9
primitive-types: address nits of #480 (#485)
ordian Jan 1, 2021
f98a93d
Remove deprecated FromStr/TryFrom impls for Secret (#495)
dvdplm Jan 4, 2021
e7a708a
build(deps): update secp256k1 requirement from 0.19.0 to 0.20.0 (#496)
dependabot[bot] Jan 4, 2021
a7003bc
build(deps): update smallvec requirement from 0.6.10 to 1.6.0 (#494)
dependabot[bot] Jan 4, 2021
2c8cd78
build(deps): update rand requirement from 0.7.2 to 0.8.0 (#488)
dependabot[bot] Jan 4, 2021
c2fab00
build(deps): update rand_xorshift requirement from 0.2.0 to 0.3.0 (#491)
dependabot[bot] Jan 4, 2021
6fc8030
update changelogs and bump uint (#486)
ordian Jan 5, 2021
fd69e62
bump fs-swap (#498)
xlc Jan 6, 2021
e1dfdce
triehash: patch release (#499)
ordian Jan 8, 2021
24893ac
fix clippy warning (#504)
honeywest Jan 18, 2021
1d3de9e
add a test for #507 (#508)
ordian Jan 20, 2021
f627a42
ethereum-types: fix wasm builds for serialize feature (#503)
ordian Jan 20, 2021
74c7b6d
remove parity-runtime (#511)
ordian Jan 27, 2021
bb7b437
Update codec and crates depending (#510)
gui1117 Jan 27, 2021
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: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ matrix:
- cargo install cross
script:
- cross test --target=aarch64-linux-android -p parity-util-mem
- cross test --target=mips64-unknown-linux-gnuabi64 -p uint
- os: osx
osx_image: xcode11.3
addons:
Expand All @@ -26,6 +27,7 @@ matrix:
allow_failures:
- rust: nightly
install:
- rustup target add wasm32-unknown-unknown
- curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | sh
- source ~/.nvm/nvm.sh
- nvm install --lts
Expand All @@ -42,6 +44,7 @@ script:
cd contract-address/ && cargo test --features=external_doc && cd ..;
fi
- cd ethbloom/ && cargo test --no-default-features --features="rustc-hex" && cargo check --benches && cd ..
- cd ethereum-types/ && cargo build --no-default-features --features="serialize,rlp" --target=wasm32-unknown-unknown && cd ..
- cd fixed-hash/ && cargo test --all-features && cargo test --no-default-features --features="byteorder,rustc-hex" && cd ..
- cd uint/ && cargo test --all-features && cargo test --no-default-features && cd ..
- cd keccak-hash/ && cargo test --no-default-features && cd ..
Expand Down
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ members = [
"plain_hasher",
"rlp",
"rlp-derive",
"runtime",
"transaction-pool",
"trace-time",
"triehash",
Expand Down
13 changes: 11 additions & 2 deletions contract-address/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
# Changelog

The format is based on [Keep a Changelog].
The format is based on [Keep a Changelog].

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

## [Unreleased]

## [0.9.0] - 2020-03-16
## [0.6.0] - 2021-01-27
### Breaking
- Updated `ethereum-types` to 0.11. [#510](https://github.com/paritytech/parity-common/pull/510)
- Updated `keccak-hash` to 0.7. [#510](https://github.com/paritytech/parity-common/pull/510)

## [0.5.0] - 2021-01-05
### Breaking
- Updated `ethereum-types` to 0.10. [#463](https://github.com/paritytech/parity-common/pull/463)

## [0.4.0] - 2020-03-16
- License changed from MIT to dual MIT/Apache2. [#342](https://github.com/paritytech/parity-common/pull/342)
- Updated dependencies. [#361](https://github.com/paritytech/parity-common/pull/361)
8 changes: 4 additions & 4 deletions contract-address/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "contract-address"
version = "0.4.0"
version = "0.6.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
Expand All @@ -11,9 +11,9 @@ edition = "2018"
readme = "README.md"

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

[features]
default = []
Expand Down
11 changes: 11 additions & 0 deletions ethbloom/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.11.0] - 2021-01-27
### Breaking
- Updated `impl-codec` to 0.5. [#510](https://github.com/paritytech/parity-common/pull/510)

### Potentially-breaking
- `serialize` feature no longer pulls `std`. [#503](https://github.com/paritytech/parity-common/pull/503)

## [0.10.0] - 2021-01-05
### Breaking
- Updated `rlp` to 0.5. [#463](https://github.com/paritytech/parity-common/pull/463)

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

Expand Down
15 changes: 8 additions & 7 deletions ethbloom/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ethbloom"
version = "0.9.2"
version = "0.11.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Ethereum bloom filter"
license = "MIT OR Apache-2.0"
Expand All @@ -12,22 +12,23 @@ edition = "2018"
[dependencies]
tiny-keccak = { version = "2.0", features = ["keccak"] }
crunchy = { version = "0.2.2", default-features = false, features = ["limit_256"] }
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.7", 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 }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.3", default-features = false, optional = true }
impl-codec = { version = "0.5.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }

[dev-dependencies]
criterion = "0.3.0"
rand = "0.7.2"
rand = "0.8.0"
hex-literal = "0.3.1"

[features]
default = ["std", "serialize", "rustc-hex"]
default = ["std", "rlp", "serialize", "rustc-hex"]
std = ["fixed-hash/std", "crunchy/std"]
serialize = ["std", "impl-serde"]
serialize = ["impl-serde"]
rustc-hex = ["fixed-hash/rustc-hex"]
arbitrary = ["fixed-hash/arbitrary"]
rlp = ["impl-rlp"]
codec = ["impl-codec"]

[[bench]]
Expand Down
2 changes: 2 additions & 0 deletions ethbloom/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ use crunchy::unroll;
use fixed_hash::*;
#[cfg(feature = "codec")]
use impl_codec::impl_fixed_hash_codec;
#[cfg(feature = "rlp")]
use impl_rlp::impl_fixed_hash_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_fixed_hash_serde;
Expand All @@ -69,6 +70,7 @@ construct_fixed_hash! {
/// Bloom hash type with 256 bytes (2048 bits) size.
pub struct Bloom(BLOOM_SIZE);
}
#[cfg(feature = "rlp")]
impl_fixed_hash_rlp!(Bloom, BLOOM_SIZE);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(Bloom, BLOOM_SIZE);
Expand Down
14 changes: 14 additions & 0 deletions ethereum-types/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.11.0] - 2021-01-27
### Breaking
- Updated `ethbloom` to 0.11. [#510](https://github.com/paritytech/parity-common/pull/510)
- Updated `primitive-types` to 0.9. [#510](https://github.com/paritytech/parity-common/pull/510)
- Updated `impl-codec` to 0.5. [#510](https://github.com/paritytech/parity-common/pull/510)

### Potentially-breaking
- `serialize` feature no longer pulls `std`. [#503](https://github.com/paritytech/parity-common/pull/503)

## [0.10.0] - 2021-01-05
### Breaking
- Updated `rlp` to 0.5. [#463](https://github.com/paritytech/parity-common/pull/463)
- Updated `uint` to 0.9. [#486](https://github.com/paritytech/parity-common/pull/486)

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

Expand Down
20 changes: 11 additions & 9 deletions ethereum-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
[package]
name = "ethereum-types"
version = "0.9.2"
version = "0.11.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
description = "Ethereum types"
edition = "2018"

[dependencies]
ethbloom = { path = "../ethbloom", version = "0.9", default-features = false }
fixed-hash = { path = "../fixed-hash", version = "0.6", default-features = false, features = ["byteorder", "rustc-hex"] }
uint-crate = { path = "../uint", package = "uint", version = "0.8", default-features = false }
primitive-types = { path = "../primitive-types", version = "0.7", features = ["rlp", "byteorder", "rustc-hex"], default-features = false }
ethbloom = { path = "../ethbloom", version = "0.11", 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.9", features = ["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 }
impl-rlp = { path = "../primitive-types/impls/rlp", version = "0.3", default-features = false, optional = true }
impl-codec = { version = "0.5.0", path = "../primitive-types/impls/codec", default-features = false, optional = true }

[dev-dependencies]
serde_json = "1.0.41"

[features]
default = ["std", "serialize"]
default = ["std", "rlp", "serialize"]
std = ["uint-crate/std", "fixed-hash/std", "ethbloom/std", "primitive-types/std"]
serialize = ["std", "impl-serde", "primitive-types/serde", "ethbloom/serialize"]
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"]
codec = ["impl-codec", "ethbloom/codec"]
num-traits = ["primitive-types/num-traits"]
11 changes: 11 additions & 0 deletions ethereum-types/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use crate::{U128, U256, U512, U64};
use fixed_hash::*;
#[cfg(feature = "codec")]
use impl_codec::impl_fixed_hash_codec;
#[cfg(feature = "rlp")]
use impl_rlp::impl_fixed_hash_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_fixed_hash_serde;
Expand All @@ -22,20 +23,23 @@ pub trait BigEndianHash {
}

construct_fixed_hash! { pub struct H32(4); }
#[cfg(feature = "rlp")]
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); }
#[cfg(feature = "rlp")]
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); }
#[cfg(feature = "rlp")]
impl_fixed_hash_rlp!(H128, 16);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H128, 16);
Expand All @@ -46,6 +50,7 @@ pub use primitive_types::H160;
pub use primitive_types::H256;

construct_fixed_hash! { pub struct H264(33); }
#[cfg(feature = "rlp")]
impl_fixed_hash_rlp!(H264, 33);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H264, 33);
Expand All @@ -55,6 +60,7 @@ impl_fixed_hash_codec!(H264, 33);
pub use primitive_types::H512;

construct_fixed_hash! { pub struct H520(65); }
#[cfg(feature = "rlp")]
impl_fixed_hash_rlp!(H520, 65);
#[cfg(feature = "serialize")]
impl_fixed_hash_serde!(H520, 65);
Expand Down Expand Up @@ -128,6 +134,11 @@ mod tests {
}
}

#[test]
fn test_parse_0x() {
assert!("0x0000000000000000000000000000000000000000000000000000000000000000".parse::<H256>().is_ok())
}

#[test]
fn test_serialize_invalid() {
assert!(ser::from_str::<H256>("\"0x000000000000000000000000000000000000000000000000000000000000000\"")
Expand Down
2 changes: 1 addition & 1 deletion ethereum-types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ mod uint;

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

pub type Address = H160;
pub type Secret = H256;
Expand Down
4 changes: 3 additions & 1 deletion ethereum-types/src/uint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@

#[cfg(feature = "codec")]
use impl_codec::impl_uint_codec;
#[cfg(feature = "rlp")]
use impl_rlp::impl_uint_rlp;
#[cfg(feature = "serialize")]
use impl_serde::impl_uint_serde;
use uint_crate::*;

pub use uint_crate::FromDecStrErr;
pub use uint_crate::{FromDecStrErr, FromStrRadixErr, FromStrRadixErrKind};

construct_uint! {
/// Unsigned 64-bit integer.
pub struct U64(1);
}
#[cfg(feature = "rlp")]
impl_uint_rlp!(U64, 1);
#[cfg(feature = "serialize")]
impl_uint_serde!(U64, 1);
Expand Down
4 changes: 4 additions & 0 deletions fixed-hash/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.7.0] - 2021-01-05
### Breaking
- Updated `rand` to 0.8. [#488](https://github.com/paritytech/parity-common/pull/488)

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

Expand Down
9 changes: 5 additions & 4 deletions fixed-hash/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fixed-hash"
version = "0.6.1"
version = "0.7.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "MIT OR Apache-2.0"
homepage = "https://github.com/paritytech/parity-common"
Expand All @@ -14,16 +14,17 @@ edition = "2018"
features = ["quickcheck", "api-dummy"]

[dependencies]
byteorder = { version = "1.3.2", optional = true, default-features = false }
byteorder = { version = "1.4.2", optional = true, default-features = false }
quickcheck = { version = "0.9.0", optional = true }
rand = { version = "0.7.2", optional = true, default-features = false }
rand = { version = "0.8.0", optional = true, default-features = false }
rustc-hex = { version = "2.0.1", optional = true, default-features = false }
static_assertions = "1.0.0"
arbitrary = { version = "0.4", optional = true }

[dev-dependencies]
rand_xorshift = "0.2.0"
rand_xorshift = "0.3.0"
criterion = "0.3.0"
rand = { version = "0.8.0", default-features = false, features = ["std_rng"] }

[features]
default = ["std", "rand", "rustc-hex", "byteorder"]
Expand Down
7 changes: 4 additions & 3 deletions fixed-hash/src/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
/// ```
/// use fixed_hash::construct_fixed_hash;
/// construct_fixed_hash!{
/// /// My unformatted 160 bytes sized hash type.
/// #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))]
/// pub struct H160(20);
/// /// My unformatted 160 bytes sized hash type.
/// #[cfg_attr(feature = "serialize", derive(Serialize, Deserialize))]
/// pub struct H160(20);
/// }
/// assert_eq!(std::mem::size_of::<H160>(), 20);
/// ```
Expand Down Expand Up @@ -588,6 +588,7 @@ macro_rules! impl_rustc_hex_for_fixed_hash {
/// - When encountering invalid non hex-digits
/// - Upon empty string input or invalid input length in general
fn from_str(input: &str) -> $crate::core_::result::Result<$name, $crate::rustc_hex::FromHexError> {
let input = input.strip_prefix("0x").unwrap_or(input);
let mut iter = $crate::rustc_hex::FromHexIter::new(input);
let mut result = Self::zero();
for byte in result.as_mut() {
Expand Down
19 changes: 2 additions & 17 deletions fixed-hash/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,23 +244,8 @@ mod rand {

#[test]
fn random() {
let default_seed = <StdRng as SeedableRng>::Seed::default();
let mut rng = StdRng::from_seed(default_seed);
assert_eq!(H32::random_using(&mut rng), H32::from([0x76, 0xa0, 0x40, 0x53]));
}

#[test]
fn randomize() {
let default_seed = <StdRng as SeedableRng>::Seed::default();
let mut rng = StdRng::from_seed(default_seed);
assert_eq!(
{
let mut ret = H32::zero();
ret.randomize_using(&mut rng);
ret
},
H32::from([0x76, 0xa0, 0x40, 0x53])
)
let mut rng = StdRng::seed_from_u64(123);
assert_eq!(H32::random_using(&mut rng), H32::from([0xeb, 0x96, 0xaf, 0x1c]));
}
}

Expand Down
8 changes: 8 additions & 0 deletions keccak-hash/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.7.0] - 2021-01-27
### Breaking
- Updated `primitive-types` to 0.9. [#510](https://github.com/paritytech/parity-common/pull/510)

## [0.6.0] - 2021-01-05
### Breaking
- Updated `primitive-types` to 0.8. [#463](https://github.com/paritytech/parity-common/pull/463)

## [0.5.1] - 2020-04-10
- Added `keccak256_range` and `keccak512_range` functions. [#370](https://github.com/paritytech/parity-common/pull/370)

Expand Down
Loading