mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 19:50:36 +00:00
7352b81122
* 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
50 lines
657 B
Go
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")
|
|
}
|
|
}
|