verity_verify_remote/
lib.rspub mod config;
pub mod ic;
#[cfg(test)]
mod tests {
use config::Config;
use ic::{ Verifier, DEFAULT_IC_GATEWAY_LOCAL };
use super::*;
use std::fs;
#[tokio::test]
async fn async_test_example() -> anyhow::Result<()> {
let proof1 = fs::read_to_string("./fixtures/proof.json")?;
let proof2 = fs::read_to_string("./fixtures/session.json")?;
let notary_pub_key = fs::read_to_string("./fixtures/notary.pub")?;
let config = Config::new(
DEFAULT_IC_GATEWAY_LOCAL.to_string(),
"./identity.pem".to_string(),
"bkyz2-fmaaa-aaaaa-qaaaq-cai".to_string()
);
let verifier = Verifier::from_config(&config).await.unwrap();
let response = verifier.verify_proof(vec![proof1, proof2], notary_pub_key).await;
let _ = verifier.get_public_key().await.unwrap();
assert!(response.is_ok());
Ok(())
}
}