Skip to content

Commit 45dadbc

Browse files
michalkucharczykactions-user
authored andcommitted
chain-spec-guide-runtime: path to wasm blob fixed (paritytech#6673)
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]>
1 parent a7bc763 commit 45dadbc

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

docs/sdk/src/reference_docs/chain_spec_runtime/tests/chain_spec_builder_tests.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
use serde_json::{json, Value};
22
use std::{process::Command, str};
33

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

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

@@ -26,7 +28,7 @@ fn list_presets() {
2628
let output = Command::new(get_chain_spec_builder_path())
2729
.arg("list-presets")
2830
.arg("-r")
29-
.arg(WASM_FILE_PATH)
31+
.arg(wasm_file_path())
3032
.output()
3133
.expect("Failed to execute command");
3234

@@ -50,7 +52,7 @@ fn get_preset() {
5052
let output = Command::new(get_chain_spec_builder_path())
5153
.arg("display-preset")
5254
.arg("-r")
53-
.arg(WASM_FILE_PATH)
55+
.arg(wasm_file_path())
5456
.arg("-p")
5557
.arg("preset_2")
5658
.output()
@@ -83,7 +85,7 @@ fn generate_chain_spec() {
8385
.arg("/dev/stdout")
8486
.arg("create")
8587
.arg("-r")
86-
.arg(WASM_FILE_PATH)
88+
.arg(wasm_file_path())
8789
.arg("named-preset")
8890
.arg("preset_2")
8991
.output()
@@ -140,7 +142,7 @@ fn generate_para_chain_spec() {
140142
.arg("-p")
141143
.arg("1000")
142144
.arg("-r")
143-
.arg(WASM_FILE_PATH)
145+
.arg(wasm_file_path())
144146
.arg("named-preset")
145147
.arg("preset_2")
146148
.output()

prdoc/pr_6673.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: 'chain-spec-guide-runtime: path to wasm blob fixed'
2+
doc:
3+
- audience: Runtime Dev
4+
description: In `chain-spec-guide-runtime` crate's tests, there was assumption that
5+
release version of wasm blob exists. This PR uses `chain_spec_guide_runtime::runtime::WASM_BINARY_PATH`
6+
const to use correct path to runtime blob.
7+
crates: []

0 commit comments

Comments
 (0)