Skip to content

Commit

Permalink
simapp: avoid adding the mock client to AllowedClients if "*" is al…
Browse files Browse the repository at this point in the history
…ready specified

Signed-off-by: Masanori Yoshida <[email protected]>
  • Loading branch information
siburu committed Apr 9, 2024
1 parent a6d8512 commit e08e7fe
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/chains/tendermint/simapp/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -852,9 +852,16 @@ func (app *SimApp) InitChainer(ctx sdk.Context, req *abci.RequestInitChain) (*ab
panic(err)
}

ibcGenesisState := ibctypes.DefaultGenesisState()
ibcGenesisState.ClientGenesis.Params.AllowedClients = append(ibcGenesisState.ClientGenesis.Params.AllowedClients, mockclienttypes.Mock)
genesisState[ibc.AppModule{}.Name()] = app.appCodec.MustMarshalJSON(ibcGenesisState)
{
var ibcGenesisState ibctypes.GenesisState
app.appCodec.MustUnmarshalJSON(genesisState[ibcexported.ModuleName], &ibcGenesisState)
if !ibcGenesisState.ClientGenesis.Params.IsAllowedClient(mockclienttypes.Mock) {
ibcGenesisState.ClientGenesis.Params.AllowedClients = append(
ibcGenesisState.ClientGenesis.Params.AllowedClients,
mockclienttypes.Mock)
genesisState[ibcexported.ModuleName] = app.appCodec.MustMarshalJSON(&ibcGenesisState)
}
}

if err := app.UpgradeKeeper.SetModuleVersionMap(ctx, app.ModuleManager.GetVersionMap()); err != nil {
panic(err)
Expand Down

0 comments on commit e08e7fe

Please sign in to comment.