EYBlockchain / timber

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

feat: calculate root from frontier #71

Closed iAmMichaelConnor closed 1 year ago

iAmMichaelConnor commented 3 years ago

New feature: the ability to calculate a root from just a frontier and the corresponding right-most leafIndex of the tree (from the time the frontier was created).

Manual testing: docker-compose up Open Postman and import this repo's collection. There are requests for all of the below actions. Post a contract address. Insert a leaf. Update the tree. Copy the resulting frontier and leafIndex into a calculate-root-from-frontier GET request. You should get the same root as is given when you query the tree's metadata. Insert a leaf. Update the tree. Copy the resulting frontier and leafIndex into a calculate-root-from-frontier GET request. You should get the same root as is given when you query the tree's metadata. Etc.

No automated test written for this feature yet, due to time constraints.