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

Fix TrieDBRawIterator::prefix_then_seek #190

Merged
merged 6 commits into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions test-support/reference-trie/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog].

## [Unreleased]

## [0.29.1] - 2023-03-17
- Add substrate trie layouts

## [0.29.0] - 2023-03-14
- Update dependencies. [#188](https://github.com/paritytech/trie/pull/188) and [#187](https://github.com/paritytech/trie/pull/187)
Expand Down
3 changes: 2 additions & 1 deletion 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.29.0"
version = "0.29.1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Simple reference trie format"
repository = "https://github.com/paritytech/trie/"
Expand All @@ -14,6 +14,7 @@ trie-db = { path = "../../trie-db", default-features = false, version = "0.27.0"
trie-root = { path = "../../trie-root", default-features = false, version = "0.18.0" }
parity-scale-codec = { version = "3.0.0", features = ["derive"] }
hashbrown = { version = "0.13.2", default-features = false, features = ["ahash"] }
paste = "1.0.12"

[dev-dependencies]
trie-bench = { path = "../trie-bench" }
Expand Down
20 changes: 20 additions & 0 deletions test-support/reference-trie/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use trie_db::{
pub use trie_root::TrieStream;
use trie_root::{Hasher, Value as TrieStreamValue};

mod substrate;
mod substrate_like;
pub mod node {
pub use trie_db::node::Node;
Expand All @@ -38,6 +39,9 @@ pub use substrate_like::{
NodeCodec as ReferenceNodeCodecNoExtMeta, ReferenceTrieStreamNoExt,
};

pub use paste::paste;
pub use substrate::{LayoutV0 as SubstrateV0, LayoutV1 as SubstrateV1};

/// Reference hasher is a keccak hasher.
pub type RefHasher = keccak_hasher::KeccakHasher;

Expand All @@ -59,6 +63,22 @@ macro_rules! test_layouts {
};
}

#[macro_export]
macro_rules! test_layouts_substrate {
($test:ident) => {
$crate::paste! {
#[test]
fn [<$test _substrate_v0>]() {
$test::<$crate::SubstrateV0<$crate::RefHasher>>();
}
#[test]
fn [<$test _substrate_v1>]() {
$test::<$crate::SubstrateV1<$crate::RefHasher>>();
}
}
};
}

/// Apply a test method on every test layouts.
#[macro_export]
macro_rules! test_layouts_no_meta {
Expand Down
Loading