interplane.Get Omega
Read in your language

aien-protocols-mv

Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem

Brought by drakestapleton

branch main Branches Tags History

aien-protocols-mv / evidence / aienet0-20261028 / xcheck662 / main.rs

18 lines · 869 bytes Raw Blame History
1// Cross-check: Core PR #662 task.rs (verbatim, sha256 recorded) oracle+run digests for hex payloads on stdin lines.
2#[allow(dead_code)]
3mod task;
4use std::io::BufRead;
5use std::sync::atomic::AtomicBool;
6fn main() {
7 for line in std::io::stdin().lock().lines() {
8 let line = line.unwrap();
9 let b: Vec<u8> = (0..line.len()).step_by(2).map(|i| u8::from_str_radix(&line[i..i + 2], 16).unwrap()).collect();
10 let spec = task::TaskSpec::decode(&b).unwrap();
11 let o = task::oracle(&spec);
12 let cancel = AtomicBool::new(false);
13 let ctl = task::Control { cancel: &cancel, deadline: std::time::Instant::now() + std::time::Duration::from_secs(600), threads: 1 };
14 let r = task::run(&spec, &ctl).ok().unwrap();
15 assert_eq!(o, r);
16 println!("{}", o.iter().map(|x| format!("{x:02x}")).collect::<String>());
17 }
18}