Skip to content

Commit

Permalink
fix(rollapp): add latest height and latest finalized height to rollap…
Browse files Browse the repository at this point in the history
…p summary (#1407)
  • Loading branch information
zale144 authored Nov 6, 2024
1 parent b4e5688 commit b49d4f5
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions x/rollapp/keeper/grpc_query_rollapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,21 @@ func getSummaryResponse(ctx sdk.Context, k Keeper, rollapp types.Rollapp, ok, wi
latestStateInfoIndex, found := k.GetLatestStateInfoIndex(ctx, rollapp.RollappId)
if found {
s.LatestStateIndex = &latestStateInfoIndex

latestStateInfo, foundFin := k.GetStateInfo(ctx, rollapp.RollappId, latestStateInfoIndex.Index)
if foundFin {
s.LatestHeight = latestStateInfo.GetLatestHeight()
}
}
latestFinalizedStateInfoIndex, found := k.GetLatestFinalizedStateIndex(ctx, rollapp.RollappId)
if found {

latestFinalizedStateInfoIndex, foundFinIdx := k.GetLatestFinalizedStateIndex(ctx, rollapp.RollappId)
if foundFinIdx {
s.LatestFinalizedStateIndex = &latestFinalizedStateInfoIndex

latestFinalizedStateInfo, foundFin := k.GetStateInfo(ctx, rollapp.RollappId, latestFinalizedStateInfoIndex.Index)
if foundFin {
s.LatestFinalizedHeight = latestFinalizedStateInfo.GetLatestHeight()
}
}

resp := &types.QueryGetRollappResponse{
Expand Down

0 comments on commit b49d4f5

Please sign in to comment.