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

Fix Sudoku and enable CLI to create init() proofs #315

Merged
merged 7 commits into from
Nov 22, 2022

Conversation

mitschabaude
Copy link
Contributor

@mitschabaude mitschabaude commented Nov 21, 2022

This PR

  • fixes the sudoku example
  • does a fairly large refactor of the sudoku example, so that it doesn't rely on this.sign(), uses Struct instead of CircuitValue, uses snarkyjs APIs directly instead of custom helper functions, and makes run.ts script use proofs (the tests use proofsEnabled: false)
  • during deployment, checks if the smart contract has init() decorated with @method. If yes, then we have to create a proof to deploy successfully; this is done in a separate step that's shown to the user, after building the transaction

Other small changes:

  • Add TS config at the top level so we have proper type feedback in the examples
  • Tweak eslint config to not show an error for the sudoku code

@mitschabaude mitschabaude changed the title Fix Sudoku and enable CLI to create ini() proofs Fix Sudoku and enable CLI to create init() proofs Nov 21, 2022
Copy link
Collaborator

@ymekuria ymekuria left a comment

Choose a reason for hiding this comment

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

I think this will will be easier for people to follow without the helper methods. I just had some minor comments but everything looks good.

.eslintrc.js Show resolved Hide resolved
examples/sudoku/ts/src/run.ts Show resolved Hide resolved
examples/sudoku/ts/src/sudoku.test.ts Outdated Show resolved Hide resolved
examples/sudoku/ts/src/sudoku.test.ts Outdated Show resolved Hide resolved
examples/sudoku/ts/src/sudoku.test.ts Outdated Show resolved Hide resolved
examples/sudoku/ts/src/sudoku.test.ts Outdated Show resolved Hide resolved
examples/sudoku/ts/src/sudoku.test.ts Outdated Show resolved Hide resolved
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.

2 participants