Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: yihuang <[email protected]>
Signed-off-by: mmsqe <[email protected]>
  • Loading branch information
mmsqe and yihuang authored Aug 17, 2023
1 parent 9ab865b commit c25a49b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 1 addition & 3 deletions types/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,8 @@ import (
// InitChainer initializes application state at genesis
type InitChainer func(ctx Context, req abci.RequestInitChain) abci.ResponseInitChain

// PreBeginBlocker runs code before the transactions in a block
// PreBeginBlocker runs code before the `BeginBlocker`.
//
// Note: applications which set create_empty_blocks=false will not have regular block timing and should use
// e.g. BFT timestamps rather than block height for any periodic BeginBlock logic

type ResponsePreBeginBlock struct {
ConsensusParamsChanged bool
Expand Down
2 changes: 2 additions & 0 deletions x/upgrade/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ func PreBeginBlocker(k *keeper.Keeper, ctx sdk.Context, _ abci.RequestBeginBlock
ctx = ctx.WithBlockGasMeter(sdk.NewInfiniteGasMeter())
k.ApplyUpgrade(ctx, plan)
return sdk.ResponsePreBeginBlock{
// the consensus parameters might be modified in the migration,
// refresh the consensus parameters in context.
ConsensusParamsChanged: true,
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion x/upgrade/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ func (AppModule) ConsensusVersion() uint64 { return consensusVersion }

// PreBeginBlock calls the upgrade module hooks
//
// CONTRACT: this is registered in BeginBlocker *before* all other modules' BeginBlock functions
// CONTRACT: this is called *before* all other modules' BeginBlock functions
func (am AppModule) PreBeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) (sdk.ResponsePreBeginBlock, error) {
return PreBeginBlocker(am.keeper, ctx, req)
}
Expand Down

0 comments on commit c25a49b

Please sign in to comment.