mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 18:11:10 +00:00
Use storage::append in the implementation of the storage types (#5889)
* Start improving `storage_append` * Fix some stuff * Fix compilation * Update docs and add new test * More tests * Test kill + append
This commit is contained in:
@@ -117,7 +117,14 @@ pub trait Storage {
|
||||
Externalities::clear_prefix(*self, prefix)
|
||||
}
|
||||
|
||||
/// Append to storage item (assumes it is in "Vec" format).
|
||||
/// Append the encoded `value` to the storage item at `key`.
|
||||
///
|
||||
/// The storage item needs to implement [`EncodeAppend`](codec::EncodeAppend).
|
||||
///
|
||||
/// # Warning
|
||||
///
|
||||
/// If the storage item does not support [`EncodeAppend`](codec::EncodeAppend) or
|
||||
/// something else fails at appending, the storage item will be set to `[value]`.
|
||||
fn append(&mut self, key: &[u8], value: Vec<u8>) {
|
||||
self.storage_append(key.to_vec(), value);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user