f-o-a-m / purescript-web3

a purescript library for the web3 api
Apache License 2.0
127 stars 24 forks source link

Filters trail by #125

Closed martyall closed 5 years ago

martyall commented 5 years ago

This PR introduces the following (breaking) changes

  1. Remove Pending and Earliest from ChainCursor constructors. For Earliest this is not a big deal, it should have never been there. It's just some cute replacement for the 0 block number, and it encourages "more than one way to do something" which adds no value. For Pending, we never had correct behavior in the first place. For one thing, the coroutines were never set up for that. Another problem is that for pending blocks half of the fields in the Change type (e.g. blockNumber`) are null and would fail to parse anyway. See here. I would propose that we put it back when we know how to do it right.

  2. Adds the trailBy as a event option. This is similar to hs-web3. You can say that you would like to always trail by a certain number of blocks once you've "caught up"