erigon-pulse/eth/backend_test.go
ledgerwatch f06db2f37b
Stages 6 and 7 for generating history indices (#569)
* save state

* add current index feature

* fix test

* remove logs

* Only execute 1000 blocks

* Reset history index

* Correct action

* Increase batch size

* Increase chunk size, print memory stats

* Fix linter

* Remove unused from

* Split into 2 staged

* Use storage history gen

* remove log

* Not to run tx_cacher in staged mode

* Not to recover during stage 2

* Not to recover during stage 2

* Remove counter

Co-authored-by: b00ris <b00ris@mail.ru>
2020-05-23 10:19:56 +01:00

48 lines
655 B
Go

package eth
import (
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/ledgerwatch/turbo-geth/ethdb"
)
func TestSetStorageModeIfNotExist(t *testing.T) {
db := ethdb.NewMemDatabase()
sm, err := GetStorageModeFromDB(db)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(sm, StorageMode{}) {
t.Fatal()
}
err = setStorageModeIfNotExist(db, StorageMode{
true,
true,
true,
true,
})
if err != nil {
t.Fatal(err)
}
sm, err = GetStorageModeFromDB(db)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(sm, StorageMode{
true,
true,
true,
true,
}) {
spew.Dump(sm)
t.Fatal("not equal")
}
}