Skip to content

Commit

Permalink
check chain-id
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Dec 14, 2023
1 parent 6bb630b commit 54809f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/forks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type Fork struct {
UpgradeName string
// height the upgrade occurs at
UpgradeHeight int64
// chain-id the upgrade occurs at
UpgradeChainId string

// Function that runs some custom state transition code at the beginning of a fork.
BeginForkLogic func(ctx sdk.Context, app *App)
Expand All @@ -22,7 +24,7 @@ type Fork struct {
// BeginBlockForks is intended to be ran in a chain upgrade.
func BeginBlockForks(ctx sdk.Context, app *App) {
for _, fork := range Forks {
if ctx.BlockHeight() == fork.UpgradeHeight {
if ctx.BlockHeight() == fork.UpgradeHeight && ctx.ChainID() == fork.UpgradeChainId {
fork.BeginForkLogic(ctx, app)
return
}

Check warning on line 30 in app/forks.go

View check run for this annotation

Codecov / codecov/patch

app/forks.go#L25-L30

Added lines #L25 - L30 were not covered by tests
Expand Down

0 comments on commit 54809f7

Please sign in to comment.