From 51f7e047a3040c8d3285ccb52e626047e13ceaec Mon Sep 17 00:00:00 2001 From: Luke Parker Date: Sat, 25 May 2024 19:38:32 -0400 Subject: [PATCH] Use a log statement for which wasm is used --- Cargo.lock | 1 + substrate/node/Cargo.toml | 3 ++- substrate/node/src/chain_spec.rs | 5 ++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba0ab7659..2450c1906 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8018,6 +8018,7 @@ dependencies = [ "hex", "jsonrpsee", "libp2p", + "log", "pallet-transaction-payment-rpc", "rand_core", "sc-authority-discovery", diff --git a/substrate/node/Cargo.toml b/substrate/node/Cargo.toml index 60f7dc0f6..0e551c72b 100644 --- a/substrate/node/Cargo.toml +++ b/substrate/node/Cargo.toml @@ -20,10 +20,11 @@ workspace = true name = "serai-node" [dependencies] +rand_core = "0.6" zeroize = "1" hex = "0.4" +log = "0.4" -rand_core = "0.6" schnorrkel = "0.11" libp2p = "0.52" diff --git a/substrate/node/src/chain_spec.rs b/substrate/node/src/chain_spec.rs index 6fa8d6c3e..664a422bb 100644 --- a/substrate/node/src/chain_spec.rs +++ b/substrate/node/src/chain_spec.rs @@ -18,9 +18,12 @@ fn account_from_name(name: &'static str) -> PublicKey { fn wasm_binary() -> Vec { // TODO: Accept a config of runtime path - if let Ok(binary) = std::fs::read("/runtime/serai.wasm") { + const WASM_PATH: &str = "/runtime/serai.wasm"; + if let Ok(binary) = std::fs::read(WASM_PATH) { + log::info!("using {WASM_PATH}"); return binary; } + log::info!("using built-in {WASM_PATH}"); WASM_BINARY.ok_or("compiled in wasm not available").unwrap().to_vec() }