andytudhope / Recollections

A description of how to curate information optimally in the absence of a central authority
Mozilla Public License 2.0
20 stars 6 forks source link

Extend barebones to test to cover as many cases as we can #14

Open andytudhope opened 5 years ago

andytudhope commented 5 years ago

Working off this commit: https://github.com/andytudhope/Recollections/commit/68c32cee57d104d4924a793c593bd38ab84cac22

Add any and all test cases you can think of. We need to test everything in this contract as thoroughly as possible: whether the rate, available, votes_minted and effective_balance are what we expect at all times, whether SNT goes to the correct place (either the contract for upvotes or the developer for downvotes), whether the ceiling functions as intended, whether all the asserts work as intended and so on.

@jacqueswww has recommended https://hypothesis.works

The main reasons for testing in python and not javascript, to put it bluntly, are:

  1. Floating point BS in JS
  2. Readability
jacqueswww commented 5 years ago

Uniswap has a good view of how to setup a good pytest test suite: https://github.com/Uniswap/contracts-vyper/tree/master/tests

vyomshm commented 5 years ago

@andytudhope Is someone working on this?

If not, I'd like to take this on ;).

andytudhope commented 5 years ago

Yeah, let's maybe just hold off here until next week. Hopefully we've solved the curve mathematics by then and can test properly....