Commit aa276c08 authored by Adrian Sutton's avatar Adrian Sutton

op-e2e: Use a synchronous approach to get transactions into the pool in TestBigL2Txs

parent 78e681b6
......@@ -464,7 +464,7 @@ func TestBigL2Txs(gt *testing.T) {
Value: big.NewInt(0),
Data: data,
})
require.NoError(gt, cl.SendTransaction(t.Ctx(), tx))
engine.ActSendTx(t, tx)
engine.ActL2IncludeTx(dp.Addresses.Alice)(t)
}
sequencer.ActL2EndBlock(t)
......@@ -504,7 +504,7 @@ func TestBigL2Txs(gt *testing.T) {
if miner.l1GasPool.Gas() < tx.Gas() { // fill the L1 block with batcher txs until we run out of gas
break
}
log.Info("including batcher tx", "nonce", tx)
log.Info("including batcher tx", "nonce", tx.Nonce())
miner.IncludeTx(t, tx)
txs = txs[1:]
}
......
......@@ -168,6 +168,13 @@ func (e *L2Engine) ActL2RPCFail(t Testing) {
e.failL2RPC = errors.New("mock L2 RPC error")
}
// ActSendTx adds a transaction to the tx pool and ensures any required promotion to the pending tx queue is complete
// before returning.
func (e *L2Engine) ActSendTx(t Testing, tx *types.Transaction) {
err := errors.Join(e.eth.TxPool().Add([]*types.Transaction{tx}, true, true)...)
require.NoError(t, err, "Add tx to pool")
}
// ActL2IncludeTx includes the next transaction from the given address in the block that is being built
func (e *L2Engine) ActL2IncludeTx(from common.Address) Action {
return func(t Testing) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment