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

Adding JSON Marshalling to Config #638

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from

Conversation

praetoriansentry
Copy link

This change is adding a toJson() method to the Config class and using the Json representation of the Config in order to print.

At a high-level, printing the config in Json format has a few potential advantages:

  • It's a bit easier to verify the loaded configuration against the config file since they're both machine readable
  • It's a nice feature to be able to dump the default config.
    • echo "{}" > empty.json; ./build/zkProver -c empty.json will now print out the defaults that can be copy pasted into a new file and the tweaked
  • I'm hopeful that this is easier to maintain going forward because the toJson() method is just a copy paste / macro of the load(json &config) method
  • The method itself could be useful in other future scenarios where the config needs to be serialized for some reason

@cla-bot
Copy link

cla-bot bot commented Oct 11, 2023

We require contributors/corporates @praetoriansentry to read our Contributor License Agreement, please check the Individual CLA document/Corporate CLA document

@cla-bot cla-bot bot added the cla-signed label Oct 16, 2023
@praetoriansentry praetoriansentry marked this pull request as ready for review October 16, 2023 13:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant