test: Add mempool comparison tests (#357)
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/skip-mev/block-sdk/lanes/free"
|
||||
"github.com/skip-mev/block-sdk/lanes/mev"
|
||||
"github.com/skip-mev/block-sdk/testutils"
|
||||
"github.com/skip-mev/block-sdk/testutils/mempool"
|
||||
)
|
||||
|
||||
func TestGetTxDistribution(t *testing.T) {
|
||||
@@ -31,7 +32,7 @@ func TestGetTxDistribution(t *testing.T) {
|
||||
}{
|
||||
{
|
||||
name: "returns correct distribution with no transactions",
|
||||
mempool: testutils.CreateMempool,
|
||||
mempool: mempool.CreateMempool,
|
||||
expectedDistribution: map[string]uint64{
|
||||
mev.LaneName: 0,
|
||||
free.LaneName: 0,
|
||||
@@ -63,7 +64,7 @@ func TestGetTxDistribution(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
mempool := testutils.CreateMempool()
|
||||
mempool := mempool.CreateMempool()
|
||||
err = mempool.Insert(ctx, tx1)
|
||||
require.NoError(t, err)
|
||||
err = mempool.Insert(ctx, tx2)
|
||||
@@ -90,7 +91,7 @@ func TestGetTxDistribution(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
mempool := testutils.CreateMempool()
|
||||
mempool := mempool.CreateMempool()
|
||||
err = mempool.Insert(ctx, tx1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -115,7 +116,7 @@ func TestGetTxDistribution(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
mempool := testutils.CreateMempool()
|
||||
mempool := mempool.CreateMempool()
|
||||
err = mempool.Insert(ctx, tx1)
|
||||
require.NoError(t, err)
|
||||
|
||||
@@ -161,7 +162,7 @@ func TestGetTxDistribution(t *testing.T) {
|
||||
)
|
||||
require.NoError(t, err)
|
||||
|
||||
mempool := testutils.CreateMempool()
|
||||
mempool := mempool.CreateMempool()
|
||||
err = mempool.Insert(ctx, mevTx)
|
||||
require.NoError(t, err)
|
||||
err = mempool.Insert(ctx, freeTx)
|
||||
|
||||
Reference in New Issue
Block a user