-
Notifications
You must be signed in to change notification settings - Fork 12
Merging parables and sol-rs #40
Description
Parables is a project started to attempt and improve the experience in writing soldity tests in Rust against parity. In order to accomplish what we wanted, we ended up having to deviate quite a bit from how sol-rs did things.
Among these deviations, we've forked ethabi derive and made it part of the project so that we can quickly experiment on how to get an easier to use contract interface.
We've also adapted the internals of EvmTestClient into Evm to among other things make it easier to clone and use through references. Effectively sharing a mutable reference of Evm and passing it across threads was one of the pain points when we started expanding our test base (note that most methods of parables' Evm takes &self). We've also expanded the API a fair bit and tweaked it to make among other things make it easier to assert for failures while still taking things like gas costs into account.
A number of issues listed in this tracker are now supported in parables, like:
- use/include contract with a single step #13 - https://github.com/PrimaBlock/parables/blob/master/example/src/main.rs#L7
- make signing easy to do from sol-rs #16 - https://primablock.github.io/parables/07_accounts.html#signing-payloads
- show line where contract call failed #11 (this one was a doozy) - https://github.com/PrimaBlock/parables#state-dumping
- Add the line coverage reporting for tests #7 (partly) - https://github.com/PrimaBlock/parables/blob/master/example/src/main.rs#L244
Internally we've ported a fair amount of tests to parables, and have found it quite nice to work with. Dumping expression state is especially helpful to determine why a given expression fails. And having the ability to pin expected failures to a function and expression makes tests much less fragile.
So I'd like to start a dialogue here, since working together is generally more beneficial. Would you like to merge these projects? And if so, how should we do it?