Skip to content

Conversation

@ultraviolet10
Copy link
Contributor

Description

This PR refactors the transport selection logic in the SemaphoreViem constructor.
The new implementation uses a standard if/else block to select the appropriate transport based on the provided options and network input.
Type of change: Refactor (code quality improvement, no functional changes)
Current behavior: Transport selection used a nested ternary, which was less readable and not lint-compliant.
New behavior: Uses a clear if/else block for transport selection, resolving the lint warning and improving code clarity.
Breaking change: No breaking changes; the logic and API remain the same.

Related Issue(s)

#1005

Other information

The new implementation is functionally equivalent to the previous one.
No changes to the public API or user-facing behavior.
No new warnings or errors are generated.
All tests pass locally.

Checklist

[x] I have performed a self-review of my code
[x] I have commented my code, particularly in hard-to-understand areas
[x] My changes generate no new warnings
[x] I have run yarn format and yarn lint without getting any errors
[x] I have added tests that prove my fix is effective or that my feature works
[x] New and existing unit tests pass locally with my changes

Copy link
Member

@vplasencia vplasencia left a comment

Choose a reason for hiding this comment

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

Great work! Thank you so much! 💯

@vplasencia vplasencia merged commit b6a7a98 into semaphore-protocol:main Jul 17, 2025
4 checks passed
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