Prevent double allocation of the payload when calling sp_io::storage::get (#11523)

* Expose allocation stats in `FreeingBumpHeapAllocator`

* Return allocation stats when calling into the runtime

* Bump `parity-scale-codec` to 3.1.3 (fork)

* Prevent double allocation of the payload when calling `sp_io::storage::get`

* Fix tests

* Remove unnecessary `mut`

* Enable the `bytes` feature for `parity-scale-codec` in `sp-runtime-interface`

* Update client/allocator/src/freeing_bump.rs

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Bump `parity-scale-codec` to 3.1.3

* Fix some of the UI tests

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
KouteandBastian Köcher authored and GitHub committed 2022-07-29 07:46:15 +00:00
1 parent f44e4b3d48
commit c4b607d4c9
18 files changed
+284 -92

No files matched your search

@@ -155,7 +155,7 @@ pub fn clear_prefix(
/// Get a Vec of bytes from storage.
pub fn get_raw(key: &[u8]) -> Option<Vec<u8>> {
sp_io::storage::get(key)
sp_io::storage::get(key).map(|value| value.to_vec())
}
/// Put a raw byte slice into storage.