test: provide native signal book identity probe
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
use std::io::{self,Read};
|
||||
|
||||
fn main() -> Result<(),Box<dyn std::error::Error>> {
|
||||
let mut input=String::new();
|
||||
io::stdin().read_to_string(&mut input)?;
|
||||
let book:fidc_core::signal_contract::SignalBook=serde_json::from_str(&input)?;
|
||||
let version=book.version_sha256.clone();
|
||||
let snapshots=book.snapshots.len();
|
||||
let validated=book.validate().map_err(io::Error::other)?;
|
||||
println!("{}",serde_json::json!({"ok":true,"versionSha256":version,"snapshots":snapshots,
|
||||
"symbols":validated.symbols().len(),"observed":validated.require_observed().is_ok()}));
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user