Skip to content

Commit

Permalink
Merge branch 'main' into bot/fix-typos
Browse files Browse the repository at this point in the history
  • Loading branch information
tac0turtle authored Apr 25, 2024
2 parents d35fee0 + b15732a commit 05432f5
Show file tree
Hide file tree
Showing 45 changed files with 375 additions and 127 deletions.
2 changes: 1 addition & 1 deletion baseapp/abci_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1812,7 +1812,7 @@ func TestABCI_PrepareProposal_VoteExtensions(t *testing.T) {
return nil, err
}

cp := ctx.ConsensusParams()
cp := ctx.ConsensusParams() // nolint:staticcheck // ignore linting error
extsEnabled := cp.Abci != nil && req.Height >= cp.Abci.VoteExtensionsEnableHeight && cp.Abci.VoteExtensionsEnableHeight != 0
if extsEnabled {
req.Txs = append(req.Txs, []byte("some-tx-that-does-something-from-votes"))
Expand Down
6 changes: 3 additions & 3 deletions baseapp/abci_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func ValidateVoteExtensions(
extCommit abci.ExtendedCommitInfo,
) error {
// Get values from context
cp := ctx.ConsensusParams()
cp := ctx.ConsensusParams() // nolint:staticcheck // ignore linting error
currentHeight := ctx.HeaderInfo().Height
chainID := ctx.HeaderInfo().ChainID
commitInfo := ctx.CometInfo().LastCommit
Expand Down Expand Up @@ -249,7 +249,7 @@ func (h *DefaultProposalHandler) SetTxSelector(ts TxSelector) {
func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHandler {
return func(ctx sdk.Context, req *abci.RequestPrepareProposal) (*abci.ResponsePrepareProposal, error) {
var maxBlockGas uint64
if b := ctx.ConsensusParams().Block; b != nil {
if b := ctx.ConsensusParams().Block; b != nil { // nolint:staticcheck // ignore linting error
maxBlockGas = uint64(b.MaxGas)
}

Expand Down Expand Up @@ -375,7 +375,7 @@ func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHan
var totalTxGas uint64

var maxBlockGas int64
if b := ctx.ConsensusParams().Block; b != nil {
if b := ctx.ConsensusParams().Block; b != nil { // nolint:staticcheck // ignore linting error
maxBlockGas = b.MaxGas
}

Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ replace (
cosmossdk.io/x/staking => ./x/staking
)

replace github.com/cosmos/iavl => github.com/cosmos/iavl v1.0.1 // TODO remove

// Below are the long-lived replace of the Cosmos SDK
replace (
// use cosmos fork of keyring
Expand Down
11 changes: 9 additions & 2 deletions orm/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ go 1.21

require (
cosmossdk.io/api v0.7.4
cosmossdk.io/core v0.11.0
cosmossdk.io/core v0.12.1-0.20231114100755-569e3ff6a0d7
cosmossdk.io/depinject v1.0.0-alpha.4
cosmossdk.io/errors v1.0.1
github.com/cosmos/cosmos-db v1.0.2
Expand All @@ -22,6 +22,7 @@ require (
)

require (
cosmossdk.io/log v1.3.1 // indirect
github.com/DataDog/zstd v1.5.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmatcuk/doublestar/v4 v4.6.1 // indirect
Expand All @@ -47,6 +48,8 @@ require (
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/linxGnu/grocksdb v1.8.14 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
Expand All @@ -55,6 +58,7 @@ require (
github.com/prometheus/common v0.53.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/rs/zerolog v1.32.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect
golang.org/x/net v0.24.0 // indirect
Expand All @@ -67,4 +71,7 @@ require (
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace cosmossdk.io/depinject => ../depinject
replace (
cosmossdk.io/core => ../core
cosmossdk.io/depinject => ../depinject
)
18 changes: 16 additions & 2 deletions orm/go.sum
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cosmossdk.io/api v0.7.4 h1:sPo8wKwCty1lht8kgL3J7YL1voJywP3YWuA5JKkBz30=
cosmossdk.io/api v0.7.4/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38=
cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo=
cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w=
cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0=
cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U=
cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI=
cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM=
github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ=
github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
Expand All @@ -29,6 +29,7 @@ github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwP
github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo=
github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs=
github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA=
github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA=
Expand Down Expand Up @@ -57,6 +58,7 @@ github.com/getsentry/sentry-go v0.27.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down Expand Up @@ -100,6 +102,12 @@ github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw=
github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ=
github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE=
github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU=
Expand Down Expand Up @@ -135,6 +143,9 @@ github.com/regen-network/gocuke v1.1.1/go.mod h1:Nl9EbhLmTzdLqb52fr/Fvf8LcoVuTjj
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8=
github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4=
github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0=
github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/spf13/cast v1.6.0 h1:GEiTHELF+vaR5dhz3VqZfFSzZjYbgeKDpBxQVS4GYJ0=
github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cAdo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down Expand Up @@ -192,7 +203,10 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o=
golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
Expand Down
4 changes: 2 additions & 2 deletions orm/model/ormdb/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type ModuleDB interface {
// func NewAppModule(keeper keeper.Keeper) AppModule {
// return AppModule{HasGenesis: keeper.GenesisHandler()}
// }
GenesisHandler() appmodule.HasGenesis // TODO should be appmodule.HasGenesisAuto with core v1
GenesisHandler() appmodule.HasGenesisAuto

private()
}
Expand Down Expand Up @@ -212,7 +212,7 @@ func (m moduleDB) GetTable(message proto.Message) ormtable.Table {
return m.tablesByName[message.ProtoReflect().Descriptor().FullName()]
}

func (m moduleDB) GenesisHandler() appmodule.HasGenesis { // TODO should be appmodule.HasGenesisAuto with core v1
func (m moduleDB) GenesisHandler() appmodule.HasGenesisAuto {
return appModuleGenesisWrapper{m}
}

Expand Down
10 changes: 7 additions & 3 deletions simapp/ante.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,17 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) {
return nil, errors.New("sign mode handler is required for ante builder")
}

if options.Environment.RouterService == nil {
return nil, errors.New("router service is required for ante builder")
}

anteDecorators := []sdk.AnteDecorator{
ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first
ante.NewSetUpContextDecorator(options.Environment), // outermost AnteDecorator. SetUpContext must be called first
circuitante.NewCircuitBreakerDecorator(options.CircuitKeeper),
ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker),
ante.NewValidateBasicDecorator(options.AccountKeeper.GetEnvironment()),
ante.NewValidateBasicDecorator(options.Environment),
ante.NewTxTimeoutHeightDecorator(),
ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, options.TxManager, options.AccountKeeper.GetEnvironment()),
ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, options.TxManager, options.Environment),
ante.NewValidateMemoDecorator(options.AccountKeeper),
ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper),
ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker),
Expand Down
9 changes: 6 additions & 3 deletions simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ var (
// capabilities aren't needed for testing.
type SimApp struct {
*baseapp.BaseApp
logger log.Logger
legacyAmino *codec.LegacyAmino
appCodec codec.Codec
txConfig client.TxConfig
Expand Down Expand Up @@ -273,6 +274,7 @@ func NewSimApp(

app := &SimApp{
BaseApp: bApp,
logger: logger,
legacyAmino: legacyAmino,
appCodec: appCodec,
txConfig: txConfig,
Expand Down Expand Up @@ -336,7 +338,7 @@ func NewSimApp(
app.txConfig = txConfig

app.StakingKeeper = stakingkeeper.NewKeeper(
appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), logger.With(log.ModuleKey, "x/staking")), app.AuthKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), signingCtx.ValidatorAddressCodec(), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), logger.With(log.ModuleKey, "x/staking"), runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), app.AuthKeeper, app.BankKeeper, authtypes.NewModuleAddress(govtypes.ModuleName).String(), signingCtx.ValidatorAddressCodec(), authcodec.NewBech32Codec(sdk.Bech32PrefixConsAddr),
)
app.MintKeeper = mintkeeper.NewKeeper(appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[minttypes.StoreKey]), logger.With(log.ModuleKey, "x/mint")), app.StakingKeeper, app.AuthKeeper, app.BankKeeper, authtypes.FeeCollectorName, authtypes.NewModuleAddress(govtypes.ModuleName).String())

Expand Down Expand Up @@ -378,7 +380,7 @@ func NewSimApp(
}
homePath := cast.ToString(appOpts.Get(flags.FlagHome))
// set the governance module account as the authority for conducting upgrades
app.UpgradeKeeper = upgradekeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), logger.With(log.ModuleKey, "x/upgrade")), skipUpgradeHeights, appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())
app.UpgradeKeeper = upgradekeeper.NewKeeper(runtime.NewEnvironment(runtime.NewKVStoreService(keys[upgradetypes.StoreKey]), logger.With(log.ModuleKey, "x/upgrade"), runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), skipUpgradeHeights, appCodec, homePath, app.BaseApp, authtypes.NewModuleAddress(govtypes.ModuleName).String())

// Register the proposal types
// Deprecated: Avoid adding new handlers, instead use the new proposal flow
Expand All @@ -405,7 +407,7 @@ func NewSimApp(

// create evidence keeper with router
evidenceKeeper := evidencekeeper.NewKeeper(
appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), logger.With(log.ModuleKey, "x/evidence")), app.StakingKeeper, app.SlashingKeeper, app.AuthKeeper.AddressCodec(),
appCodec, runtime.NewEnvironment(runtime.NewKVStoreService(keys[evidencetypes.StoreKey]), logger.With(log.ModuleKey, "x/evidence"), runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), app.StakingKeeper, app.SlashingKeeper, app.AuthKeeper.AddressCodec(),
)
// If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper
Expand Down Expand Up @@ -596,6 +598,7 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) {
anteHandler, err := NewAnteHandler(
HandlerOptions{
ante.HandlerOptions{
Environment: runtime.NewEnvironment(nil, app.logger, runtime.EnvWithRouterService(app.GRPCQueryRouter(), app.MsgServiceRouter())), // nil is set as the kvstoreservice to avoid module access
AccountAbstractionKeeper: app.AccountsKeeper,
AccountKeeper: app.AuthKeeper,
BankKeeper: app.BankKeeper,
Expand Down
1 change: 1 addition & 0 deletions simapp/app_di.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ func (app *SimApp) setCustomAnteHandler() {
SignModeHandler: app.txConfig.SignModeHandler(),
FeegrantKeeper: app.FeeGrantKeeper,
SigGasConsumer: ante.DefaultSigVerificationGasConsumer,
Environment: app.AuthKeeper.Environment,
},
&app.CircuitBreakerKeeper,
app.UnorderedTxManager,
Expand Down
1 change: 1 addition & 0 deletions simapp/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ func TestAppSimulationAfterImport(t *testing.T) {
}

func setupSimulationApp(t *testing.T, msg string) (simtypes.Config, dbm.DB, simtestutil.AppOptionsMap, *SimApp) {
t.Helper()
config := simcli.NewConfigFromFlags()
config.ChainID = SimAppChainID

Expand Down
9 changes: 0 additions & 9 deletions store/db/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,15 +106,6 @@ func TestPebbleDBSuite(t *testing.T) {
})
}

func TestRocksDBSuite(t *testing.T) {
db, err := NewRocksDB("test", t.TempDir())
require.NoError(t, err)

suite.Run(t, &DBTestSuite{
db: db,
})
}

func TestGoLevelDBSuite(t *testing.T) {
db, err := NewGoLevelDB("test", t.TempDir(), nil)
require.NoError(t, err)
Expand Down
20 changes: 20 additions & 0 deletions store/db/rocksdb_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//go:build rocksdb
// +build rocksdb

package db

import (
"testing"

"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
)

func TestRocksDBSuite(t *testing.T) {
db, err := NewRocksDB("test", t.TempDir())
require.NoError(t, err)

suite.Run(t, &DBTestSuite{
db: db,
})
}
4 changes: 1 addition & 3 deletions tests/integration/auth/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ func initFixture(t *testing.T) *fixture {
newCtx := sdk.NewContext(cms, true, logger)

router := baseapp.NewMsgServiceRouter()
router.SetInterfaceRegistry(cdc.InterfaceRegistry())
queryRouter := baseapp.NewGRPCQueryRouter()
queryRouter.SetInterfaceRegistry(cdc.InterfaceRegistry())

handler := directHandler{}
account := baseaccount.NewAccount("base", signing.NewHandlerMap(handler))
Expand Down Expand Up @@ -128,7 +126,7 @@ func initFixture(t *testing.T) *fixture {
accounts.ModuleName: accountsModule,
authtypes.ModuleName: authModule,
banktypes.ModuleName: bankModule,
})
}, router, queryRouter)

authtypes.RegisterInterfaces(cdc.InterfaceRegistry())
banktypes.RegisterInterfaces(cdc.InterfaceRegistry())
Expand Down
7 changes: 5 additions & 2 deletions tests/integration/bank/keeper/deterministic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import (
minttypes "cosmossdk.io/x/mint/types"
_ "cosmossdk.io/x/staking"

"github.com/cosmos/cosmos-sdk/baseapp"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
"github.com/cosmos/cosmos-sdk/runtime"
Expand Down Expand Up @@ -99,7 +100,6 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture {
accountKeeper.GetAuthority(): false,
}
bankKeeper := keeper.NewBaseKeeper(

runtime.NewEnvironment(runtime.NewKVStoreService(keys[banktypes.StoreKey]), log.NewNopLogger()),
cdc,
accountKeeper,
Expand All @@ -116,7 +116,10 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture {
map[string]appmodule.AppModule{
authtypes.ModuleName: authModule,
banktypes.ModuleName: bankModule,
})
},
baseapp.NewMsgServiceRouter(),
baseapp.NewGRPCQueryRouter(),
)

sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context())

Expand Down
13 changes: 11 additions & 2 deletions tests/integration/distribution/keeper/msg_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,15 @@ import (
stakingtestutil "cosmossdk.io/x/staking/testutil"
stakingtypes "cosmossdk.io/x/staking/types"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
addresscodec "github.com/cosmos/cosmos-sdk/codec/address"
codectestutil "github.com/cosmos/cosmos-sdk/codec/testutil"
"github.com/cosmos/cosmos-sdk/runtime"
"github.com/cosmos/cosmos-sdk/testutil/integration"
sdk "github.com/cosmos/cosmos-sdk/types"
moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil"
consensustypes "github.com/cosmos/cosmos-sdk/x/consensus/types"
)

var (
Expand Down Expand Up @@ -68,6 +70,7 @@ func initFixture(t *testing.T) *fixture {
t.Helper()
keys := storetypes.NewKVStoreKeys(
authtypes.StoreKey, banktypes.StoreKey, distrtypes.StoreKey, pooltypes.StoreKey, stakingtypes.StoreKey,
consensustypes.StoreKey,
)
encodingCfg := moduletestutil.MakeTestEncodingConfig(codectestutil.CodecOptions{}, auth.AppModule{}, bank.AppModule{})
cdc := encodingCfg.Codec
Expand Down Expand Up @@ -113,7 +116,10 @@ func initFixture(t *testing.T) *fixture {
authority.String(),
)

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
msgRouter := baseapp.NewMsgServiceRouter()
grpcRouter := baseapp.NewGRPCQueryRouter()

stakingKeeper := stakingkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[stakingtypes.StoreKey]), log.NewNopLogger(), runtime.EnvWithRouterService(grpcRouter, msgRouter)), accountKeeper, bankKeeper, authority.String(), addresscodec.NewBech32Codec(sdk.Bech32PrefixValAddr), addresscodec.NewBech32Codec(sdk.Bech32PrefixConsAddr))
require.NoError(t, stakingKeeper.Params.Set(newCtx, stakingtypes.DefaultParams()))

poolKeeper := poolkeeper.NewKeeper(cdc, runtime.NewEnvironment(runtime.NewKVStoreService(keys[pooltypes.StoreKey]), log.NewNopLogger()), accountKeeper, bankKeeper, stakingKeeper, authority.String())
Expand Down Expand Up @@ -156,7 +162,10 @@ func initFixture(t *testing.T) *fixture {
stakingtypes.ModuleName: stakingModule,
distrtypes.ModuleName: distrModule,
pooltypes.ModuleName: poolModule,
})
},
msgRouter,
grpcRouter,
)

sdkCtx := sdk.UnwrapSDKContext(integrationApp.Context())

Expand Down
Loading

0 comments on commit 05432f5

Please sign in to comment.