diff --git a/x/committer/keeper/msg_server.go b/x/committer/keeper/msg_server.go index a664cc8dc0..cfd9ae76f3 100644 --- a/x/committer/keeper/msg_server.go +++ b/x/committer/keeper/msg_server.go @@ -44,10 +44,13 @@ 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 equal last proposal end index + 1, "+ + "if last proposal end index is 0, then proposal start index must be 1, "+ + " else if last proposal end index is not 0, then proposal start"+ + " index must equal last proposal end index, "+ "last proposal end index: %s", fmt.Sprint(lastProposal.EndIndex)) } diff --git a/x/committer/keeper/msg_server_test.go b/x/committer/keeper/msg_server_test.go index fae5292fe4..b6fe0a05ca 100644 --- a/x/committer/keeper/msg_server_test.go +++ b/x/committer/keeper/msg_server_test.go @@ -62,7 +62,7 @@ func TestSubmitProof(t *testing.T) { EndIndex: 11, }, isError: true, - errMsg: "proposal start index must equal last proposal end index + 1", + errMsg: "proposal start index must equal last proposal end index", preRun: func(ctx sdk.Context, k keeper.Keeper) { k.SetLastProposal(ctx, types.Proposal{ Id: 1,