Skip to content

Commit

Permalink
feat: add IBC transfer params hard fork (#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
aleem1314 authored Aug 21, 2023
1 parent a814805 commit 1cdb42d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@ func (app *PassageApp) Name() string { return app.BaseApp.Name() }

// BeginBlocker application updates every begin block
func (app *PassageApp) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock {
BeginBlockFork(ctx, app)
return app.mm.BeginBlock(ctx, req)
}

Expand Down
19 changes: 19 additions & 0 deletions app/forks.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package app

import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ibc-go/v4/modules/apps/transfer/types"
)

const forkHeight = 4426144

// BeginBlockFork updates, the IBC Transfer module's SendEnabled and ReceiveEnabled parameters are set to true.
func BeginBlockFork(ctx sdk.Context, app *PassageApp) {
if ctx.BlockHeight() == forkHeight {
ctx.Logger().Info("Applying Passage v2.1 upgrade. Enabling IBC transfers")
app.TransferKeeper.SetParams(ctx, types.Params{
SendEnabled: true,
ReceiveEnabled: true,
})
}
}

0 comments on commit 1cdb42d

Please sign in to comment.