Skip to content

Commit

Permalink
fix for len 0
Browse files Browse the repository at this point in the history
  • Loading branch information
srene committed Sep 27, 2024
1 parent 2b7f3d6 commit 39bd120
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion settlement/dymension/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,16 @@ func convertStateInfoToResultRetrieveBatch(stateInfo *rollapptypes.StateInfo) (*
if err != nil {
return nil, err
}

endHeight := uint64(0)
if len(stateInfo.BDs.BD) > 0 {
endHeight = stateInfo.BDs.BD[len(stateInfo.BDs.BD)-1].Height
}

batchResult := &settlement.Batch{
Sequencer: stateInfo.Sequencer,
StartHeight: stateInfo.StartHeight,
EndHeight: stateInfo.BDs.BD[len(stateInfo.BDs.BD)-1].Height,
EndHeight: endHeight,
MetaData: &settlement.BatchMetaData{
DA: daMetaData,
},
Expand Down

0 comments on commit 39bd120

Please sign in to comment.