diff --git a/state/aggregator_test.go b/state/aggregator_test.go index 7f6f5a0fb..d7c885272 100644 --- a/state/aggregator_test.go +++ b/state/aggregator_test.go @@ -3,8 +3,6 @@ package state import ( "context" "encoding/binary" - "fmt" - "os" "testing" "github.com/ledgerwatch/log/v3" @@ -27,10 +25,9 @@ func testDbAndAggregator(t *testing.T, prefixLen int, aggStep uint64) (string, k } func TestAggregator_Merge(t *testing.T) { - path, db, agg := testDbAndAggregator(t, 0, 100) + _, db, agg := testDbAndAggregator(t, 0, 100) defer db.Close() - _ = path - //defer os.Remove(path) + defer agg.Close() tx, err := db.BeginRw(context.Background()) require.NoError(t, err) @@ -85,21 +82,13 @@ func TestAggregator_Merge(t *testing.T) { require.NoError(t, err) require.EqualValues(t, otherMaxWrite, binary.BigEndian.Uint64(v[:])) - agg.Close() - - fi, err := os.ReadDir(path) - require.NoError(t, err) - fmt.Printf("list test temp %s\n", path) - for _, item := range fi { - fmt.Printf("%s %v\n", item.Name(), item.IsDir()) - } } func TestAggregator_RestartOnFiles(t *testing.T) { aggStep := uint64(100) path, db, agg := testDbAndAggregator(t, 0, aggStep) defer db.Close() - //defer os.Remove(path) + defer agg.Close() tx, err := db.BeginRw(context.Background()) require.NoError(t, err) diff --git a/state/domain.go b/state/domain.go index 9d614f4a3..03ff9a089 100644 --- a/state/domain.go +++ b/state/domain.go @@ -415,7 +415,7 @@ func (d *Domain) MakeContext() *DomainContext { idxsz += uint64(item.index.Size()) files += 2 - bt.ReplaceOrInsert(&ctxItem{ + bt.ReplaceOrInsert(ctxItem{ startTxNum: item.startTxNum, endTxNum: item.endTxNum, getter: getter, @@ -842,7 +842,7 @@ func (dc *DomainContext) readFromFiles(filekey []byte, fromTxNum uint64) ([]byte var val []byte var found bool - dc.files.Descend(func(item *ctxItem) bool { + dc.files.Descend(func(item ctxItem) bool { if item.endTxNum < fromTxNum { return false } diff --git a/state/history.go b/state/history.go index 5ce97e1f7..b106a27b8 100644 --- a/state/history.go +++ b/state/history.go @@ -45,8 +45,6 @@ type History struct { settingsTable string files *btree.BTreeG[*filesItem] compressVals bool - files *btree.BTreeG[*filesItem] - compressVals bool workers int }