Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: removes the
Tree
method from the NMT wrapper and introduces …
…the `ProveRange` API (#1438) ## Overview While reviewing the NMT wrapper implementation and attempting to write its specs, came across a contradiction in the wrapper's design. On one hand, the wrapper is intended to encapsulate an instance of NMT and re-define/modify some of its APIs, specifically the [`Push`](https://github.com/celestiaorg/celestia-app/blob/6d27b78aa64a749a808e84ea682352b8b551fbd7/pkg/wrapper/nmt_wrapper.go#L80) method. On the other hand, the wrapper also exposes the [`Tree()`](https://github.com/celestiaorg/celestia-app/blob/6d27b78aa64a749a808e84ea682352b8b551fbd7/pkg/wrapper/nmt_wrapper.go#L112) method, which returns a pointer to the underlying NMT tree and thus allows direct access to the tree and enables arbitrary manipulation of the underlying tree outside of the intended control of the wrapper. For instance, one can bypass the NMT wrapper `Push` method and directly call the `Push` method of the underlying tree using `.Tree().Push()`. This not only widens the error surface but also violates the initial objective of the wrapper. To address this issue, the `Tree()` API has been removed, and all necessary methods of the underlying NMT are now exposed through the wrapper directly. ## Checklist - [x] New and updated code has appropriate documentation - [x] New and updated code has new and/or updated testing - [x] Required CI checks are passing - [x] Visual proof for any user facing features like CLI or documentation updates - [x] Linked issues closed with keywords
- Loading branch information