Skip to content
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

Open
wants to merge 330 commits into
base: master
Choose a base branch
from
Open

[Tunnel] init module #469

wants to merge 330 commits into from

Conversation

satawatnack
Copy link
Member

@satawatnack satawatnack commented Nov 14, 2024

Implementation details

Create Tunnel module

Please ensure the following requirements are met before submitting a pull request:

  • The pull request is targeted against the correct target branch
  • The pull request is linked to an issue with appropriate discussion and an accepted design OR is linked to a spec that describes the work.
  • The pull request includes a description of the implementation/work done in detail.
  • The pull request includes any and all appropriate unit/integration tests
  • You have added a relevant changelog entry to CHANGELOG_UNRELEASED.md
  • You have re-reviewed the files affected by the pull request (e.g. using the Files changed tab in the Github PR explorer)

x/tunnel/module.go Outdated Show resolved Hide resolved
x/tunnel/types/tss_route.go Outdated Show resolved Hide resolved
x/tunnel/types/params.go Outdated Show resolved Hide resolved
x/tunnel/types/params.go Outdated Show resolved Hide resolved
x/tunnel/types/packet_content.go Outdated Show resolved Hide resolved
@RogerKSI RogerKSI self-requested a review November 18, 2024 11:57
x/tunnel/client/cli/util_test.go Outdated Show resolved Hide resolved
x/tunnel/client/cli/util_test.go Outdated Show resolved Hide resolved
x/tunnel/keeper/genesis.go Outdated Show resolved Hide resolved
x/tunnel/keeper/genesis_test.go Outdated Show resolved Hide resolved
x/tunnel/keeper/grpc_query.go Show resolved Hide resolved
x/tunnel/keeper/keeper_packet.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_packet.go Outdated Show resolved Hide resolved
Copy link
Contributor

@RogerKSI RogerKSI left a 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.

x/tunnel/types/signal.go Outdated Show resolved Hide resolved
x/tunnel/types/params.go Outdated Show resolved Hide resolved
x/tunnel/types/params.go Outdated Show resolved Hide resolved
x/tunnel/types/genesis.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_tunnel.go Outdated Show resolved Hide resolved
x/tunnel/types/signal.go Outdated Show resolved Hide resolved
proto/band/tunnel/v1beta1/tunnel.proto Outdated Show resolved Hide resolved
x/tunnel/README.md Show resolved Hide resolved
x/tunnel/README.md Show resolved Hide resolved
x/tunnel/README.md Outdated Show resolved Hide resolved
proto/band/tunnel/v1beta1/genesis.proto Show resolved Hide resolved
proto/band/tunnel/v1beta1/tunnel.proto Outdated Show resolved Hide resolved
proto/band/tunnel/v1beta1/tx.proto Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_tunnel.go Outdated Show resolved Hide resolved
Copy link
Member

@taobun taobun left a 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/abci.go Outdated Show resolved Hide resolved
x/tunnel/types/packet.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_latest_prices.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_tunnel.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_tunnel.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_packet.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_packet.go Outdated Show resolved Hide resolved
x/tunnel/keeper/keeper_packet.go Outdated Show resolved Hide resolved
x/tunnel/client/cli/util.go Outdated Show resolved Hide resolved
x/tunnel/types/latest_prices.go Outdated Show resolved Hide resolved
x/tunnel/types/latest_prices.go Outdated Show resolved Hide resolved
Comment on lines 93 to 112
// 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
}
Copy link
Contributor

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?

Copy link
Member Author

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?

x/tunnel/README.md Show resolved Hide resolved
Copy link
Member

@taobun taobun left a 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?

@satawatnack
Copy link
Member Author

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!

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.

5 participants