Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix itc endblocker #194

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
}
Loading