mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 12:19:24 +00:00
Check if wasm was built by container exit code and state instead of local mountpoint (#570)
* Check if the serai wasm was built successfully by verifying the build container's status code and state, instead of checking the volume mountpoint locally * Use a log statement for which wasm is used * Minor typo fix --------- Co-authored-by: Luke Parker <lukeparker5132@gmail.com>
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -18,9 +18,12 @@ fn account_from_name(name: &'static str) -> PublicKey {
|
||||
|
||||
fn wasm_binary() -> Vec<u8> {
|
||||
// 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");
|
||||
WASM_BINARY.ok_or("compiled in wasm not available").unwrap().to_vec()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user