From b3d75ec0c1d3035a2bf6f4b005ca9b3232b21d9c Mon Sep 17 00:00:00 2001 From: "alex.sharov" Date: Thu, 16 Mar 2023 10:38:08 +0700 Subject: [PATCH] clean --- txpool/pool_test.go | 52 --------------------------------------------- 1 file changed, 52 deletions(-) diff --git a/txpool/pool_test.go b/txpool/pool_test.go index b0fa8653e..48a2fa02b 100644 --- a/txpool/pool_test.go +++ b/txpool/pool_test.go @@ -18,12 +18,10 @@ package txpool import ( "bytes" - "container/heap" "context" "fmt" "math" "math/big" - "math/rand" "testing" "github.com/holiman/uint256" @@ -31,7 +29,6 @@ import ( "github.com/stretchr/testify/require" "github.com/ledgerwatch/erigon-lib/common" - "github.com/ledgerwatch/erigon-lib/common/cmp" "github.com/ledgerwatch/erigon-lib/common/fixedgas" "github.com/ledgerwatch/erigon-lib/common/u256" "github.com/ledgerwatch/erigon-lib/gointerfaces" @@ -42,55 +39,6 @@ import ( "github.com/ledgerwatch/erigon-lib/types" ) -func BenchmarkName(b *testing.B) { - txs := make([]*metaTx, 10_000) - p := NewSubPool(BaseFeeSubPool, 1024) - for i := 0; i < len(txs); i++ { - txs[i] = &metaTx{Tx: &types.TxSlot{}} - } - for i := 0; i < len(txs); i++ { - p.Add(txs[i]) - } - p.EnforceInvariants() - b.ResetTimer() - for i := 0; i < b.N; i++ { - txs[0].timestamp = 1 - heap.Fix(p.best, txs[0].bestIndex) - heap.Fix(p.worst, txs[0].worstIndex) - } -} - -func BenchmarkName2(b *testing.B) { - - var ( - a = rand.Uint64() - c = rand.Uint64() - d = rand.Uint64() - ) - b.ResetTimer() - var min1 uint64 - var min2 uint64 - var r uint64 - - for i := 0; i < b.N; i++ { - min1 = cmp.Min(min1, a) - min2 = cmp.Min(min2, c) - if d <= min1 { - r = cmp.Min(min1-d, min2) - } else { - r = 0 - } - // - //// 4. Dynamic fee requirement. Set to 1 if feeCap of the transaction is no less than - //// baseFee of the currently pending block. Set to 0 otherwise. - //mt.subPool &^= EnoughFeeCapBlock - //if mt.Tx.feeCap >= pendingBaseFee { - // mt.subPool |= EnoughFeeCapBlock - //} - } - _ = r -} - func TestNonceFromAddress(t *testing.T) { assert, require := assert.New(t), require.New(t) ch := make(chan types.Announcements, 100)