Skip to content

Commit

Permalink
update to codec 2.0 (#123)
Browse files Browse the repository at this point in the history
* update codec to 2.0

* reference-trie: fix compilation

Co-authored-by: Andronik Ordian <[email protected]>
  • Loading branch information
gui1117 and ordian authored Jan 28, 2021
1 parent f51ee79 commit bc7828c
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 16 deletions.
3 changes: 3 additions & 0 deletions memory-db/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.26.0] - 2021-01-27
- Update `parity-util-mem`.

## [0.25.0] - 2021-01-05
- Update `parity-util-mem` and `hashbrown`, removed `heapsize`. [#118](https://github.com/paritytech/trie/pull/118)

Expand Down
4 changes: 2 additions & 2 deletions memory-db/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "memory-db"
version = "0.25.0"
version = "0.26.0"
authors = ["Parity Technologies <[email protected]>"]
description = "In-memory implementation of hash-db, useful for tests"
repository = "https://github.com/paritytech/trie"
license = "Apache-2.0"
edition = "2018"

[dependencies]
parity-util-mem = { version = "0.8.0", default-features = false, features = ["hashbrown"] }
parity-util-mem = { version = "0.9.0", default-features = false, features = ["hashbrown"] }
hash-db = { path = "../hash-db", default-features = false, version = "0.15.2"}
hashbrown = { version = "0.9.1", default-features = false, features = [ "ahash" ] }

Expand Down
3 changes: 3 additions & 0 deletions test-support/reference-trie/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.23.0] - 2021-01-27
- Update parity-scale-codec to 2.0.

## [0.22.0] - 2020-07-06
- Update trie-db to 0.22. [#98](https://github.com/paritytech/trie/pull/98)

Expand Down
6 changes: 3 additions & 3 deletions test-support/reference-trie/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "reference-trie"
version = "0.22.0"
version = "0.23.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Simple reference trie format"
repository = "https://github.com/paritytech/trie/"
Expand All @@ -13,10 +13,10 @@ hash256-std-hasher = { path = "../../hash256-std-hasher", version = "0.15.2" }
keccak-hasher = { path = "../keccak-hasher", version = "0.15.3" }
trie-db = { path = "../../trie-db", default-features = false, version = "0.22.0" }
trie-root = { path = "../../trie-root", default-features = false, version = "0.16.0" }
parity-scale-codec = { version = "1.0.3", features = ["derive"] }
parity-scale-codec = { version = "2.0.0", features = ["derive"] }

[dev-dependencies]
trie-bench = { path = "../trie-bench", version = "0.26.0" }
trie-bench = { path = "../trie-bench", version = "0.27.0" }
criterion = "0.3.3"

[[bench]]
Expand Down
6 changes: 3 additions & 3 deletions test-support/reference-trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ enum NodeHeaderNoExt {
}

impl Encode for NodeHeader {
fn encode_to<T: Output>(&self, output: &mut T) {
fn encode_to<T: Output + ?Sized>(&self, output: &mut T) {
match self {
NodeHeader::Null => output.push_byte(EMPTY_TRIE),
NodeHeader::Branch(true) => output.push_byte(BRANCH_NODE_WITH_VALUE),
Expand Down Expand Up @@ -424,7 +424,7 @@ fn size_and_prefix_iterator(size: usize, prefix: u8) -> impl Iterator<Item = u8>
first_byte.chain(::std::iter::from_fn(next_bytes))
}

fn encode_size_and_prefix(size: usize, prefix: u8, out: &mut impl Output) {
fn encode_size_and_prefix(size: usize, prefix: u8, out: &mut (impl Output + ?Sized)) {
for b in size_and_prefix_iterator(size, prefix) {
out.push_byte(b)
}
Expand All @@ -447,7 +447,7 @@ fn decode_size<I: Input>(first: u8, input: &mut I) -> Result<usize, CodecError>
}

impl Encode for NodeHeaderNoExt {
fn encode_to<T: Output>(&self, output: &mut T) {
fn encode_to<T: Output + ?Sized>(&self, output: &mut T) {
match self {
NodeHeaderNoExt::Null => output.push_byte(EMPTY_TRIE_NO_EXT),
NodeHeaderNoExt::Branch(true, nibble_count) =>
Expand Down
4 changes: 4 additions & 0 deletions test-support/trie-bench/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.27.0] - 2021-01-27
- Update memory-db to 0.26.
- Update parity-scale-codec to 2.0.

## [0.26.0] - 2021-01-05
- Update memory-db to 0.25. [#118](https://github.com/paritytech/trie/pull/118)

Expand Down
6 changes: 3 additions & 3 deletions test-support/trie-bench/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "trie-bench"
description = "Standard benchmarking suite for tries"
version = "0.26.0"
version = "0.27.0"
authors = ["Parity Technologies <[email protected]>"]
repository = "https://github.com/paritytech/trie/"
license = "Apache-2.0"
Expand All @@ -11,8 +11,8 @@ edition = "2018"
keccak-hasher = { path = "../keccak-hasher", version = "0.15.2" }
trie-standardmap = { path = "../trie-standardmap", version = "0.15.2" }
hash-db = { path = "../../hash-db" , version = "0.15.2"}
memory-db = { path = "../../memory-db", version = "0.25.0" }
memory-db = { path = "../../memory-db", version = "0.26.0" }
trie-root = { path = "../../trie-root", version = "0.16.0" }
trie-db = { path = "../../trie-db", version = "0.22.0" }
criterion = "0.3.3"
parity-scale-codec = { version = "1.0.3" }
parity-scale-codec = { version = "2.0.0" }
6 changes: 3 additions & 3 deletions trie-db/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trie-db-test"
version = "0.22.1"
version = "0.23.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Tests for trie-db crate"
repository = "https://github.com/paritytech/trie"
Expand All @@ -15,12 +15,12 @@ harness = false
trie-db = { path = "..", version = "0.22.1"}
hash-db = { path = "../../hash-db", version = "0.15.2"}
rustc-hex = { version = "2.1.0" }
memory-db = { path = "../../memory-db", version = "0.25.0" }
memory-db = { path = "../../memory-db", version = "0.26.0" }
rand = { version = "0.8", default-features = false, features = ["small_rng"] }
trie-root = { path = "../../trie-root", version = "0.16.0"}
trie-standardmap = { path = "../../test-support/trie-standardmap", version = "0.15.2" }
keccak-hasher = { path = "../../test-support/keccak-hasher", version = "0.15.2" }
reference-trie = { path = "../../test-support/reference-trie", version = "0.22.0" }
reference-trie = { path = "../../test-support/reference-trie", version = "0.23.0" }
hex-literal = "0.3"
criterion = "0.3"
env_logger = "0.8"
Expand Down
4 changes: 2 additions & 2 deletions trie-root/test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trie-root-test"
version = "0.16.0"
version = "0.17.0"
authors = ["Parity Technologies <[email protected]>"]
description = "Tests fo trie-root crate"
repository = "https://github.com/paritytech/trie"
Expand All @@ -14,4 +14,4 @@ hash-db = { path = "../../hash-db", version = "0.15.2" }
hex-literal = "0.3"
keccak-hasher = { path = "../../test-support/keccak-hasher", version = "0.15.2" }
trie-standardmap = { path = "../../test-support/trie-standardmap", version = "0.15.2" }
reference-trie = { path = "../../test-support/reference-trie", version = "0.22.0" }
reference-trie = { path = "../../test-support/reference-trie", version = "0.23.0" }

0 comments on commit bc7828c

Please sign in to comment.