Skip to content

Commit a7f635f

Browse files
committed
update rate-limiting module
1 parent 78f302b commit a7f635f

File tree

10 files changed

+2080
-462
lines changed

10 files changed

+2080
-462
lines changed

modules/rate-limiting/e2e/go.mod

Lines changed: 110 additions & 109 deletions
Large diffs are not rendered by default.

modules/rate-limiting/e2e/go.sum

Lines changed: 821 additions & 0 deletions
Large diffs are not rendered by default.

modules/rate-limiting/go.mod

Lines changed: 134 additions & 103 deletions
Large diffs are not rendered by default.

modules/rate-limiting/go.sum

Lines changed: 989 additions & 223 deletions
Large diffs are not rendered by default.

modules/rate-limiting/keeper/packet_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
sdkmath "cosmossdk.io/math"
1414

15-
tmbytes "github.com/cometbft/cometbft/libs/bytes"
15+
tmbytes "github.com/cometbft/cometbft/v2/libs/bytes"
1616

1717
transfertypes "github.com/cosmos/ibc-go/v10/modules/apps/transfer/types"
1818
channeltypes "github.com/cosmos/ibc-go/v10/modules/core/04-channel/types"

modules/rate-limiting/module.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
sdk "github.com/cosmos/cosmos-sdk/types"
2121
"github.com/cosmos/cosmos-sdk/types/module"
2222

23-
abci "github.com/cometbft/cometbft/abci/types"
23+
abci "github.com/cometbft/cometbft/v2/abci/types"
2424
)
2525

