mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-22 11:41:19 +00:00
e4: assert state reader
This commit is contained in:
parent
21d66d6c01
commit
61deabc561
@ -28,6 +28,7 @@ import (
|
|||||||
"github.com/ledgerwatch/erigon-lib/common/length"
|
"github.com/ledgerwatch/erigon-lib/common/length"
|
||||||
"github.com/ledgerwatch/erigon-lib/kv"
|
"github.com/ledgerwatch/erigon-lib/kv"
|
||||||
"github.com/ledgerwatch/erigon-lib/kv/kvcfg"
|
"github.com/ledgerwatch/erigon-lib/kv/kvcfg"
|
||||||
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
||||||
"github.com/ledgerwatch/log/v3"
|
"github.com/ledgerwatch/log/v3"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/common"
|
"github.com/ledgerwatch/erigon/common"
|
||||||
@ -62,6 +63,9 @@ func NewPlainState(tx kv.Tx, blockNr uint64, systemContractLookup map[libcommon.
|
|||||||
if histV3 {
|
if histV3 {
|
||||||
panic("Please use HistoryStateReaderV3 with HistoryV3")
|
panic("Please use HistoryStateReaderV3 with HistoryV3")
|
||||||
}
|
}
|
||||||
|
if ethconfig.EnableHistoryV4InTest {
|
||||||
|
panic("historyV4 require use StateReaderV4/StateWriterV4 instead of StateReader")
|
||||||
|
}
|
||||||
ps := &PlainState{
|
ps := &PlainState{
|
||||||
tx: tx,
|
tx: tx,
|
||||||
blockNr: blockNr,
|
blockNr: blockNr,
|
||||||
|
@ -6,6 +6,7 @@ import (
|
|||||||
"github.com/holiman/uint256"
|
"github.com/holiman/uint256"
|
||||||
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
||||||
"github.com/ledgerwatch/erigon-lib/kv"
|
"github.com/ledgerwatch/erigon-lib/kv"
|
||||||
|
"github.com/ledgerwatch/erigon/eth/ethconfig"
|
||||||
|
|
||||||
"github.com/ledgerwatch/erigon/common/dbutils"
|
"github.com/ledgerwatch/erigon/common/dbutils"
|
||||||
"github.com/ledgerwatch/erigon/core/types/accounts"
|
"github.com/ledgerwatch/erigon/core/types/accounts"
|
||||||
@ -26,6 +27,9 @@ type PlainStateWriter struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func NewPlainStateWriter(db putDel, changeSetsDB kv.RwTx, blockNumber uint64) *PlainStateWriter {
|
func NewPlainStateWriter(db putDel, changeSetsDB kv.RwTx, blockNumber uint64) *PlainStateWriter {
|
||||||
|
if ethconfig.EnableHistoryV4InTest {
|
||||||
|
panic("historyV4 require use StateReaderV4 instead of PlainStateReader")
|
||||||
|
}
|
||||||
return &PlainStateWriter{
|
return &PlainStateWriter{
|
||||||
db: db,
|
db: db,
|
||||||
csw: NewChangeSetWriterPlain(changeSetsDB, blockNumber),
|
csw: NewChangeSetWriterPlain(changeSetsDB, blockNumber),
|
||||||
|
Loading…
Reference in New Issue
Block a user