mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
Storage chains: indexing, renewals and reference counting (#8265)
* Transaction indexing * Tests and fixes * Fixed a comment * Style * Build * Style * Apply suggestions from code review Co-authored-by: cheme <emericchevalier.pro@gmail.com> * Code review suggestions * Add missing impl * Apply suggestions from code review Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * impl JoinInput * Don't store empty slices * JoinInput operates on slices Co-authored-by: cheme <emericchevalier.pro@gmail.com> Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
//! Concrete externalities implementation.
|
||||
|
||||
use crate::{
|
||||
StorageKey, StorageValue, OverlayedChanges,
|
||||
StorageKey, StorageValue, OverlayedChanges, IndexOperation,
|
||||
backend::Backend, overlayed_changes::OverlayedExtensions,
|
||||
};
|
||||
use hash_db::Hasher;
|
||||
@@ -568,6 +568,36 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
fn storage_index_transaction(&mut self, index: u32, offset: u32) {
|
||||
trace!(
|
||||
target: "state",
|
||||
"{:04x}: IndexTransaction ({}): [{}..]",
|
||||
self.id,
|
||||
index,
|
||||
offset,
|
||||
);
|
||||
self.overlay.add_transaction_index(IndexOperation::Insert {
|
||||
extrinsic: index,
|
||||
offset,
|
||||
});
|
||||
}
|
||||
|
||||
/// Renew existing piece of data storage.
|
||||
fn storage_renew_transaction_index(&mut self, index: u32, hash: &[u8], size: u32) {
|
||||
trace!(
|
||||
target: "state",
|
||||
"{:04x}: RenewTransactionIndex ({}) {} bytes",
|
||||
self.id,
|
||||
HexDisplay::from(&hash),
|
||||
size,
|
||||
);
|
||||
self.overlay.add_transaction_index(IndexOperation::Renew {
|
||||
extrinsic: index,
|
||||
hash: hash.to_vec(),
|
||||
size
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
fn storage_changes_root(&mut self, _parent_hash: &[u8]) -> Result<Option<Vec<u8>>, ()> {
|
||||
Ok(None)
|
||||
|
||||
Reference in New Issue
Block a user