erigon-pulse/ethdb/storage_mode_test.go
Evgeny Danilenko 7352b81122
Tevm stage 1 (#1845)
* convert contracts after block execution

* check if has tevm code

* after review-1

* handle ErrNotFound

* typo

* tests

* tevm code bucket

* testdata

* execute pre-stage

* after merge

* test fix

* test fix

* fix test after merge

* disable translation stage

* after merge

* rename params

* rename to Erigon

* parallelize EVM translation

* fix

* logging and fixes

* fix

* todos

* cleanup

* revert erigorn renaming

* unwind

* tevm unwind

* fix AppData

* non-parallel version

* comments
2021-05-27 14:54:55 +01:00

50 lines
657 B
Go

package ethdb
import (
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
)
func TestSetStorageModeIfNotExist(t *testing.T) {
_, tx := NewTestTx(t)
sm, err := GetStorageModeFromDB(tx)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(sm, StorageMode{Initialised: true}) {
t.Fatal()
}
err = SetStorageModeIfNotExist(tx, StorageMode{
true,
true,
true,
true,
true,
false,
})
if err != nil {
t.Fatal(err)
}
sm, err = GetStorageModeFromDB(tx)
if err != nil {
t.Fatal(err)
}
if !reflect.DeepEqual(sm, StorageMode{
true,
true,
true,
true,
true,
false,
}) {
spew.Dump(sm)
t.Fatal("not equal")
}
}