Skip to content

Commit

Permalink
fix validation of submitproof
Browse files Browse the repository at this point in the history
  • Loading branch information
zhouop0 committed Feb 21, 2024
1 parent 1ed367b commit 0fb092f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions x/committer/keeper/msg_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ func (k msgServer) SubmitProof(goCtx context.Context, msg *types.MsgSubmitProof)
Status: types.VotingStatus,
}

if lastProposal.EndIndex+1 >= proposal.StartIndex {
if !(lastProposal.EndIndex == 0 && proposal.StartIndex == 1) &&
!(lastProposal.EndIndex != 0 && lastProposal.EndIndex == proposal.StartIndex) {
return &types.MsgSubmitProofResponse{},
fmt.Errorf(
"proposal start index must be equal or greater than last proposal end index + 1, "+
"proposal start index must equal last proposal end index, "+
"last proposal end index: %s", fmt.Sprint(lastProposal.EndIndex))
}

Expand Down

0 comments on commit 0fb092f

Please sign in to comment.