Skip to content

Commit

Permalink
fix itc endblocker
Browse files Browse the repository at this point in the history
  • Loading branch information
harish551 committed Nov 7, 2024
1 parent 1bc33eb commit 7ddf9e4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions x/itc/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

func EndBlock(ctx sdk.Context, k keeper.Keeper) []abcitypes.ValidatorUpdate {
func EndBlock(ctx sdk.Context, k keeper.Keeper) ([]abcitypes.ValidatorUpdate, error) {
log := k.Logger(ctx)
err := k.FinalizeAndEndCampaigns(ctx)
if err != nil {
panic(err)
return nil, err
}
log.Info("Updated and processed campaigns .. ")
return []abcitypes.ValidatorUpdate{}
return []abcitypes.ValidatorUpdate{}, nil
}
10 changes: 10 additions & 0 deletions x/itc/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,13 @@ func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.Raw

// ConsensusVersion implements ConsensusVersion.
func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }

// BeginBlock executes all ABCI BeginBlock logic respective to the marketplace module.
func (am AppModule) BeginBlock(_ sdk.Context) {}

// EndBlock executes all ABCI EndBlock logic respective to the marketplace module. It
// returns no validator updates.
func (am AppModule) EndBlock(goCtx context.Context) ([]abci.ValidatorUpdate, error) {
ctx := sdk.UnwrapSDKContext(goCtx)
return EndBlock(ctx, am.keeper)
}

0 comments on commit 7ddf9e4

Please sign in to comment.