mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
acbf8bcbdf
* Enable thin history by default * remove thin history flags * remove from tests * fix test compile error * test fixups * fix more stuff
48 lines
655 B
Go
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")
|
|
}
|
|
|
|
}
|