mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-30 20:07:24 +00:00
Use prefixed keys for trie node. (#2130)
* Account for pending insertions when pruning * Prefixed trie storage * Comments * Prefixed trie storage * Fixed tests * Fixed tests * Bumped runtime version * Bumped runtime version again
This commit is contained in:
committed by
Gav Wood
parent
f9d0da0a18
commit
7046e13de2
@@ -18,7 +18,7 @@
|
||||
|
||||
use std::collections::HashMap;
|
||||
use primitives::H256;
|
||||
use crate::{DBValue, ChangeSet, CommitSet, MetaDb, HashDb};
|
||||
use crate::{DBValue, ChangeSet, CommitSet, MetaDb, NodeDb};
|
||||
|
||||
#[derive(Default, Debug, Clone, PartialEq, Eq)]
|
||||
pub struct TestDb {
|
||||
@@ -34,9 +34,9 @@ impl MetaDb for TestDb {
|
||||
}
|
||||
}
|
||||
|
||||
impl HashDb for TestDb {
|
||||
impl NodeDb for TestDb {
|
||||
type Error = ();
|
||||
type Hash = H256;
|
||||
type Key = H256;
|
||||
|
||||
fn get(&self, key: &H256) -> Result<Option<DBValue>, ()> {
|
||||
Ok(self.data.get(key).cloned())
|
||||
|
||||
Reference in New Issue
Block a user