Companion for substrate#11523 (#1390)

* Align to changes in substrate: `sp_io::storage::get` now returns `Bytes`

* Update substrate and polkadot to the newest master

* update lockfile for {"substrate", "polkadot"}

Co-authored-by: parity-processbot <>
This commit is contained in:
Koute
2022-07-29 18:34:26 +09:00
committed by GitHub
parent db5fdc6eff
commit 1a32cdc915
4 changed files with 377 additions and 417 deletions
+373 -414
View File
File diff suppressed because it is too large Load Diff
@@ -6,6 +6,7 @@ edition = "2021"
description = "Base pallet for cumulus-based parachains" description = "Base pallet for cumulus-based parachains"
[dependencies] [dependencies]
bytes = { version = "1.1.0", default-features = false }
codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.0.0", default-features = false, features = ["derive"] }
environmental = { version = "1.1.2", default-features = false } environmental = { version = "1.1.2", default-features = false }
impl-trait-for-tuples = "0.2.1" impl-trait-for-tuples = "0.2.1"
@@ -205,8 +205,8 @@ fn host_storage_set(key: &[u8], value: &[u8]) {
with_externalities(|ext| ext.place_storage(key.to_vec(), Some(value.to_vec()))) with_externalities(|ext| ext.place_storage(key.to_vec(), Some(value.to_vec())))
} }
fn host_storage_get(key: &[u8]) -> Option<Vec<u8>> { fn host_storage_get(key: &[u8]) -> Option<bytes::Bytes> {
with_externalities(|ext| ext.storage(key).clone()) with_externalities(|ext| ext.storage(key).map(|value| value.into()))
} }
fn host_storage_exists(key: &[u8]) -> bool { fn host_storage_exists(key: &[u8]) -> bool {
+1 -1
View File
@@ -347,7 +347,7 @@ pub struct TestOnRuntimeUpgrade;
impl OnRuntimeUpgrade for TestOnRuntimeUpgrade { impl OnRuntimeUpgrade for TestOnRuntimeUpgrade {
fn on_runtime_upgrade() -> frame_support::weights::Weight { fn on_runtime_upgrade() -> frame_support::weights::Weight {
assert_eq!(sp_io::storage::get(TEST_RUNTIME_UPGRADE_KEY), Some(vec![1, 2, 3, 4])); assert_eq!(sp_io::storage::get(TEST_RUNTIME_UPGRADE_KEY), Some(vec![1, 2, 3, 4].into()));
1 1
} }