mirror of
https://github.com/tendermint/tendermint.git
synced 2026-02-11 14:21:18 +00:00
add mechanism to change the number of bytes sent to the application
This commit is contained in:
@@ -342,6 +342,7 @@ func TestCreateProposalBlock(t *testing.T) {
|
||||
state, commit,
|
||||
proposerAddr,
|
||||
nil,
|
||||
0,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -396,8 +397,9 @@ func TestMaxTxsProposalBlockSize(t *testing.T) {
|
||||
)
|
||||
|
||||
// fill the mempool with one txs just below the maximum size
|
||||
txLength := int(types.MaxDataBytesNoEvidence(maxBytes, 1))
|
||||
tx := tmrand.Bytes(txLength - 4) // to account for the varint
|
||||
mb, err := types.MaxDataBytesNoEvidence(maxBytes, 1)
|
||||
require.NoError(t, err)
|
||||
tx := tmrand.Bytes(int(mb) - 4) // to account for the varint
|
||||
err = mp.CheckTx(ctx, tx, nil, mempool.TxInfo{})
|
||||
assert.NoError(t, err)
|
||||
|
||||
@@ -421,6 +423,7 @@ func TestMaxTxsProposalBlockSize(t *testing.T) {
|
||||
state, commit,
|
||||
proposerAddr,
|
||||
nil,
|
||||
0,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -464,8 +467,9 @@ func TestMaxProposalBlockSize(t *testing.T) {
|
||||
)
|
||||
|
||||
// fill the mempool with one txs just below the maximum size
|
||||
txLength := int(types.MaxDataBytesNoEvidence(maxBytes, types.MaxVotesCount))
|
||||
tx := tmrand.Bytes(txLength - 6) // to account for the varint
|
||||
mb, err := types.MaxDataBytesNoEvidence(maxBytes, types.MaxVotesCount)
|
||||
require.NoError(t, err)
|
||||
tx := tmrand.Bytes(int(mb) - 6) // to account for the varint
|
||||
err = mp.CheckTx(ctx, tx, nil, mempool.TxInfo{})
|
||||
assert.NoError(t, err)
|
||||
// now produce more txs than what a normal block can hold with 10 smaller txs
|
||||
@@ -542,6 +546,7 @@ func TestMaxProposalBlockSize(t *testing.T) {
|
||||
state, commit,
|
||||
proposerAddr,
|
||||
nil,
|
||||
0,
|
||||
)
|
||||
require.NoError(t, err)
|
||||
partSet, err := block.MakePartSet(types.BlockPartSizeBytes)
|
||||
|
||||
Reference in New Issue
Block a user