-
Notifications
You must be signed in to change notification settings - Fork 44
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
[Tunnel] init module #469
base: master
Are you sure you want to change the base?
[Tunnel] init module #469
Conversation
[Tunnel] fix produce packet
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.
overall logic looks good to me now. just some cleanup and minor changes. please help update.
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.
Minor comments overall looks ok
x/tunnel/types/tunnel.go
Outdated
// Validate validates the total fees | ||
func (tf TotalFees) Validate() error { | ||
if !tf.TotalPacketFee.IsValid() { | ||
return fmt.Errorf("invalid total packet fee: %s", tf.TotalPacketFee) | ||
} | ||
return nil | ||
} | ||
|
||
// ValidateInterval validates the interval. | ||
func ValidateInterval(interval uint64, params Params) error { | ||
if interval < params.MinInterval || interval > params.MaxInterval { | ||
return ErrIntervalOutOfRange.Wrapf( | ||
"max %d, min %d, got %d", | ||
params.MaxInterval, | ||
params.MinInterval, | ||
interval, | ||
) | ||
} | ||
return nil | ||
} |
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.
these functions should not be here?
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.
any suggest on where should I put ValidateInterval?
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.
Should we add method GetTunnelRoute
or GetRouteValue
on Tunnel
struct? that make tunnel user don't need to try get cache value and cast to interface?
Done! |
Implementation details
Create Tunnel module
Please ensure the following requirements are met before submitting a pull request:
CHANGELOG_UNRELEASED.md
Files changed
tab in the Github PR explorer)