Skip to content

Commit

Permalink
innuendo-4 voting period fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Joe Bowman committed Dec 30, 2022
1 parent d6326a4 commit 9aa37bc
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions x/airdrop/keeper/abci.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
package keeper

import (
"time"

sdk "github.com/cosmos/cosmos-sdk/types"
)

// BeginBlocker of module
func (k Keeper) BeginBlocker(ctx sdk.Context) {
// this is hideous, but the voting period was set too low on innuendo-4 and needs to be fixed.
// this is the only place we have access to the govKeeper.
// it will run once at the selected blockheight.
if ctx.ChainID() == "innuendo-4" && ctx.BlockHeight() == 334000 {
k.govKeeper.Logger(ctx).Info("setting gov voting period to six hours")
votingParams := k.govKeeper.GetVotingParams(ctx)
sixHours := time.Hour * 6
votingParams.VotingPeriod = &sixHours
k.govKeeper.SetVotingParams(ctx, votingParams)
}
}

// EndBlocker of module
func (k Keeper) EndBlocker(ctx sdk.Context) {
for _, zd := range k.UnconcludedAirdrops(ctx) {
Expand Down
1 change: 1 addition & 0 deletions x/airdrop/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw

// BeginBlock executes all ABCI BeginBlock logic respective to the airdrop module.
func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) {
am.keeper.BeginBlocker(ctx)
}

// EndBlock executes all ABCI EndBlock logic respective to the airdrop module. It
Expand Down

0 comments on commit 9aa37bc

Please sign in to comment.