Bounties-Network / Delphi

A simple mechanism for staking and claims
14 stars 4 forks source link

Add tests for and fix bugs in DelphiVoting.sol #4

Closed skmgoldin closed 6 years ago

skmgoldin commented 6 years ago

This PR adds test coverage for DelphiVoting.sol. In the course of writing the tests, three bugs were discovered. The bugs are fixed in https://github.com/ConsenSys/Delphi/commit/129259d547a8b35d433f3eaa74c8e30e17c41720, https://github.com/ConsenSys/Delphi/commit/9aa3ce9184ce097ce8abc630a9c3f1719986efb6, and https://github.com/ConsenSys/Delphi/commit/1ef4d6e0e2964d0df06406d263ed5c633f835fc1, the commit messages of which are self-explanatory.

https://github.com/ConsenSys/Delphi/commit/e36f1aad69592e70dc3172b65ccff8c80ec52bae updates the dependent files from the tcr repo and makes the deploy pipeline less brittle (but it's still not suitable for production deploys).

Make use of the convenience functions in utils.js to stay sane while writing DelphiVoting tests. If you need arbiters, add them to the TCR before running your tests like so: https://github.com/ConsenSys/Delphi/blob/89ac2201acb1d680352b074f025a6008d262b93c/test/js/DelphiVoting/commitVote.js#L16-L19