From ce98d47133a9a4b3169fe87c43e548b2a71513ea Mon Sep 17 00:00:00 2001 From: anhductn2001 Date: Tue, 22 Aug 2023 15:36:59 +0700 Subject: [PATCH] channelID --- app/upgrades/v4_5_1/fork.go | 2 +- x/ratelimit/relay_test.go | 4 ++-- x/ratelimit/types/tx.pb.go | 4 ++-- x/transfermiddleware/keeper/keeper.go | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/upgrades/v4_5_1/fork.go b/app/upgrades/v4_5_1/fork.go index 008d6d2fd..5c2cf8a9f 100644 --- a/app/upgrades/v4_5_1/fork.go +++ b/app/upgrades/v4_5_1/fork.go @@ -20,7 +20,7 @@ func RemoveRateLimit(ctx sdk.Context, rlKeeper *rateLimitKeeper.Keeper) { rateLimits := rlKeeper.GetAllRateLimits(ctx) // Remove Rate limit for _, rateLimit := range rateLimits { - err := rlKeeper.RemoveRateLimit(ctx, rateLimit.Path.Denom, rateLimit.Path.ChannelId) + err := rlKeeper.RemoveRateLimit(ctx, rateLimit.Path.Denom, rateLimit.Path.ChannelID) if err != nil { panic(err) } diff --git a/x/ratelimit/relay_test.go b/x/ratelimit/relay_test.go index 95638e371..38817e94f 100644 --- a/x/ratelimit/relay_test.go +++ b/x/ratelimit/relay_test.go @@ -336,7 +336,7 @@ func (suite *RateLimitTestSuite) TestReceiveIBCTokenWithMinRateLimitAmount() { chainBRateLimitKeeper := suite.chainB.RateLimit() msgAddRateLimit := ratelimittypes.MsgAddRateLimit{ Denom: nativeDenom, - ChannelId: path.EndpointB.ChannelID, + ChannelID: path.EndpointB.ChannelID, MaxPercentSend: sdk.NewInt(5), // 5_000_000_000 < minRateLimitAmount(10_000_000_000) => RateLimit = 10_000_000_000 MaxPercentRecv: sdk.NewInt(5), // 5_000_000_000 < minRateLimitAmount(10_000_000_000) => RateLimit = 10_000_000_000 MinRateLimitAmount: sdk.NewInt(10_000_000_000), @@ -457,7 +457,7 @@ func (suite *RateLimitTestSuite) TestSendIBCTokenWithMinRateLimitAmount() { chainBRateLimitKeeper := suite.chainB.RateLimit() msgAddRateLimit := ratelimittypes.MsgAddRateLimit{ Denom: nativeDenom, - ChannelId: path.EndpointB.ChannelID, + ChannelID: path.EndpointB.ChannelID, MaxPercentSend: sdk.NewInt(5), // 5_000_000_000 < minRateLimitAmount(10_000_000_000) => RateLimit = 10_000_000_000 MaxPercentRecv: sdk.NewInt(5), // 5_000_000_000 < minRateLimitAmount(10_000_000_000) => RateLimit = 10_000_000_000 MinRateLimitAmount: sdk.NewInt(10_000_000_000), diff --git a/x/ratelimit/types/tx.pb.go b/x/ratelimit/types/tx.pb.go index f583652e3..c4e7f9920 100644 --- a/x/ratelimit/types/tx.pb.go +++ b/x/ratelimit/types/tx.pb.go @@ -35,7 +35,7 @@ type MsgAddRateLimit struct { // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ChannelID string `protobuf:"bytes,3,opt,name=channel_id,json=channelID,proto3" json:"channel_id,omitempty"` MaxPercentSend github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=max_percent_send,json=maxPercentSend,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_send"` MaxPercentRecv github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=max_percent_recv,json=maxPercentRecv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_recv"` MinRateLimitAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=min_rate_limit_amount,json=minRateLimitAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_rate_limit_amount"` @@ -144,7 +144,7 @@ type MsgUpdateRateLimit struct { // overwritten). Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty" yaml:"authority"` Denom string `protobuf:"bytes,2,opt,name=denom,proto3" json:"denom,omitempty"` - ChannelId string `protobuf:"bytes,3,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + ChannelID string `protobuf:"bytes,3,opt,name=channel_id,json=channelID,proto3" json:"channel_id,omitempty"` MaxPercentSend github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,4,opt,name=max_percent_send,json=maxPercentSend,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_send"` MaxPercentRecv github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,5,opt,name=max_percent_recv,json=maxPercentRecv,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"max_percent_recv"` MinRateLimitAmount github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,6,opt,name=min_rate_limit_amount,json=minRateLimitAmount,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"min_rate_limit_amount"` diff --git a/x/transfermiddleware/keeper/keeper.go b/x/transfermiddleware/keeper/keeper.go index 60d949d97..f3f8b1c41 100644 --- a/x/transfermiddleware/keeper/keeper.go +++ b/x/transfermiddleware/keeper/keeper.go @@ -203,8 +203,8 @@ func (keeper Keeper) GetNativeDenomByIBCDenomSecondaryIndex(ctx sdk.Context, ibc func (keeper Keeper) GetTotalEscrowedToken(ctx sdk.Context) (coins sdk.Coins) { keeper.IterateParaTokenInfos(ctx, func(index int64, info types.ParachainIBCTokenInfo) (stop bool) { - escrowIbcCoin := keeper.bankKeeper.GetBalance(ctx, transfertypes.GetEscrowAddress(transfertypes.PortID, info.ChannelId), info.IbcDenom) - escrowNativeCoin := keeper.bankKeeper.GetBalance(ctx, transfertypes.GetEscrowAddress(transfertypes.PortID, info.ChannelId), info.NativeDenom) + escrowIbcCoin := keeper.bankKeeper.GetBalance(ctx, transfertypes.GetEscrowAddress(transfertypes.PortID, info.ChannelID), info.IbcDenom) + escrowNativeCoin := keeper.bankKeeper.GetBalance(ctx, transfertypes.GetEscrowAddress(transfertypes.PortID, info.ChannelID), info.NativeDenom) coins = append(coins, escrowIbcCoin, escrowNativeCoin) return false })