mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-19 13:25:44 +00:00
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:
@@ -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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user