forked from nulltea/zkTripster
-
Notifications
You must be signed in to change notification settings - Fork 2
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
3 changed files
with
29 additions
and
25 deletions.
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,4 +1,4 @@ | ||
[workspace] | ||
exclude = ["zkpoex", "ecdh"] | ||
members = ["zkpoex-script", "ecdh-script", "evm-runner"] | ||
members = ["zkpoex-script", "ecdh-script", "evm-runner", "bid-server"] | ||
resolver = "2" |
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
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,38 +1,42 @@ | ||
#[macro_use] extern crate rocket; | ||
|
||
use rocket::{Rocket, Build}; | ||
use rocket::{Rocket, Build, State}; | ||
use clap::Parser; | ||
|
||
|
||
#[get("/")] | ||
fn index() -> &'static str { | ||
"Hello, world!" | ||
} | ||
|
||
// return contets of proof | ||
#[get("/proof")] | ||
async fn proof(args: &State<Args>) -> String { | ||
args.proof.clone() | ||
} | ||
|
||
/// Simple program to serve proof files | ||
#[derive(Parser, Debug)] | ||
#[command(version, about, long_about = None)] | ||
struct Args { | ||
/// path to proof | ||
#[arg(short, long)] | ||
proof: String, | ||
|
||
/// redemption address | ||
#[arg(short, long, default_value_t = (&"0x..").to_string())] | ||
address: String, | ||
} | ||
|
||
#[launch] | ||
fn rocket() -> Rocket<Build> { | ||
let args = Args::parse(); | ||
rocket::build() | ||
// .mount("/", routes![hello, hello]) // uncomment this to get an error | ||
// .mount("/", routes![unmanaged]) // uncomment this to get a sentinel error | ||
.mount("/", routes![index]) | ||
.mount("/", routes![proof]) | ||
.manage(args) | ||
} | ||
|
||
#[derive(Parser)] | ||
#[group(skip)] | ||
struct Options { | ||
/// File to read | ||
#[clap(long, env, default_value = "")] | ||
proofPath: PathBuf, | ||
} | ||
|
||
|
||
async fn app(options: Options) -> Result<()> { | ||
let mut proof = File::open(options.proofPath).await?; | ||
// verify | ||
Ok(()) | ||
} | ||
|
||
fn main() { | ||
if let Err(e) = rocket().launch().await { | ||
println!("Whoops! Rocket didn't launch!"); | ||
// We drop the error to get a Rocket-formatted panic. | ||
drop(e); | ||
}; | ||
} |