Add MockAttestor
This commit is contained in:
parent
6351c10932
commit
02863d7746
2 changed files with 13 additions and 2 deletions
|
@ -25,3 +25,14 @@ impl Attestor for EpidAttestor {
|
||||||
read("/dev/attestation/quote")
|
read("/dev/attestation/quote")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Clone, PartialEq, Debug)]
|
||||||
|
pub struct MockAttestor;
|
||||||
|
|
||||||
|
impl Attestor for MockAttestor {
|
||||||
|
type Error = String;
|
||||||
|
|
||||||
|
fn quote(&self, _user_data: impl HasUserData) -> Result<Vec<u8>, Self::Error> {
|
||||||
|
Ok(vec![])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@ use quartz_cw::state::{Config, LightClientOpts};
|
||||||
use quartz_proto::quartz::core_server::CoreServer;
|
use quartz_proto::quartz::core_server::CoreServer;
|
||||||
use tonic::transport::Server;
|
use tonic::transport::Server;
|
||||||
|
|
||||||
use crate::{attestor::EpidAttestor, cli::Cli, server::CoreService};
|
use crate::{attestor::MockAttestor, cli::Cli, server::CoreService};
|
||||||
|
|
||||||
#[tokio::main(flavor = "current_thread")]
|
#[tokio::main(flavor = "current_thread")]
|
||||||
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
@ -47,7 +47,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
);
|
);
|
||||||
|
|
||||||
Server::builder()
|
Server::builder()
|
||||||
.add_service(CoreServer::new(CoreService::new(config, EpidAttestor)))
|
.add_service(CoreServer::new(CoreService::new(config, MockAttestor)))
|
||||||
.serve(args.rpc_addr)
|
.serve(args.rpc_addr)
|
||||||
.await?;
|
.await?;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue