Skip to content

Commit 857896b

Browse files
authored
fix(benchmark-ci): ensure benchmarks run (#2171)
# Goal Ensure running benchmarks in CI works.
1 parent 8e6c002 commit 857896b

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

node/service/src/chain_spec/frequency.rs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,28 @@ pub fn load_frequency_spec() -> ChainSpec {
1616
.unwrap()
1717
}
1818

19+
#[allow(clippy::unwrap_used)]
20+
fn frequency_genesis_config() -> serde_json::Value {
21+
let mut output: serde_json::Value =
22+
serde_json::from_slice(include_bytes!("../../../../resources/frequency.json").as_slice())
23+
.map_err(|e| format!("Invalid JSON blob {:?}", e))
24+
.unwrap();
25+
26+
if let Some(runtime) = output["genesis"]["runtime"].as_object_mut() {
27+
runtime.remove("vesting");
28+
runtime["parachainSystem"] = serde_json::json!({});
29+
runtime["treasury"] = serde_json::json!({});
30+
runtime["auraExt"] = serde_json::json!({});
31+
}
32+
33+
if let Some(system) = output["genesis"]["runtime"]["system"].as_object_mut() {
34+
system.remove("code");
35+
}
36+
37+
let runtime = &output["genesis"]["runtime"];
38+
runtime.clone()
39+
}
40+
1941
#[allow(clippy::unwrap_used)]
2042
pub fn benchmark_mainnet_config() -> ChainSpec {
2143
let properties =
@@ -38,6 +60,6 @@ pub fn benchmark_mainnet_config() -> ChainSpec {
3860
"/dns4/0.boot.frequency.xyz/tcp/30333/ws/p2p/12D3KooWBd4aEArNvXECtt2JHQACBdFmeafpyfre3q81iM1xCcpP".parse().unwrap(),
3961
"/dns4/1.boot.frequency.xyz/tcp/30333/ws/p2p/12D3KooWCW8d7Yz2d3Jcb49rWcNppRNEs1K2NZitCpPtrHSQb6dw".parse().unwrap(),
4062
])
41-
.with_genesis_config_preset_name("frequency")
63+
.with_genesis_config_patch(frequency_genesis_config())
4264
.build()
4365
}

0 commit comments

Comments
 (0)