@@ -17,6 +17,7 @@ import (
17
17
"github.com/rakyll/statik/fs"
18
18
19
19
abci "github.com/tendermint/tendermint/abci/types"
20
+ tmjson "github.com/tendermint/tendermint/libs/json"
20
21
"github.com/tendermint/tendermint/libs/log"
21
22
tmos "github.com/tendermint/tendermint/libs/os"
22
23
dbm "github.com/tendermint/tm-db"
@@ -610,43 +611,15 @@ func (app *GaiaApp) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.R
610
611
return app .mm .EndBlock (ctx , req )
611
612
}
612
613
613
- func updateTransferPort (gs GenesisState , reservedPort , newPort string ) error {
614
- var transferGenesis ibctransfertypes.GenesisState
615
- if err := json .Unmarshal (gs [ibctransfertypes .ModuleName ], & transferGenesis ); err != nil {
616
- return err
617
- }
618
- if len (transferGenesis .PortId ) > 0 && transferGenesis .PortId != reservedPort {
619
- // Already not the reserved port name.
620
- return nil
621
- }
622
- // Change the listening IBC port to avoid conflict.
623
- transferGenesis .PortId = newPort
624
- transferGenesisBytes , err := json .Marshal (transferGenesis )
625
- if err != nil {
626
- return err
627
- }
628
- gs [ibctransfertypes .ModuleName ] = transferGenesisBytes
629
- return nil
630
- }
631
-
632
614
// InitChainer application update at chain initialization
633
615
func (app * GaiaApp ) InitChainer (ctx sdk.Context , req abci.RequestInitChain ) abci.ResponseInitChain {
634
616
var genesisState GenesisState
635
- if err := json .Unmarshal (req .AppStateBytes , & genesisState ); err != nil {
636
- panic (err )
637
- }
638
- if err := updateTransferPort (genesisState , "transfer" , "cosmos-transfer" ); err != nil {
617
+ if err := tmjson .Unmarshal (req .AppStateBytes , & genesisState ); err != nil {
639
618
panic (err )
640
619
}
641
620
app .UpgradeKeeper .SetModuleVersionMap (ctx , app .mm .GetVersionMap ())
642
621
res := app .mm .InitGenesis (ctx , app .appCodec , genesisState )
643
622
644
- // Set Historical infos in InitChain to ignore genesis params
645
- // This is needed for IBC connections not to time out easily
646
- stakingParams := app .StakingKeeper .GetParams (ctx )
647
- stakingParams .HistoricalEntries = 10000
648
- app .StakingKeeper .SetParams (ctx , stakingParams )
649
-
650
623
// Agoric: report the genesis time explicitly.
651
624
genTime := req .GetTime ()
652
625
if genTime .After (time .Now ()) {
0 commit comments