fix(sdk): resolve private-interfaces lint on verify_message_header#146
Merged
Conversation
The default method `verify_message_header` on the public trait `AlephMessageClient` returned a future over the private `VerifyMessageError` enum, triggering clippy's `private-interfaces` and `private-bounds` lints under `-D warnings`. Extract it to a module-private free function alongside the existing `build_verified` helper. `VerifyMessageError` is documented as an internal error type and the method was only reachable via the trait's other default methods; moving it out keeps the error encapsulated without changing the public API.
foxpatch-aleph
approved these changes
Apr 17, 2026
foxpatch-aleph
left a comment
There was a problem hiding this comment.
This is a clean refactoring that correctly resolves the clippy private-interfaces lint. The change extracts verify_message_header from a trait method to a module-private free function, keeping the internal VerifyMessageError type private as intended. The logic is preserved exactly, with no public API changes. Both call sites (verify_message trait method and AlephClient::get_messages_and_verify) correctly use the new free function signature.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AlephMessageClient::verify_message_headeris a default trait method whose return type references the privateVerifyMessageErrorenum. Under-D warnings, clippy'sprivate-interfacesandprivate-boundslints fire, failing CI.build_verifiedhelper.VerifyMessageErroris already documented as an internal error type — keeping it private matches the intent.verify_message) and theAlephClientimpl ofget_messages_and_verify; both call sites now use the free function. No public API change.Test plan
just formatjust check-typing(runscargo clippy --all-targets --all-features -- -D warnings)