From bdda21f2f98f42d9dd67f15ac0ee4438b94d4294 Mon Sep 17 00:00:00 2001 From: Julien Robert Date: Thu, 19 Sep 2024 12:36:09 +0200 Subject: [PATCH] feat(testutil/integration): allow to pass baseapp options (#21816) --- CHANGELOG.md | 3 ++- testutil/integration/router.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d7602c02fb0..ffb15bee3b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,8 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i ### Improvements * (genutil) [#21701](https://github.com/cosmos/cosmos-sdk/pull/21701) Improved error messages for genesis validation. -* (sims)[#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules +* (sims) [#21613](https://github.com/cosmos/cosmos-sdk/pull/21613) Add sims2 framework and factory methods for simpler message factories in modules +* (testutil/integration) [#21816](https://github.com/cosmos/cosmos-sdk/pull/21816) Allow to pass baseapp options in `NewIntegrationApp`. ### Bug Fixes diff --git a/testutil/integration/router.go b/testutil/integration/router.go index f2427f02fd6e..07bbe3d4c206 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -55,6 +55,7 @@ func NewIntegrationApp( modules map[string]appmodule.AppModule, msgRouter *baseapp.MsgServiceRouter, grpcRouter *baseapp.GRPCQueryRouter, + baseAppOptions ...func(*baseapp.BaseApp), ) *App { db := coretesting.NewMemDB() @@ -63,7 +64,7 @@ func NewIntegrationApp( moduleManager.RegisterInterfaces(interfaceRegistry) txConfig := authtx.NewTxConfig(codec.NewProtoCodec(interfaceRegistry), addressCodec, validatorCodec, authtx.DefaultSignModes) - bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName)) + bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), append(baseAppOptions, baseapp.SetChainID(appName))...) bApp.MountKVStores(keys) bApp.SetInitChainer(func(_ sdk.Context, _ *cmtabcitypes.InitChainRequest) (*cmtabcitypes.InitChainResponse, error) {