Prepare UI tests for rust 1.55 (#9637)

* Prepare UI tests for rust 1.54

* Delete wrong_page.stderr

* CI: run with a staging CI image

* Revert "CI: run with a staging CI image"

This reverts commit 66f5b00d14b50fd9d8fbf773f7e884f380697591.

* CI: debug, again

* LOG_TARGET is only used in std

* Remove unnecessary unsafe

* Fixes

* Use correct rustc locally

* FMT

* Compile with benchmarking

* Review feedback

* Some ui tests

* I know...

* Fix wasm tests

Co-authored-by: Denis P <denis.pisarev@parity.io>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Bastian Köcher
2021-09-24 13:42:08 +03:00
committed by GitHub
parent 1879a2d04f
commit 62187b5916
60 changed files with 431 additions and 335 deletions
@@ -21,9 +21,9 @@ use crate::{
trie_backend::TrieBackend, trie_backend_essence::TrieBackendStorage, ChildStorageCollection,
StorageCollection, StorageKey, StorageValue, UsageInfo,
};
use codec::{Decode, Encode};
use codec::Encode;
use hash_db::Hasher;
use sp_core::storage::{well_known_keys, ChildInfo, TrackedStorageKey};
use sp_core::storage::{ChildInfo, TrackedStorageKey};
#[cfg(feature = "std")]
use sp_core::traits::RuntimeCode;
use sp_std::vec::Vec;
@@ -330,7 +330,11 @@ impl<'a, B: Backend<H>, H: Hasher> sp_core::traits::FetchRuntimeCode
for BackendRuntimeCode<'a, B, H>
{
fn fetch_runtime_code<'b>(&'b self) -> Option<std::borrow::Cow<'b, [u8]>> {
self.backend.storage(well_known_keys::CODE).ok().flatten().map(Into::into)
self.backend
.storage(sp_core::storage::well_known_keys::CODE)
.ok()
.flatten()
.map(Into::into)
}
}
@@ -348,17 +352,17 @@ where
pub fn runtime_code(&self) -> Result<RuntimeCode, &'static str> {
let hash = self
.backend
.storage_hash(well_known_keys::CODE)
.storage_hash(sp_core::storage::well_known_keys::CODE)
.ok()
.flatten()
.ok_or("`:code` hash not found")?
.encode();
let heap_pages = self
.backend
.storage(well_known_keys::HEAP_PAGES)
.storage(sp_core::storage::well_known_keys::HEAP_PAGES)
.ok()
.flatten()
.and_then(|d| Decode::decode(&mut &d[..]).ok());
.and_then(|d| codec::Decode::decode(&mut &d[..]).ok());
Ok(RuntimeCode { code_fetcher: self, hash, heap_pages })
}