mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 13:45:40 +00:00
PVF: Add worker check during tests and benches (#1771)
This commit is contained in:
@@ -116,5 +116,18 @@ pub use polkadot_node_core_pvf_common::{
|
||||
SecurityStatus,
|
||||
};
|
||||
|
||||
use std::{path::Path, process::Command};
|
||||
|
||||
/// The log target for this crate.
|
||||
pub const LOG_TARGET: &str = "parachain::pvf";
|
||||
|
||||
/// Utility to get the version of a worker, used for version checks.
|
||||
///
|
||||
/// The worker's existence at the given path must be checked separately.
|
||||
pub fn get_worker_version(worker_path: &Path) -> std::io::Result<String> {
|
||||
let worker_version = Command::new(worker_path).args(["--version"]).output()?.stdout;
|
||||
Ok(std::str::from_utf8(&worker_version)
|
||||
.expect("version is printed as a string; qed")
|
||||
.trim()
|
||||
.to_string())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user