Skip to content

fix(sdk): resolve private-interfaces lint on verify_message_header#146

Merged
odesenfans merged 1 commit into
mainfrom
od/fix-clippy
Apr 17, 2026
Merged

fix(sdk): resolve private-interfaces lint on verify_message_header#146
odesenfans merged 1 commit into
mainfrom
od/fix-clippy

Conversation

@odesenfans
Copy link
Copy Markdown
Contributor

Summary

  • AlephMessageClient::verify_message_header is a default trait method whose return type references the private VerifyMessageError enum. Under -D warnings, clippy's private-interfaces and private-bounds lints fire, failing CI.
  • Extract it to a module-private free function next to the existing build_verified helper. VerifyMessageError is already documented as an internal error type — keeping it private matches the intent.
  • The method was only reachable via the trait's other default methods (verify_message) and the AlephClient impl of get_messages_and_verify; both call sites now use the free function. No public API change.

Test plan

  • just format
  • just check-typing (runs cargo clippy --all-targets --all-features -- -D warnings)

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.
Copy link
Copy Markdown

@foxpatch-aleph foxpatch-aleph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@odesenfans odesenfans merged commit ec12658 into main Apr 17, 2026
9 checks passed
@odesenfans odesenfans deleted the od/fix-clippy branch April 17, 2026 20:55
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.

2 participants