Skip to content

refactor!: Remove feature mock#261

Merged
jan-ferdinand merged 1 commit intomasterfrom
jfs/remove_mock
Jun 17, 2025
Merged

refactor!: Remove feature mock#261
jan-ferdinand merged 1 commit intomasterfrom
jfs/remove_mock

Conversation

@jan-ferdinand
Copy link
Copy Markdown
Member

@jan-ferdinand jan-ferdinand commented Jun 16, 2025

The so-called “MockMMR” is a historic artifact that is unused in direct dependencies. This PR turns it into a type that is accessible only from unit tests and remove the feature mock to slim down the public API.

Replace hashbrown::HashSet with std::collections::HashSet, which amounts to the same thing but allows removing the direct dependency on hashbrown.

Other changes, only relevant for developers of twenty-first:

  • rename the “MockMMR” to the more canonical “ArchivalMMR”.
  • reflect the internals more accurately by renaming the collection of all nodes from “leafs” to “nodes”
  • remove helper struct MyVec<_>
  • replace some helper functions with sane initialize functions
  • reduce visibility of some internal helper functions
  • rework documentation in some places

The so-called “MockMMR” is a historic artifact that is unused in direct
dependencies. Turn it into a type that is accessible only from unit
tests and remove the feature `mock` to slim down the public API.

Replace `hashbrown::HashSet` with `std::collections::HashSet`, which
amounts to the same thing but allows removing the direct dependency on
`hashbrown`.

Other changes, only relevant for developers of twenty-first:
- rename the “MockMMR” to the more canonical “ArchivalMMR”.
- reflect the internals more accurately by renaming the collection of
  all nodes from “leafs” to “nodes”
- remove helper struct `MyVec<_>`
- replace some helper functions with sane initialize functions
- reduce visibility of some internal helper functions
- rework documentation in some places
@coveralls
Copy link
Copy Markdown

Coverage Status

coverage: 97.885% (-0.05%) from 97.93%
when pulling 4b5000e on jfs/remove_mock
into c1d8b94 on master.

@jan-ferdinand jan-ferdinand merged commit 4b5000e into master Jun 17, 2025
6 checks passed
@jan-ferdinand jan-ferdinand deleted the jfs/remove_mock branch June 17, 2025 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants