Skip to content

Commit

Permalink
fix(mod/capability): implment appmodule.HasBeginBlocker interface (#4557
Browse files Browse the repository at this point in the history
)
  • Loading branch information
damiannolan committed Sep 5, 2023
1 parent c445fcc commit 432db29
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions modules/capability/module.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package capability

import (
"context"
"encoding/json"
"fmt"
"time"
Expand Down Expand Up @@ -29,6 +30,7 @@ var (
_ module.AppModuleBasic = (*AppModuleBasic)(nil)
_ module.AppModuleSimulation = (*AppModule)(nil)
_ appmodule.AppModule = (*AppModule)(nil)
_ appmodule.HasBeginBlocker = (*AppModule)(nil)
)

// ----------------------------------------------------------------------------
Expand Down Expand Up @@ -142,14 +144,16 @@ func (AppModule) ConsensusVersion() uint64 { return 1 }
// BeginBlock executes all ABCI BeginBlock logic respective to the capability module.
// BeginBlocker calls InitMemStore to assert that the memory store is initialized.
// It's safe to run multiple times.
func (am AppModule) BeginBlock(ctx sdk.Context) {
func (am AppModule) BeginBlock(ctx context.Context) error {
defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker)

am.keeper.InitMemStore(ctx)
am.keeper.InitMemStore(sdk.UnwrapSDKContext(ctx))

if am.sealKeeper && !am.keeper.IsSealed() {
am.keeper.Seal()
}

return nil
}

// GenerateGenesisState creates a randomized GenState of the capability module.
Expand Down

0 comments on commit 432db29

Please sign in to comment.