EYBlockchain / timber

Construct a Merkle Tree database from Ethereum logs.
Other
67 stars 19 forks source link

fix: updateNodes now accepts integer values #19

Closed MirandaWood closed 4 years ago

MirandaWood commented 4 years ago

Fix: integer value leaves

Fixed a bug in which Timber expected all leaves from emitted events to be in hex form. Only presented itself when updateNodes was called.

Now, updateNodes checks whether the input leaf (here, nodeValueFull) is hex before truncating it. If it's not, it converts to hex using convertBase. We haven't noticed/needed a fix since most cases have leaves being emitted in 32 byte hex form, but now we have MiMC hashing over two curves using uints will be more common!

Tested with both Timber and external tests.

iAmMichaelConnor commented 4 years ago

Eventually, we should replace all the 'zkp-utils' stuff with the npm library we're building.

github-actions[bot] commented 4 years ago

:tada: This PR is included in version 3.0.2 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: