test: Add mempool comparison tests (#357)

This commit is contained in:
Eric Warehime
2024-01-12 13:01:52 -08:00
committed by GitHub
parent a135d8f89d
commit 39f91b60a2
4 changed files with 157 additions and 61 deletions
+6 -5
View File
@@ -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)