celestiaorg / smt

A Go library that implements a Sparse Merkle tree for a key-value map.
https://godoc.org/github.com/celestiaorg/smt
MIT License
138 stars 53 forks source link

DeleteForRoot is not right #49

Closed decoqt closed 3 years ago

decoqt commented 3 years ago

DeleteForRoot is not right, after DeleteForRoot, the value still can be retrieved. In fact, Delete method in MapStore is not called in DeleteForRoot

decoqt commented 3 years ago

The test pass because Delete method in SparseMerkleTree will set defaultValue to root, thus value cannot get from this empty root. This is not correct, root should not set when delete

liamsi commented 3 years ago

@yydfjt was this closed because there is no underlying issue that needs fixing?