Companion for PR 8913 (#3114)

* Companion for PR 8913

polkadot companion: https://github.com/paritytech/substrate/pull/8913

* update Substrate

Co-authored-by: parity-processbot <>
This commit is contained in:
Sergei Shulepov
2021-06-01 13:03:34 +02:00
committed by GitHub
parent 24d1eb40cc
commit 2239b93d31
6 changed files with 265 additions and 258 deletions
+4 -17
View File
@@ -60,7 +60,7 @@ pub struct ArtifactId {
}
impl ArtifactId {
const PREFIX: &'static str = "wasmtime_1_";
const PREFIX: &'static str = "wasmtime_";
/// Creates a new artifact ID with the given hash.
pub fn new(code_hash: Hash) -> Self {
@@ -191,19 +191,6 @@ mod tests {
use sp_core::H256;
use std::str::FromStr;
#[test]
fn ensure_wasmtime_version() {
assert_eq!(
wasmtime_jit::VERSION,
"0.24.0",
"wasmtime version is updated. Check the prefix.",
);
// If the version bump is significant, change `ArtifactId::PREFIX`.
//
// If in doubt bump it. This will lead to removal of the existing artifacts in the on-disk cache
// and recompilation.
}
#[test]
fn from_file_name() {
assert!(ArtifactId::from_file_name("").is_none());
@@ -211,7 +198,7 @@ mod tests {
assert_eq!(
ArtifactId::from_file_name(
"wasmtime_1_0x0022800000000000000000000000000000000000000000000000000000000000"
"wasmtime_0x0022800000000000000000000000000000000000000000000000000000000000"
),
Some(ArtifactId::new(
hex_literal::hex![
@@ -229,7 +216,7 @@ mod tests {
assert_eq!(
ArtifactId::new(hash).path(path).to_str(),
Some("/test/wasmtime_1_0x1234567890123456789012345678901234567890123456789012345678901234"),
Some("/test/wasmtime_0x1234567890123456789012345678901234567890123456789012345678901234"),
);
}
@@ -238,7 +225,7 @@ mod tests {
let fake_cache_path = async_std::task::block_on(async move { crate::worker_common::tmpfile("test-cache").await.unwrap() });
let fake_artifact_path = {
let mut p = fake_cache_path.clone();
p.push("wasmtime_1_0x1234567890123456789012345678901234567890123456789012345678901234");
p.push("wasmtime_0x1234567890123456789012345678901234567890123456789012345678901234");
p
};