-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,59 @@ | ||
use aptos_keyless_common::api::{RequestInput, ProverServiceResponse}; | ||
|
||
|
||
pub type Bytes = Vec<u8>; | ||
#[derive(Default)] | ||
pub struct Groth16Vk { | ||
pub alpha_g1: Bytes, | ||
pub beta_g1: Bytes, | ||
pub delta_g2: Bytes, | ||
pub gamma_abc_g1: Vec<Bytes>, | ||
pub gamma_g2: Bytes, | ||
} | ||
|
||
// TODO: Implement | ||
#[derive(Default)] | ||
pub struct RapidProver {} | ||
#[derive(Default)] | ||
// TODO: Implement | ||
pub struct Config {} | ||
#[derive(Default)] | ||
// TODO: Implement | ||
pub struct CircuitConfig {} | ||
|
||
#[derive(Default)] | ||
pub struct State { | ||
prover: Mutex<RapidProver>, // from rust-snark wrapper | ||
groth16_vk: Groth16VK, | ||
config: Config, | ||
circuit_config: CircuitConfig, | ||
} | ||
|
||
impl State { | ||
fn new() -> Self { | ||
Default::default() | ||
} | ||
} | ||
|
||
// TODO: Make main Tokio runtime | ||
fn main() { | ||
println!("Hello, world!"); | ||
// TODO: Add Service to do some sending/receiving of proof requests etc | ||
|
||
|
||
//TODO: log service | ||
|
||
//TODO: Add verification key file read | ||
|
||
//TODO: Initialisze State | ||
//TODO: Config | ||
//TODO: wrap state in arc pointer to share to threads | ||
|
||
//TODO: Fetch JWK refresh in some interval -- async fn | ||
|
||
// Some metrics service start perhaps | ||
} | ||
|
||
#[test] | ||
fn can_create_state() { | ||
assert!(State::new()) | ||
} |