Skip to content

Commit

Permalink
simplify deleted check for winning axelar corks
Browse files Browse the repository at this point in the history
  • Loading branch information
EricBolten committed Feb 1, 2024
1 parent 8869b94 commit 3cceba9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions x/axelarcork/keeper/abci.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,18 +44,13 @@ func (k Keeper) EndBlocker(ctx sdk.Context) {
currentHeight := uint64(ctx.BlockHeight())
latestAxelarCorks := make(map[string]types.WinningAxelarCork)
k.IterateWinningAxelarCorks(ctx, config.Id, func(contractAddress common.Address, blockHeight uint64, cork types.AxelarCork) (stop bool) {
deleted := false
timeoutHeight := blockHeight + k.GetParamSet(ctx).CorkTimeoutBlocks
if currentHeight >= timeoutHeight {
k.Logger(ctx).Info("deleting expired approved scheduled axelar cork",
"scheduled height", fmt.Sprintf("%d", blockHeight),
"target contract address", cork.TargetContractAddress)

k.DeleteWinningAxelarCorkByBlockheight(ctx, config.Id, blockHeight, cork)
deleted = true
}

if deleted {
return false
}

Expand Down

0 comments on commit 3cceba9

Please sign in to comment.