MCPcopy Create free account
hub / github.com/AI45Lab/Code / verification_reports_from_value

Function verification_reports_from_value

sdk/node/src/lib.rs:2258–2273  ·  view source on GitHub ↗
(
    reports: serde_json::Value,
)

Source from the content-addressed store, hash-verified

2256}
2257
2258fn verification_reports_from_value(
2259 reports: serde_json::Value,
2260) -> napi::Result<Vec<RustVerificationReport>> {
2261 let reports = match reports {
2262 serde_json::Value::Array(_) => serde_json::from_value(reports),
2263 serde_json::Value::Object(_) => {
2264 serde_json::from_value::<RustVerificationReport>(reports).map(|report| vec![report])
2265 }
2266 _ => {
2267 return Err(napi::Error::from_reason(
2268 "verification reports must be an array or object",
2269 ));
2270 }
2271 };
2272 reports.map_err(|e| napi::Error::from_reason(format!("Invalid verification report: {e}")))
2273}
2274
2275fn js_auto_delegation_to_rust(
2276 options: AutoDelegationOptions,

Calls

no outgoing calls