From 120cc5aa757c04a794c2bea6e0e88890e83a6f1f Mon Sep 17 00:00:00 2001 From: Damian Nolan Date: Tue, 5 Sep 2023 11:53:29 +0200 Subject: [PATCH] fix(mod/capability): implment appmodule.HasBeginBlocker interface (#4557) (cherry picked from commit 432db298f855c03ee0423bdde286ef3c8f4c6acb) --- 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 c94e588e8b5..fb95fbf6c6a 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) ) // ---------------------------------------------------------------------------- @@ -144,14 +146,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.