You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
36800e2 test: Witness error paths (Christian Lewe)
b67a8d1 refactor: Remove unnecessary map_err (Christian Lewe)
2e1b7ac rename: ReusedWitness -> WitnessReused (Christian Lewe)
fc507fa feat: Add constructors to TypedValue (Christian Lewe)
52cbd3a test: Use witness data in example programs (Christian Lewe)
001e902 feat: Restore support for witness files (Christian Lewe)
f70e8d0 feat: Convert ConstructNode to WitnessNode (Christian Lewe)
b2e51f2 feat: Add ConstructNode (Christian Lewe)
8523e24 feat: Parse WitnessValues from JSON (Christian Lewe)
fa4c92f feat: Compute typed value from const expression (Christian Lewe)
b6e08e0 feat: Add witness values (Christian Lewe)
031beb0 feat: Create spans from strings (Christian Lewe)
e470543 refactor: Error (Christian Lewe)
52d75cc refactor: RichError::Display (Christian Lewe)
78d3510 feat: Parse values from strings (Christian Lewe)
Pull request description:
Add a parser for the new witness JSON format:
```json
{
"name": {
"value": "42",
"type": "u8"
}
}
```
First we use serde_json to parse the JSON file. Then, we parse the `type` field as a `ResolvedType`. Finally, we parse the `value` field as a const expression that can be evaluated at compile time to a value, namely the witness value. Const expressions enable us to write witness files in the same way we write Simfony programs.
Replace the reimplementation of `NamedConstructNode` with a simpler reimplementation of `ConstructNode` where witness nodes contain their name. Other nodes don't need to be named. This change is messy in terms of lines of code, but it should be quite mechanical.
Implement a conversion from `NamedConstructNode` to `WitnessNode`, which enables pruning. I haven't tested how well rust-simplicity prunes compiled Simfony programs. We might need to push a followup PR to fix issues if we find them, but there is little we can do on the Simfony side, in my estimation.
We could do with more unit tests, but I felt like pushing this now.
ACKs for top commit:
apoelstra:
ACK 36800e2
Tree-SHA512: ffe2b778d7c9c75dd547bd6b5038d424dd932f0ce1870be25065ab316cb5147df33582090410922d96eda100a5bc13cd9f294128c16a43b35d587fb5005a2639
0 commit comments