-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add witness module #93
Add witness module #93
Conversation
81aef08
to
ad4b247
Compare
Ok, wow, the fuzzer found a bug |
Neat! Concept ACK. Though I imagine in the future this will become a weird corner of the language that is only really used by the web IDE. |
I moved most changes to #94. The fuzzer bug has to do with the witness module, which kind of lives inside the parse tree and kind of doesn't. |
We introduce a witness module that can be put anywhere inside the source file. Like in Rust, there can be at most one module of the same name. mod witness { const Alice: Signature = 0xabde...; const Bob: Signature = 0x1234...; } The witness module is optional and witness data can still be provided via JSON. The Simfony program parser ignores any witness modules. A separate parser parses the witness modules. Most lines of this commit are boilerplate that the witness module parser introduces.
ad4b247
to
c674d83
Compare
Use fmt::Display to print WitnessValues as a witness module. This can be parsed via ParseFromStr back into WitnessValues. Rename parse_witness_rtt to parse_witness_json_rtt to disambiguate the it from new the target parse_witness_module_rtt. Run cargo fmt inside the `fuzz` crate.
c674d83
to
e3ed903
Compare
I fixed the fuzzer. Writing witness data directly into the program is a huge feature for the IDE, but I agree that it feels kind of weird. Keeping the program parser separate from the witness parser will allow us to remove the feature if we no longer need 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.
ACK e3ed903 successfully ran local tests
Make witness JSON parsing via serde optional. Introduce witness modules as an alternative way to provide witness data. Witness modules are written directly inside the Simfony source code.