Massive code cleanup (#10913)

* Massive code cleanup

* fix test issues

* remove GetGenesis mock expectations

* unused receiver

* rename unused params

Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
Radosław Kapka
2022-06-27 15:34:38 +02:00
committed by GitHub
parent 9216be7d43
commit 7f56ac6355
158 changed files with 1020 additions and 1177 deletions

View File

@@ -39,7 +39,7 @@ type node struct {
func main() {
flag.Parse()
db, err := db.NewDB(context.Background(), *datadir, &kv.Config{})
database, err := db.NewDB(context.Background(), *datadir, &kv.Config{})
if err != nil {
panic(err)
}
@@ -51,7 +51,7 @@ func main() {
startSlot := types.Slot(*startSlot)
endSlot := types.Slot(*endSlot)
filter := filters.NewFilter().SetStartSlot(startSlot).SetEndSlot(endSlot)
blks, roots, err := db.Blocks(context.Background(), filter)
blks, roots, err := database.Blocks(context.Background(), filter)
if err != nil {
panic(err)
}
@@ -63,7 +63,7 @@ func main() {
r := roots[i]
m[r] = &node{score: make(map[uint64]bool)}
state, err := db.State(context.Background(), r)
state, err := database.State(context.Background(), r)
if err != nil {
panic(err)
}
@@ -71,11 +71,11 @@ func main() {
// If the state is not available, roll back
for state == nil {
slot--
_, rts, err := db.BlockRootsBySlot(context.Background(), slot)
_, rts, err := database.BlockRootsBySlot(context.Background(), slot)
if err != nil {
panic(err)
}
state, err = db.State(context.Background(), rts[0])
state, err = database.State(context.Background(), rts[0])
if err != nil {
panic(err)
}