Skip to content
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

Feat: noname cli: read input/output JSON from file #110

Closed

Conversation

ibkisthere
Copy link

Closes #92
There's a lot of changes - i'll briefly summarize what i did

  • I added a way to parse JSON files to the noname-cli , following the second option on noname cli: read input/output JSON from file  #92 , it first tries to parse json, if it can not we will try parse as file path.
  • if the path/ file is invalid (it does not exists, or it is a directory) it panics immediately and shows an error message on the console
  • added 2 more Error types to the ParsingError Enum for the invalid path/ file does not exist error and path is directory
  • added an inputs folder and two folders under it for testing valid and invalid json public_inputs and private_inputs

Here are some example commands to test the new changes to the cli

cargo run test --backend r1cs-bn254 --path examples/arithmetic.no --private-inputs '{"private_input": "2"}' --public-inputs '{"public_input": "2"}' --debug

cargo run test --backend r1cs-bn254 --path examples/arithmetic.no --private-inputs examples/json/inputs1/private_input.json --public-inputs examples/json/inputs1/public_input.json --debug

@ibkisthere ibkisthere changed the title #92 Feat: noname cli: read input/output JSON from file Jun 9, 2024
Copy link
Contributor

@mimoo mimoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great, thanks! The only problem that I see is that we're not making use of the examples/json/* files right? Maybe we should have a test to exercise that path?

@ibkisthere
Copy link
Author

Oh i understand you , i only tested the inputs manually by writing commands to the paths to the files, i didn't write actual tests , i'm just seeing a test folder in the repo just now, i can do that.

@mimoo
Copy link
Contributor

mimoo commented Jun 14, 2024

we ended up merging this one: #111 but if you want to add your comments to the CLI usage that would still be great!

@ibkisthere
Copy link
Author

Will do !

@mimoo mimoo self-requested a review June 20, 2024 22:07
@mimoo
Copy link
Contributor

mimoo commented Jun 21, 2024

I'll close this one for now!

@mimoo mimoo closed this Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

noname cli: read input/output JSON from file
2 participants