Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
skosito committed May 23, 2024
1 parent 256f8a1 commit 7cb9715
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion pkg/mempool/custom_proposal_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ func (s *ABCIUtilsTestSuite) TestCustomProposalHandler_PriorityNonceMempoolTxSel
),
priority: 8,
},
// same as tx2, but with same nonce as tx1, used in skip same-sender and nonce and add same-sender and nonce with less size
{tx: buildMsg(s.T(), txConfig, []byte(`22`), [][]byte{secret1}, []uint64{2}), priority: 10},
}

for i := range testTxs {
Expand Down Expand Up @@ -245,6 +247,14 @@ func (s *ABCIUtilsTestSuite) TestCustomProposalHandler_PriorityNonceMempoolTxSel
},
expectedTxs: []int{0, 3},
},
"skip same-sender and nonce and add same-sender and nonce with less size": {
ctx: s.ctx,
txInputs: []testTx{testTxs[0], testTxs[1], testTxs[23]},
req: abci.RequestPrepareProposal{
MaxTxBytes: 111 + 112,
},
expectedTxs: []int{0, 23},
},
"(eth tx) skip same-sender non-sequential sequence and then add others txs": {
ctx: s.ctx,
txInputs: []testTx{testTxs[15], testTxs[16], testTxs[17], testTxs[18]},
Expand All @@ -270,7 +280,7 @@ func (s *ABCIUtilsTestSuite) TestCustomProposalHandler_PriorityNonceMempoolTxSel
expectedTxs: []int{4, 8},
},
"only the first tx is added": {
// Because tx 10 is valid, tx 11 can't be valid as they have higher sequence numbers.
// Because tx 10 is invalid, tx 11 can't be valid as they have higher sequence numbers.
ctx: s.ctx,
txInputs: []testTx{testTxs[9], testTxs[10], testTxs[11]},
req: abci.RequestPrepareProposal{
Expand Down

0 comments on commit 7cb9715

Please sign in to comment.