From 0b17218ef9a899593c121bdf8885488e1e2016b2 Mon Sep 17 00:00:00 2001 From: Sergi Rene Date: Mon, 18 Mar 2024 15:26:52 +0100 Subject: [PATCH] fixing revert invariant --- x/delayedack/keeper/invariants.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/x/delayedack/keeper/invariants.go b/x/delayedack/keeper/invariants.go index e1b7924e7..58663e98e 100644 --- a/x/delayedack/keeper/invariants.go +++ b/x/delayedack/keeper/invariants.go @@ -21,6 +21,10 @@ func AllInvariants(k Keeper) sdk.Invariant { if stop { return res, stop } + res, stop = RollappRevertedPackets(k)(ctx) + if stop { + return res, stop + } return "", false } } @@ -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 {