Skip to content

Commit

Permalink
fixing revert invariant
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Mar 18, 2024
1 parent 3e35a87 commit 0b17218
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion x/delayedack/keeper/invariants.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ func AllInvariants(k Keeper) sdk.Invariant {
if stop {
return res, stop
}

Check warning on line 23 in x/delayedack/keeper/invariants.go

View check run for this annotation

Codecov / codecov/patch

x/delayedack/keeper/invariants.go#L22-L23

Added lines #L22 - L23 were not covered by tests
res, stop = RollappRevertedPackets(k)(ctx)
if stop {
return res, stop
}

Check warning on line 27 in x/delayedack/keeper/invariants.go

View check run for this annotation

Codecov / codecov/patch

x/delayedack/keeper/invariants.go#L26-L27

Added lines #L26 - L27 were not covered by tests
return "", false
}
}
Expand Down Expand Up @@ -83,7 +87,7 @@ func RollappRevertedPackets(k Keeper) sdk.Invariant {
if packet.ProofHeight > latestFinalizedHeight {
stateInfoIndex := latestFinalizedStateIndex.Index + 1
for {
stateInfoToCheck, found := k.rollappKeeper.GetStateInfo(ctx, packet.RollappId, latestFinalizedStateIndex.Index)
stateInfoToCheck, found := k.rollappKeeper.GetStateInfo(ctx, packet.RollappId, stateInfoIndex)
if found {
if stateInfoToCheck.Status == commontypes.Status_REVERTED {
if stateInfoToCheck.StartHeight >= packet.ProofHeight && stateInfoToCheck.StartHeight+stateInfoToCheck.NumBlocks < packet.ProofHeight {
Expand Down

0 comments on commit 0b17218

Please sign in to comment.