Skip to content

Commit eb71828

Browse files
fix: NewIntegrationApp does not write default genesis to state (backport #21006) (#21008)
Co-authored-by: son trinh <[email protected]>
1 parent 7d0d59d commit eb71828

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
4242

4343
* [#20939](https://github.com/cosmos/cosmos-sdk/pull/20939) Fix collection reverse iterator to include `pagination.key` in the result.
4444
* (client/grpc) [#20969](https://github.com/cosmos/cosmos-sdk/pull/20969) Fix `node.NewQueryServer` method not setting `cfg`.
45+
* (testutil/integration) [#21006](https://github.com/cosmos/cosmos-sdk/pull/21006) Fix `NewIntegrationApp` method not writing default genesis to state
4546

4647
## [v0.50.8](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.8) - 2024-07-15
4748

tests/integration/distribution/keeper/msg_server_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@ func TestMsgWithdrawDelegatorReward(t *testing.T) {
276276
}
277277
height := f.app.LastBlockHeight()
278278

279-
_, err = f.distrKeeper.GetPreviousProposerConsAddr(f.sdkCtx)
280-
assert.Error(t, err, "previous proposer not set")
279+
proposerAddr, _ := f.distrKeeper.GetPreviousProposerConsAddr(f.sdkCtx)
280+
assert.Equal(t, proposerAddr.Empty(), true)
281281

282282
for _, tc := range testCases {
283283
tc := tc

testutil/integration/router.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ func NewIntegrationApp(
5959
bApp := baseapp.NewBaseApp(appName, logger, db, txConfig.TxDecoder(), baseapp.SetChainID(appName))
6060
bApp.MountKVStores(keys)
6161

62-
bApp.SetInitChainer(func(ctx sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) {
62+
bApp.SetInitChainer(func(_ sdk.Context, _ *cmtabcitypes.RequestInitChain) (*cmtabcitypes.ResponseInitChain, error) {
6363
for _, mod := range modules {
6464
if m, ok := mod.(module.HasGenesis); ok {
65-
m.InitGenesis(ctx, appCodec, m.DefaultGenesis(appCodec))
65+
m.InitGenesis(sdkCtx, appCodec, m.DefaultGenesis(appCodec))
6666
}
6767
}
6868

0 commit comments

Comments
 (0)