Skip to content

Commit e59fd97

Browse files
DeshErBojhaagjermundgarabamconcatAdityaSripal
committed
chore: Refactor code (#8442)
Co-authored-by: Gjermund Garaba <gjermund@garaba.net> Co-authored-by: mconcat <monoidconcat@gmail.com> Co-authored-by: Aditya <14364734+AdityaSripal@users.noreply.github.com>
1 parent 56f1bff commit e59fd97

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+774
-2000
lines changed

modules/apps/packet-forward-middleware/keeper/keeper.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,16 @@ func (k *Keeper) SetTransferKeeper(transferKeeper types.TransferKeeper) {
7474
k.transferKeeper = transferKeeper
7575
}
7676

77+
// SetICS4Wrapper sets the ICS4 Wrapper to pass packets downstream.
78+
func (k *Keeper) SetICS4Wrapper(wrapper porttypes.ICS4Wrapper) {
79+
k.ics4Wrapper = wrapper
80+
}
81+
82+
// ICS4Wrapper gets the ICS4 Wrapper for PFM.
83+
func (k *Keeper) ICS4Wrapper() porttypes.ICS4Wrapper {
84+
return k.ics4Wrapper
85+
}
86+
7787
// Logger returns a module-specific logger.
7888
func (*Keeper) Logger(ctx sdk.Context) log.Logger {
7989
return ctx.Logger().With("module", "x/"+ibcexported.ModuleName+"-"+types.ModuleName)

modules/apps/rate-limiting/client/cli/query.go

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ import (
55
"fmt"
66
"strings"
77

8-
"github.com/cosmos/ibc-go/v10/modules/apps/rate-limiting/types"
98
"github.com/spf13/cobra"
109

1110
"github.com/cosmos/cosmos-sdk/client"
1211
"github.com/cosmos/cosmos-sdk/client/flags"
1312
"github.com/cosmos/cosmos-sdk/version"
13+
14+
"github.com/cosmos/ibc-go/v10/modules/apps/rate-limiting/types"
1415
)
1516

1617
const (
@@ -31,9 +32,9 @@ func GetQueryCmd() *cobra.Command {
3132
cmd.AddCommand(
3233
GetCmdQueryRateLimit(),
3334
GetCmdQueryAllRateLimits(),
34-
GetCmdQueryRateLimitsByChainId(),
35-
GetCmdQueryAllBlacklistedDenoms(), // Add Blacklisted Denoms query
36-
GetCmdQueryAllWhitelistedAddresses(), // Add Whitelisted Addresses query
35+
GetCmdQueryRateLimitsByChainID(),
36+
GetCmdQueryAllBlacklistedDenoms(),
37+
GetCmdQueryAllWhitelistedAddresses(),
3738
// TODO: Add GetCmdQueryParams if needed
3839
)
3940
return cmd
@@ -57,7 +58,7 @@ Example:
5758
),
5859
Args: cobra.ExactArgs(1),
5960
RunE: func(cmd *cobra.Command, args []string) error {
60-
channelOrClientId := args[0]
61+
channelOrClientID := args[0]
6162
denom, err := cmd.Flags().GetString(FlagDenom)
6263
if err != nil {
6364
return err
@@ -71,10 +72,10 @@ Example:
7172

7273
if denom == "" {
7374
// Query all rate limits for the channel/client ID if denom is not specified
74-
req := &types.QueryRateLimitsByChannelOrClientIdRequest{
75-
ChannelOrClientId: channelOrClientId,
75+
req := &types.QueryRateLimitsByChannelOrClientIDRequest{
76+
ChannelOrClientId: channelOrClientID,
7677
}
77-
res, err := queryClient.RateLimitsByChannelOrClientId(context.Background(), req)
78+
res, err := queryClient.RateLimitsByChannelOrClientID(context.Background(), req)
7879
if err != nil {
7980
return err
8081
}
@@ -85,7 +86,7 @@ Example:
8586
// Query specific rate limit if denom is provided
8687
req := &types.QueryRateLimitRequest{
8788
Denom: denom,
88-
ChannelOrClientId: channelOrClientId,
89+
ChannelOrClientId: channelOrClientID,
8990
}
9091
res, err := queryClient.RateLimit(context.Background(), req)
9192
if err != nil {
@@ -130,26 +131,26 @@ func GetCmdQueryAllRateLimits() *cobra.Command {
130131
return cmd
131132
}
132133

133-
// GetCmdQueryRateLimitsByChainId return all rate limits that exist between this chain
134+
// GetCmdQueryRateLimitsByChainID return all rate limits that exist between this chain
134135
// and the specified ChainId
135-
func GetCmdQueryRateLimitsByChainId() *cobra.Command {
136+
func GetCmdQueryRateLimitsByChainID() *cobra.Command {
136137
cmd := &cobra.Command{
137138
Use: "rate-limits-by-chain [chain-id]",
138139
Short: "Query all rate limits associated with the channels/clients connecting to the given ChainID",
139140
Args: cobra.ExactArgs(1),
140141
RunE: func(cmd *cobra.Command, args []string) error {
141-
chainId := args[0]
142+
chainID := args[0]
142143

143144
clientCtx, err := client.GetClientQueryContext(cmd)
144145
if err != nil {
145146
return err
146147
}
147148
queryClient := types.NewQueryClient(clientCtx)
148149

149-
req := &types.QueryRateLimitsByChainIdRequest{
150-
ChainId: chainId,
150+
req := &types.QueryRateLimitsByChainIDRequest{
151+
ChainId: chainID,
151152
}
152-
res, err := queryClient.RateLimitsByChainId(context.Background(), req)
153+
res, err := queryClient.RateLimitsByChainID(context.Background(), req)
153154
if err != nil {
154155
return err
155156
}
@@ -215,4 +216,4 @@ func GetCmdQueryAllWhitelistedAddresses() *cobra.Command {
215216

216217
flags.AddQueryFlagsToCmd(cmd)
217218
return cmd
218-
}
219+
}

modules/apps/rate-limiting/client/cli/tx.go

Lines changed: 0 additions & 71 deletions
This file was deleted.

0 commit comments

Comments
 (0)