Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
satawatnack committed Feb 10, 2025
1 parent 68c2c55 commit 7d050b8
Show file tree
Hide file tree
Showing 11 changed files with 95 additions and 106 deletions.
4 changes: 2 additions & 2 deletions api/band/tunnel/v1beta1/params.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions api/band/tunnel/v1beta1/route.pulsar.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/keepers/keepers.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func NewAppKeeper(
runtime.ProvideCometInfoService(),
)

// If evidence needs to be handled for the app, set routes in router here and seal
// If evidence needs to be handled for the app, set routes in Router here and seal
appKeepers.EvidenceKeeper = *evidenceKeeper
// GlobalFeeKeeper
appKeepers.GlobalFeeKeeper = globalfeekeeper.NewKeeper(
Expand Down
4 changes: 2 additions & 2 deletions proto/band/tunnel/v1beta1/params.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ message Params {
// base_packet_fee is the base fee for each packet.
repeated cosmos.base.v1beta1.Coin base_packet_fee = 7
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// router_ibc_channel specifies the IBC channel used by the tunnel to communicate with the router chain.
// router_ibc_channel specifies the IBC channel used by the tunnel to communicate with the Router chain.
string router_ibc_channel = 8 [(gogoproto.customname) = "RouterIBCChannel"];
// router_integration_contract specifies the address of the router integration contract on the router chain
// router_integration_contract specifies the address of the Router integration contract on the Router chain
// that the tunnel module will interact with.
string router_integration_contract = 9 [(gogoproto.customname) = "RouterIntegrationContract"];
}
10 changes: 5 additions & 5 deletions proto/band/tunnel/v1beta1/route.proto
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,18 @@ message IBCHookPacketReceipt {
uint64 sequence = 1;
}

// RouterRoute is the type for a router route
// RouterRoute is the type for a Router route
message RouterRoute {
option (cosmos_proto.implements_interface) = "RouteI";

// destination_chain_id is the destination chain ID
string destination_chain_id = 3 [(gogoproto.customname) = "DestinationChainID"];
string destination_chain_id = 1 [(gogoproto.customname) = "DestinationChainID"];
// destination_contract_address is the destination contract address
string destination_contract_address = 4;
string destination_contract_address = 2;
// destination_gas_limit is the destination gas limit
uint64 destination_gas_limit = 5;
uint64 destination_gas_limit = 3;
// destination_gas_price is the destination gas price
uint64 destination_gas_price = 6;
uint64 destination_gas_price = 4;
}

// RouterPacketReceipt represents a receipt for a Router packet and implements the PacketReceiptI interface.
Expand Down
4 changes: 2 additions & 2 deletions x/tunnel/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ func GetTxCmdCreateIBCHookTunnel() *cobra.Command {
func GetTxCmdCreateRouterTunnel() *cobra.Command {
cmd := &cobra.Command{
Use: "router [destination-chain-id] [destination-contract-address] [destination-gas-limit] [destination-gas-price] [initial-deposit] [interval] [signalDeviations-json-file]",
Short: "Create a new router tunnel",
Short: "Create a new Router tunnel",
Args: cobra.ExactArgs(7),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down Expand Up @@ -361,7 +361,7 @@ func GetTxCmdUpdateIBCHookRoute() *cobra.Command {
func GetTxCmdUpdateRouterRoute() *cobra.Command {
cmd := &cobra.Command{
Use: "router [tunnel-id] [destination-chain-id] [destination-contract-address] [destination-gas-limit] [destination-gas-price]",
Short: "Update router route of a router tunnel",
Short: "Update Router route of a Router tunnel",
Args: cobra.ExactArgs(5),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
Expand Down
8 changes: 0 additions & 8 deletions x/tunnel/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,6 @@ func (k msgServer) CreateTunnel(
// isIBCRoute is true if the route is IBCRoute
var isIBCRoute bool

// get router ibc channel id
routerIBCChannel := k.GetParams(ctx).RouterIBCChannel

route, err := msg.GetRouteValue()
if err != nil {
return nil, err
Expand All @@ -72,11 +69,6 @@ func (k msgServer) CreateTunnel(
if !found {
return nil, types.ErrInvalidChannelID
}
case *types.RouterRoute:
_, found := k.channelKeeper.GetChannel(ctx, ibctransfertypes.PortID, routerIBCChannel)
if !found {
return nil, types.ErrInvalidChannelID
}
}

// add a new tunnel
Expand Down
2 changes: 1 addition & 1 deletion x/tunnel/types/memo_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package types

import "encoding/json"

// RouterReceiveBandData represents the payload of the router message.
// RouterReceiveBandData represents the payload of the Router message.
type RouterReceiveBandData struct {
DestChainID string `json:"dest_chain_id"`
DestContractAddress string `json:"dest_contract_address"`
Expand Down
20 changes: 9 additions & 11 deletions x/tunnel/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ import (
var (
// Each value below is the default value for each parameter when generating the default
// genesis file. See comments in types.proto for explanation for each parameter.
DefaultMinInterval = uint64(60)
DefaultMaxInterval = uint64(3600)
DefaultMinDeviationBPS = uint64(50)
DefaultMaxDeviationBPS = uint64(3000)
DefaultMinDeposit = sdk.NewCoins(sdk.NewInt64Coin("uband", 1_000_000_000))
DefaultMaxSignals = uint64(25)
DefaultBasePacketFee = sdk.NewCoins(sdk.NewInt64Coin("uband", 500))
DefaultRouterIBCChannel = "channel-0"
DefaultRouterIntegrationContract = "router17c2txg2px6vna8a6v4ql4eh4ruvprerhytxvwt2ugp4qr473pajsyj9pgm"
DefaultMinInterval = uint64(60)
DefaultMaxInterval = uint64(3600)
DefaultMinDeviationBPS = uint64(50)
DefaultMaxDeviationBPS = uint64(3000)
DefaultMinDeposit = sdk.NewCoins(sdk.NewInt64Coin("uband", 1_000_000_000))
DefaultMaxSignals = uint64(25)
DefaultBasePacketFee = sdk.NewCoins(sdk.NewInt64Coin("uband", 500))
)

// NewParams creates a new Params instance
Expand Down Expand Up @@ -57,8 +55,8 @@ func DefaultParams() Params {
DefaultMaxDeviationBPS,
DefaultMaxSignals,
DefaultBasePacketFee,
DefaultRouterIBCChannel,
DefaultRouterIntegrationContract,
"",
"",
)
}

Expand Down
4 changes: 2 additions & 2 deletions x/tunnel/types/params.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 7d050b8

Please sign in to comment.