Skip to content

Commit

Permalink
updade code
Browse files Browse the repository at this point in the history
  • Loading branch information
avery committed Nov 20, 2024
1 parent dcd6733 commit 4c530a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
8 changes: 2 additions & 6 deletions modules/htlc/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

// BeginBlocker handles block beginning logic for HTLC
func BeginBlocker(c context.Context, k keeper.Keeper) error {
func BeginBlocker(c context.Context, k keeper.Keeper) {
ctx := sdk.UnwrapSDKContext(c)
ctx = ctx.WithLogger(ctx.Logger().With("handler", "beginBlock").With("module", "irismod/htlc"))

Expand All @@ -21,9 +21,7 @@ func BeginBlocker(c context.Context, k keeper.Keeper) error {
ctx, currentBlockHeight,
func(id tmbytes.HexBytes, h types.HTLC) (stop bool) {
// refund HTLC
if err := k.RefundHTLC(ctx, h, id); err != nil {
return err
}
_ = k.RefundHTLC(ctx, h, id)
// delete from the expiration queue
k.DeleteHTLCFromExpiredQueue(ctx, currentBlockHeight, id)

Expand All @@ -41,6 +39,4 @@ func BeginBlocker(c context.Context, k keeper.Keeper) error {
)

k.UpdateTimeBasedSupplyLimits(ctx)

return nil
}
3 changes: 2 additions & 1 deletion modules/htlc/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion }

// BeginBlock performs a no-op.
func (am AppModule) BeginBlock(ctx context.Context) error {
return BeginBlocker(ctx, am.keeper)
BeginBlocker(ctx, am.keeper)
return nil
}

// EndBlock returns the end blocker for the HTLC module. It returns no validator updates.
Expand Down

0 comments on commit 4c530a4

Please sign in to comment.