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: candiff accepts unary tuples as default #90

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewhammer
Copy link
Contributor

The candid values saved bydfx via didc were not accepted by candiff to diff, because of some mismatch of input being a tuple versus a (bare) un-tupled value.

This PR fixes this issue by changing the default behavior:

  • introduces an unimplemented flag for accepted bare values (the old default).
  • the new default matches what didc produces.

We can implement the old behavior when it blocks something. The missing code path traps as unimplemented.

Copy link
Contributor

@chenyan-dfinity chenyan-dfinity left a comment

Choose a reason for hiding this comment

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

btw, the CLI currently has a lot of code for handling parsing errors, which is not necessary. See https://github.com/dfinity/candid/blob/master/tools/didc/src/main.rs#L50. StructOpt will the handle the error automatically if you say the input expects IDLArgs instead of String

@matthewhammer
Copy link
Contributor Author

Thanks. Will fix the failing tests (tomorrow) before merging, obviously. I forgot to run cargo test locally first.

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.

None yet

2 participants