verity_verify_remote/
lib.rs1pub mod config;
2pub mod ic;
3
4#[cfg(test)]
5mod tests {
6 use config::Config;
7 use ic::{Verifier, DEFAULT_IC_GATEWAY_LOCAL};
8
9 use super::*;
11 use std::fs;
12
13 #[tokio::test]
15 async fn async_test_example() -> anyhow::Result<()> {
16 let proof1 = fs::read_to_string("./fixtures/proof.json")?;
18 let proof2 = fs::read_to_string("./fixtures/session.json")?;
19 let notary_pub_key = fs::read_to_string("./fixtures/notary.pub")?;
20
21 let config = Config::new(
23 DEFAULT_IC_GATEWAY_LOCAL.to_string(),
24 "./identity.pem".to_string(),
25 "bkyz2-fmaaa-aaaaa-qaaaq-cai".to_string(),
26 );
27
28 let verifier = Verifier::from_config(&config).await.unwrap();
30
31 let response = verifier
33 .verify_proof(vec![proof1, proof2], notary_pub_key)
34 .await;
35
36 let _ = verifier.get_public_key().await.unwrap();
38
39 assert!(response.is_ok());
40
41 Ok(())
42 }
43}