turbofish-org / merk

High-performance Merkle key/value store
Apache License 2.0
226 stars 36 forks source link

Merk::prove: &mut self -> &self #32

Closed mappum closed 4 years ago

mappum commented 4 years ago

Merk::prove and Merk::prove_unchecked take a &mut self receiver, which is unintuitive. The reason is that even though the tree structure isn't changed, the operations fetch nodes and cache them in memory. However, we should just use interior mutability to make this method more convenient to call.