-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: local setup relayer validating grpc url #156
Conversation
WalkthroughThis pull request introduces a new test function, Changes
Sequence Diagram(s)sequenceDiagram
participant T as TestValidateURLWithPort
participant V as ValidateURLWithPort
participant A as require/assert
T->>V: Invoke validation with test URL
V-->>T: Return validation result (error or success)
T->>A: Assert expected outcome
sequenceDiagram
participant CL as ConfigLoader
participant C as defaultL2ConfigLocal
participant V as ValidateURLWithPort
CL->>C: Load l2.grpc_address configuration
C->>V: Validate GRPC address URL with port
V-->>C: Return validation outcome
CL->>C: Proceed based on validation result
Possibly related PRs
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🔇 Additional comments (2)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
common/validate_test.go (1)
168-218
: Well-structured test for ValidateURLWithPort function.This test comprehensively covers the essential validation cases:
- Valid URLs with ports
- URLs missing ports
- URLs with invalid port values (too high or zero)
The use of
require
package is good as it provides clearer error messages and stops on first failure.For consistency with other tests in this file, consider gradually migrating the older test functions to use the
require
package instead of manual error checks witht.Errorf
.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
common/validate_test.go
(2 hunks)models/relayer/init.go
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Run Integration Tests on Ubuntu
🔇 Additional comments (2)
models/relayer/init.go (1)
37-37
: Good change ensuring gRPC URL always has a port.The update from
ValidateURL
toValidateURLWithPort
ensures that gRPC addresses will always include a port number, which is required for proper gRPC communication. This change makes the validation consistent withdefaultL2ConfigManual
which already usesValidateURLWithPort
on line 44.common/validate_test.go (1)
6-7
: Added import properly positioned with a blank line.Good practice to group imports with blank lines.
Description
Closes: #XXXX
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow-up issues.
I have...
!
in the type prefix if API or client breaking changeReviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
Summary by CodeRabbit