consensus: check transactions count during PrepareRequest verification

This commit is contained in:
Anna Shaleva 2021-03-09 21:30:09 +03:00
parent 23a3514cc0
commit 38103dcc7a
2 changed files with 14 additions and 3 deletions

View file

@ -323,6 +323,13 @@ func TestService_PrepareRequest(t *testing.T) {
sr, err := srv.Chain.GetStateModule().GetStateRoot(srv.dbft.BlockIndex - 1)
require.NoError(t, err)
checkRequest(t, errInvalidTransactionsCount, &prepareRequest{stateRootEnabled: true,
prevHash: prevHash,
stateRoot: sr.Root,
transactionHashes: make([]util.Uint256, srv.ProtocolConfiguration.MaxTransactionsPerBlock+1),
})
checkRequest(t, nil, &prepareRequest{
stateRootEnabled: true,
prevHash: prevHash,