From bdd8b2ce01b958051dd752c3765e2d3e5821cf24 Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Mon, 4 Sep 2023 17:33:53 +0200 Subject: [PATCH] fix: implment appmodule.HasBeginBlocker interface --- modules/capability/module.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/modules/capability/module.go b/modules/capability/module.go index 27bcd87d51e..1d357234360 100644 --- a/modules/capability/module.go +++ b/modules/capability/module.go @@ -1,6 +1,7 @@ package capability import ( + "context" "encoding/json" "fmt" "time" @@ -29,6 +30,7 @@ var ( _ module.AppModuleBasic = (*AppModuleBasic)(nil) _ module.AppModuleSimulation = (*AppModule)(nil) _ appmodule.AppModule = (*AppModule)(nil) + _ appmodule.HasBeginBlocker = (*AppModule)(nil) ) // ---------------------------------------------------------------------------- @@ -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.