From 6a69b3ed577f080eb71ff1b7ec14e851eff96afc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrei=20B=C4=83ncioiu?= Date: Tue, 5 Nov 2024 12:45:23 +0200 Subject: [PATCH] Fix disabled cache. --- txcache/disabledCache.go | 4 ++-- txcache/disabledCache_test.go | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/txcache/disabledCache.go b/txcache/disabledCache.go index cf4b2049..26cd114b 100644 --- a/txcache/disabledCache.go +++ b/txcache/disabledCache.go @@ -26,8 +26,8 @@ func (cache *DisabledCache) GetByTxHash(_ []byte) (*WrappedTransaction, bool) { } // SelectTransactionsWithBandwidth returns an empty slice -func (cache *DisabledCache) SelectTransactions(uint64) []*WrappedTransaction { - return make([]*WrappedTransaction, 0) +func (cache *DisabledCache) SelectTransactions(uint64, int) ([]*WrappedTransaction, uint64) { + return make([]*WrappedTransaction, 0), 0 } // RemoveTxByHash does nothing diff --git a/txcache/disabledCache_test.go b/txcache/disabledCache_test.go index c71130d9..9725a01e 100644 --- a/txcache/disabledCache_test.go +++ b/txcache/disabledCache_test.go @@ -17,8 +17,9 @@ func TestDisabledCache_DoesNothing(t *testing.T) { require.Nil(t, tx) require.False(t, ok) - selection := cache.SelectTransactions(42) + selection, accumulatedGas := cache.SelectTransactions(42, 42) require.Equal(t, 0, len(selection)) + require.Equal(t, uint64(0), accumulatedGas) removed := cache.RemoveTxByHash([]byte{}) require.False(t, removed)