Deal with ASTs produced by Waffle
asymmetric opened this issue · 1 comments
The JSON file produced by waffle is different from the one produced by dapp-build.
Among other things, the AST lacks attributes
and children
properties, resulting in this function's conditionals never being true, and therefore in this being undefined
.
Waffle uses the JSON API to talk to configure solc, whereas dapp-build uses command-line options.
The first question is: can waffle produce the same output as dapp-build?
If so, we don't need to do anything in klab.
If that doesn't work, there are a few solutions we can investigate:
- explicitly only support dapp-build type ASTs (not ideal clearly)
- support both types of ASTs (would likely require lots of code duplication)
- get dapp-build to produce the same AST as waffle
The last point would possibly mean having to use the JSON API in dapp-build. This has the benefit of allowing us to produce a storage layout map - but on the other hand dealing with a JSON file in dapp would be a major PITA.
Another thing to try is to teach waffle to produce klab compatible ASTs, but this is out of scope for klab.
Possibly relevant links
Why would json in dapp be such a pita