Rework the runtime upgrade test (#727)

* Rework the runtime upgrade test

* Update test/service/tests/runtime_upgrade.rs

* Update test/service/tests/runtime_upgrade.rs

* Update Cargo.lock

* FMT

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Bastian Köcher
2021-11-09 15:02:34 +01:00
committed by GitHub
parent c63c5229ba
commit ae12a80b35
10 changed files with 2610 additions and 1399 deletions
@@ -73,17 +73,11 @@ async fn test_runtime_upgrade() {
.expect("Runtime version exists");
expected_runtime_version.spec_version += 1;
// Replace the runtime version in the WASM blob to make it look like a new runtime.
let wasm = sp_maybe_compressed_blob::decompress(
cumulus_test_runtime_upgrade::WASM_BINARY.unwrap(),
sp_maybe_compressed_blob::CODE_BLOB_BOMB_LIMIT,
)
.expect("Decompressing the WASM blob works");
let wasm = sp_version::embed::embed_runtime_version(&wasm, expected_runtime_version.clone())
.expect("Embedding the runtime version works");
let wasm = cumulus_test_runtime::wasm_spec_version_incremented::WASM_BINARY
.expect("Wasm binary with incremented spec version should have been built");
// schedule runtime upgrade
charlie.schedule_upgrade(wasm).await.unwrap();
charlie.schedule_upgrade(wasm.into()).await.unwrap();
let mut import_stream = dave.client.import_notification_stream();