mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 01:11:10 +00:00
Add append api and use it to deposit events (#5795)
* use append api to deposit events * use optimized append * one more optimization * fix bug * fix issues * address review
This commit is contained in:
@@ -41,6 +41,8 @@ pub enum Error {
|
||||
ExtensionsAreNotSupported,
|
||||
/// Extension `TypeId` is not registered.
|
||||
ExtensionIsNotRegistered(TypeId),
|
||||
/// Failed to update storage,
|
||||
StorageUpdateFailed(&'static str),
|
||||
}
|
||||
|
||||
/// The Substrate externalities.
|
||||
@@ -176,6 +178,15 @@ pub trait Externalities: ExtensionStore {
|
||||
child_info: &ChildInfo,
|
||||
) -> Vec<u8>;
|
||||
|
||||
/// Append storage item.
|
||||
///
|
||||
/// This assumes specific format of the storage item. Also there is no way to undo this operation.
|
||||
fn storage_append(
|
||||
&mut self,
|
||||
key: Vec<u8>,
|
||||
value: Vec<u8>,
|
||||
);
|
||||
|
||||
/// Get the changes trie root of the current storage overlay at a block with given `parent`.
|
||||
///
|
||||
/// `parent` expects a SCALE encoded hash.
|
||||
|
||||
Reference in New Issue
Block a user