2626
var (

modules/rate-limiting/testing/simapp/app.go

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,21 @@ import (
1717
"github.com/rakyll/statik/fs"
1818
"github.com/spf13/cast"
1919

20+
"github.com/cosmos/cosmos-sdk/x/evidence"
21+
evidencekeeper "github.com/cosmos/cosmos-sdk/x/evidence/keeper"
22+
evidencetypes "github.com/cosmos/cosmos-sdk/x/evidence/types"
23+
"github.com/cosmos/cosmos-sdk/x/feegrant"
24+
feegrantkeeper "github.com/cosmos/cosmos-sdk/x/feegrant/keeper"
25+
feegrantmodule "github.com/cosmos/cosmos-sdk/x/feegrant/module"
26+
"github.com/cosmos/cosmos-sdk/x/upgrade"
27+
upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper"
28+
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
29+
2030
autocliv1 "cosmossdk.io/api/cosmos/autocli/v1"
2131
reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1"
2232
"cosmossdk.io/log"
2333
storetypes "cosmossdk.io/store/types"
24-
"cosmossdk.io/x/evidence"
25-
evidencekeeper "cosmossdk.io/x/evidence/keeper"
26-
evidencetypes "cosmossdk.io/x/evidence/types"
27-
"cosmossdk.io/x/feegrant"
28-
feegrantkeeper "cosmossdk.io/x/feegrant/keeper"
29-
feegrantmodule "cosmossdk.io/x/feegrant/module"
3034
"cosmossdk.io/x/tx/signing"
31-
"cosmossdk.io/x/upgrade"
32-
upgradekeeper "cosmossdk.io/x/upgrade/keeper"
33-
upgradetypes "cosmossdk.io/x/upgrade/types"
3435

3536
"github.com/cosmos/cosmos-sdk/baseapp"
3637
"github.com/cosmos/cosmos-sdk/client"
@@ -98,8 +99,8 @@ import (
9899
stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper"
99100
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
100101

101-
abci "github.com/cometbft/cometbft/abci/types"
102-
tmos "github.com/cometbft/cometbft/libs/os"
102+
abci "github.com/cometbft/cometbft/v2/abci/types"
103+
tmos "github.com/cometbft/cometbft/v2/libs/os"
103104

104105
"github.com/cosmos/ibc-go/modules/capability"
105106
capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper"
@@ -416,7 +417,6 @@ func NewSimApp(
416417
app.IBCKeeper = ibckeeper.NewKeeper(
417418
appCodec,
418419
runtime.NewKVStoreService(keys[ibcexported.StoreKey]),
419-
app.GetSubspace(ibcexported.ModuleName),
420420
app.UpgradeKeeper,
421421
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
422422
)
@@ -448,7 +448,7 @@ func NewSimApp(
448448

449449
app.GovKeeper = *govKeeper.SetHooks(
450450
govtypes.NewMultiGovHooks(
451-
// register the governance hooks
451+
// register the governance hooks
452452
),
453453
)
454454

@@ -474,9 +474,7 @@ func NewSimApp(
474474

475475
// Transfer Keeper
476476
app.TransferKeeper = ibctransferkeeper.NewKeeper(
477-
appCodec,
478-
runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
479-
app.GetSubspace(ibctransfertypes.ModuleName),
477+
appCodec, runtime.NewKVStoreService(keys[ibctransfertypes.StoreKey]),
480478
app.RatelimitKeeper, // ICS4Wrapper
481479
app.IBCKeeper.ChannelKeeper,
482480
app.MsgServiceRouter(),
@@ -658,6 +656,7 @@ func NewSimApp(
658656
// NOTE: upgrade module is required to be prioritized
659657
app.mm.SetOrderPreBlockers(
660658
upgradetypes.ModuleName,
659+
authtypes.ModuleName,
661660
)
662661

663662
app.mm.RegisterInvariants(app.CrisisKeeper)
@@ -744,7 +743,7 @@ func (app *SimApp) EndBlocker(ctx sdk.Context) (sdk.EndBlock, error) {
744743
}
745744

746745
// InitChainer application update at chain initialization
747-
func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*abci.ResponseInitChain, error) {
746+
func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.InitChainRequest) (*abci.InitChainResponse, error) {
748747
var genesisState GenesisState
749748
if err := json.Unmarshal(req.AppStateBytes, &genesisState); err != nil {
750749
panic(err)

modules/rate-limiting/testing/simapp/apptesting/test_helpers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ import (
44
app "github.com/cosmos/ibc-apps/modules/rate-limiting/v10/testing/simapp"
55
"github.com/stretchr/testify/suite"
66

7-
upgradetypes "cosmossdk.io/x/upgrade/types"
7+
upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types"
88

99
"github.com/cosmos/cosmos-sdk/baseapp"
1010
sdk "github.com/cosmos/cosmos-sdk/types"
1111

12-
"github.com/cometbft/cometbft/crypto/ed25519"
12+
"github.com/cometbft/cometbft/v2/crypto/ed25519"
1313
)
1414

1515
var TestChainId = "chain-0"

modules/rate-limiting/testing/simapp/simd/root.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ import (
2929
"github.com/cosmos/cosmos-sdk/x/crisis"
3030
genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli"
3131

32-
tmcfg "github.com/cometbft/cometbft/config"
33-
tmcli "github.com/cometbft/cometbft/libs/cli"
32+
tmcfg "github.com/cometbft/cometbft/v2/config"
33+
tmcli "github.com/cometbft/cometbft/v2/libs/cli"
3434
)
3535

3636
// NewRootCmd creates a new root command for simd. It is called once in the

modules/rate-limiting/testing/simapp/test_setup.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ import (
2121
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
2222
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
2323

24-
abci "github.com/cometbft/cometbft/abci/types"
25-
"github.com/cometbft/cometbft/crypto/secp256k1"
26-
tmtypes "github.com/cometbft/cometbft/types"
24+
abci "github.com/cometbft/cometbft/v2/abci/types"
25+
"github.com/cometbft/cometbft/v2/crypto/secp256k1"
26+
tmtypes "github.com/cometbft/cometbft/v2/types"
2727
)
2828

2929
const Bech32Prefix = "stride"
@@ -77,7 +77,7 @@ func InitTestingApp() *SimApp {
7777
}
7878

7979
_, err = app.InitChain(
80-
&abci.RequestInitChain{
80+
&abci.InitChainRequest{
8181
ConsensusParams: simtestutil.DefaultConsensusParams,
8282
AppStateBytes: stateBytes,
8383
},

0 commit comments

Comments
 (0)