Skip to content

Commit

Permalink
chain-spec-guide-runtime: path to wasm blob fixed (#6673)
Browse files Browse the repository at this point in the history
In `chain-spec-guide-runtime` crate's tests, there was assumption that
release version of wasm blob exists. This PR uses
`chain_spec_guide_runtime::runtime::WASM_BINARY_PATH` const to use
correct path to runtime blob.

---------

Co-authored-by: GitHub Action <[email protected]>
  • Loading branch information
michalkucharczyk and actions-user authored Nov 27, 2024
1 parent afd065f commit 2ef2723
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
use serde_json::{json, Value};
use std::{process::Command, str};

const WASM_FILE_PATH: &str =
"../../../../../target/release/wbuild/chain-spec-guide-runtime/chain_spec_guide_runtime.wasm";
fn wasm_file_path() -> &'static str {
chain_spec_guide_runtime::runtime::WASM_BINARY_PATH
.expect("chain_spec_guide_runtime wasm should exist. qed")
}

const CHAIN_SPEC_BUILDER_PATH: &str = "../../../../../target/release/chain-spec-builder";

Expand All @@ -26,7 +28,7 @@ fn list_presets() {
let output = Command::new(get_chain_spec_builder_path())
.arg("list-presets")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.output()
.expect("Failed to execute command");

Expand All @@ -50,7 +52,7 @@ fn get_preset() {
let output = Command::new(get_chain_spec_builder_path())
.arg("display-preset")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("-p")
.arg("preset_2")
.output()
Expand Down Expand Up @@ -83,7 +85,7 @@ fn generate_chain_spec() {
.arg("/dev/stdout")
.arg("create")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("named-preset")
.arg("preset_2")
.output()
Expand Down Expand Up @@ -140,7 +142,7 @@ fn generate_para_chain_spec() {
.arg("-p")
.arg("1000")
.arg("-r")
.arg(WASM_FILE_PATH)
.arg(wasm_file_path())
.arg("named-preset")
.arg("preset_2")
.output()
Expand Down
7 changes: 7 additions & 0 deletions prdoc/pr_6673.prdoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
title: 'chain-spec-guide-runtime: path to wasm blob fixed'
doc:
- audience: Runtime Dev
description: In `chain-spec-guide-runtime` crate's tests, there was assumption that
release version of wasm blob exists. This PR uses `chain_spec_guide_runtime::runtime::WASM_BINARY_PATH`
const to use correct path to runtime blob.
crates: []

0 comments on commit 2ef2723

Please sign in to comment.