kaspanet / rusty-kaspa

Kaspa full-node reference implementation and related libraries in the Rust programming language
ISC License
491 stars 155 forks source link

Functions to derive and verify merkle tree witnesses #565

Closed ushinar closed 4 weeks ago

ushinar commented 2 months ago

Added the two functions alongside refactoring calc_merkle_root.

There are a few tests I used to verify that everything functions as planned - Remove those if they do not fit the norm, I am not sure what is our approach to testing in general.

There is a case for the leafRoute enum to function the other way around i.e. referring to the locus of the witness hash rather than the direction of the leaf. I chose what was easier to follow for me.

ushinar commented 4 weeks ago

Outdated. In within a week or so I will hopefully submit a pull request for the entire consensus side of KIP6