Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
fixup after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
awskii committed Sep 26, 2022
1 parent 9e0bcda commit 61d7e77
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
17 changes: 3 additions & 14 deletions state/aggregator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package state
import (
"context"
"encoding/binary"
"fmt"
"os"
"testing"

"github.com/ledgerwatch/log/v3"
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions state/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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
}
Expand Down
2 changes: 0 additions & 2 deletions state/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,6 @@ type History struct {
settingsTable string
files *btree.BTreeG[*filesItem]
compressVals bool
files *btree.BTreeG[*filesItem]
compressVals bool
workers int
}

Expand Down

0 comments on commit 61d7e77

Please sign in to comment.