Skip to content

Commit

Permalink
Fix disabled cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreibancioiu committed Nov 5, 2024
1 parent 7ee693c commit 6a69b3e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions txcache/disabledCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion txcache/disabledCache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6a69b3e

Please sign in to comment.