mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 22:47:56 +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:
@@ -257,6 +257,16 @@ impl Externalities for BasicExternalities {
|
||||
}
|
||||
}
|
||||
|
||||
fn storage_append(
|
||||
&mut self,
|
||||
key: Vec<u8>,
|
||||
value: Vec<u8>,
|
||||
) {
|
||||
let previous = self.storage(&key).unwrap_or_default();
|
||||
let new = crate::ext::append_to_storage(previous, value).expect("Failed to append to storage");
|
||||
self.place_storage(key.clone(), Some(new));
|
||||
}
|
||||
|
||||
fn chain_id(&self) -> u64 { 42 }
|
||||
|
||||
fn storage_root(&mut self) -> Vec<u8> {
|
||||
|
||||
Reference in New Issue
Block a user