-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Verify perf #4
base: master
Are you sure you want to change the base?
Verify perf #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review; interrupted by other tasks.
src/main.rs
Outdated
@@ -80,7 +130,7 @@ fn main() { | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check will be triggered only if someone passes an empty string as the file name.
Clap has checks for missing flags included, so you could just remove this, unless you want exactly this behavior (to catch --input-file ""
).
# ./target/release/dvt_prover_host --input-file
error: a value is required for '--input-file <INPUT_FILE>' but none was supplied
For more information, try '--help'.
# ./target/release/dvt_prover_host --input-file "" --type share
No file name provided after '--input-file'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworked
src/main.rs
Outdated
} | ||
|
||
fn read_text_file(filename: &str) -> Result<String, Box<dyn Error>> { | ||
fn read_text_file(filename: &str) -> Result<String, Box<dyn Error>> { | ||
let mut file = File::open(filename).map_err(|e| format!("Error opening file: {}", e))?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error currently looks like this:
# ./target/release/dvt_prover_host --input-file examples/dvt_bad_share.json --type share --json-schema-file foo
Error opening file: No such file or directory (os error 2)
In my opinion, this is a shortcoming of std::io
: the name of the file is not printed. I would add it in the error message manually:
let mut file = File::open(filename).map_err(|e| format!("Error opening file {filename}: {e}"))?;
Also, note that you can interpolate variables directly. (But not expressions; format!("{x}");
works, but format!("{call_me()}");
does not.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reworked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this change in the current code. Did you forget to add it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
now should be there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finished review of the share_exchange_prove
guest program.
Let me know if you would like me to review more of this code (the other guest programs).
No description provided.