Skip to content

Commit 7deb009

Browse files
committed
Adjusted the code block to keep the legacy disable for sync consensus, added new block for re-enabling of IBCs
1 parent 54c0b9c commit 7deb009

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

app/app.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ func (app *TerraApp) Name() string { return app.BaseApp.Name() }
587587

588588
// BeginBlocker application updates every begin block
589589
func (app *TerraApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
590-
if ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() == core.SwapEnableForkHeight { // Make min spread to one to disable swap
590+
if ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() == core.SwapDisableForkHeight { // Make min spread to one to disable swap
591591
params := app.MarketKeeper.GetParams(ctx)
592592
params.MinStabilitySpread = sdk.OneDec()
593593
app.MarketKeeper.SetParams(ctx, params)
@@ -604,6 +604,23 @@ func (app *TerraApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) a
604604
panic(fmt.Sprintf("%s not found", channelID))
605605
}
606606

607+
channel.State = ibcchanneltypes.CLOSED
608+
app.IBCKeeper.ChannelKeeper.SetChannel(ctx, ibctransfertypes.PortID, channelID, channel)
609+
}
610+
}
611+
if ctx.ChainID() == core.ColumbusChainID && ctx.BlockHeight() == core.SwapEnableForkHeight { // Re-enable IBCs
612+
// Enable IBC Channels
613+
channelIDs := []string{
614+
"channel-1", // Osmosis
615+
"channel-49", // Crescent
616+
"channel-20", // Juno
617+
}
618+
for _, channelID := range channelIDs {
619+
channel, found := app.IBCKeeper.ChannelKeeper.GetChannel(ctx, ibctransfertypes.PortID, channelID)
620+
if !found {
621+
panic(fmt.Sprintf("%s not found", channelID))
622+
}
623+
607624
channel.State = ibcchanneltypes.OPEN
608625
app.IBCKeeper.ChannelKeeper.SetChannel(ctx, ibctransfertypes.PortID, channelID, channel)
609626
}

0 commit comments

Comments
 (0)