mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 15:11:03 +00:00
Set StateBackend::Transaction to PrefixedMemoryDB (#14612)
* Yep * Try to get it working everywhere * Make `from_raw_storage` start with an empty db * More fixes! * Make everything compile * Fix `child_storage_root` * Fix after merge * Cleanups * Update primitives/state-machine/src/overlayed_changes/mod.rs Co-authored-by: Davide Galassi <davxy@datawok.net> * Review comments * Fix issues * Silence warning * FMT * Clippy --------- Co-authored-by: Davide Galassi <davxy@datawok.net>
This commit is contained in:
@@ -86,9 +86,9 @@ use sp_runtime::{
|
||||
};
|
||||
use sp_state_machine::{
|
||||
backend::{AsTrieBackend, Backend as StateBackend},
|
||||
ChildStorageCollection, DBValue, IndexOperation, IterArgs, OffchainChangesCollection,
|
||||
StateMachineStats, StorageCollection, StorageIterator, StorageKey, StorageValue,
|
||||
UsageInfo as StateUsageInfo,
|
||||
BackendTransaction, ChildStorageCollection, DBValue, IndexOperation, IterArgs,
|
||||
OffchainChangesCollection, StateMachineStats, StorageCollection, StorageIterator, StorageKey,
|
||||
StorageValue, UsageInfo as StateUsageInfo,
|
||||
};
|
||||
use sp_trie::{cache::SharedTrieCache, prefixed_key, MemoryDB, PrefixedMemoryDB};
|
||||
|
||||
@@ -187,7 +187,6 @@ impl<B: BlockT> StorageIterator<HashingFor<B>> for RawIter<B> {
|
||||
|
||||
impl<B: BlockT> StateBackend<HashingFor<B>> for RefTrackingState<B> {
|
||||
type Error = <DbState<B> as StateBackend<HashingFor<B>>>::Error;
|
||||
type Transaction = <DbState<B> as StateBackend<HashingFor<B>>>::Transaction;
|
||||
type TrieBackendStorage = <DbState<B> as StateBackend<HashingFor<B>>>::TrieBackendStorage;
|
||||
type RawIter = RawIter<B>;
|
||||
|
||||
@@ -243,7 +242,7 @@ impl<B: BlockT> StateBackend<HashingFor<B>> for RefTrackingState<B> {
|
||||
&self,
|
||||
delta: impl Iterator<Item = (&'a [u8], Option<&'a [u8]>)>,
|
||||
state_version: StateVersion,
|
||||
) -> (B::Hash, Self::Transaction) {
|
||||
) -> (B::Hash, BackendTransaction<HashingFor<B>>) {
|
||||
self.state.storage_root(delta, state_version)
|
||||
}
|
||||
|
||||
@@ -252,7 +251,7 @@ impl<B: BlockT> StateBackend<HashingFor<B>> for RefTrackingState<B> {
|
||||
child_info: &ChildInfo,
|
||||
delta: impl Iterator<Item = (&'a [u8], Option<&'a [u8]>)>,
|
||||
state_version: StateVersion,
|
||||
) -> (B::Hash, bool, Self::Transaction) {
|
||||
) -> (B::Hash, bool, BackendTransaction<HashingFor<B>>) {
|
||||
self.state.child_storage_root(child_info, delta, state_version)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user