ArcPay / arcpay-server

1 stars 0 forks source link

add pre-image table with merkle tree #5

Closed 0xbok closed 1 year ago

0xbok commented 1 year ago

This PR updates the merkle tree library to optionally take a pre-image of leaves. It updates our trait implementations to create a pre-image table and new functions to update and read this new table.

Had to update pmtree dependency with this commit: https://github.com/0xbok/pmtree/commit/9f8605d948bc56b50a0ba3755e6ef0b728f448ff

It adds an optional pre-image parameter and introduces two new get_pre_image() and put_with_pre_image() methods on Database trait. I found this to be the cleanest way to integrate pre-images.

Next PR will integrate a rust formatter for an easier time with editing.