Skip to content

Commit dddaea4

Browse files
committed
core/statedb: rename api
Signed-off-by: Ignacio Hagopian <[email protected]>
1 parent 923963d commit dddaea4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

core/state/statedb.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ func New(root common.Hash, db Database, snaps *snapshot.Tree) (*StateDB, error)
174174
hasher: crypto.NewKeccakState(),
175175
}
176176
if tr.IsVerkle() {
177-
sdb.witness = sdb.NewFreshAccessWitness()
177+
sdb.witness = sdb.NewAccessWitness()
178178
// if sdb.snaps == nil {
179179
// snapconfig := snapshot.Config{
180180
// CacheSize: 256,
@@ -206,13 +206,13 @@ func (s *StateDB) Snaps() *snapshot.Tree {
206206
return s.snaps
207207
}
208208

209-
func (s *StateDB) NewFreshAccessWitness() *AccessWitness {
209+
func (s *StateDB) NewAccessWitness() *AccessWitness {
210210
return NewAccessWitness(s.db.(*cachingDB).addrToPoint)
211211
}
212212

213213
func (s *StateDB) Witness() *AccessWitness {
214214
if s.witness == nil {
215-
s.witness = s.NewFreshAccessWitness()
215+
s.witness = s.NewAccessWitness()
216216
}
217217
return s.witness
218218
}

core/state_processor.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
320320
func applyTransaction(msg *Message, config *params.ChainConfig, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) {
321321
// Create a new context to be used in the EVM environment.
322322
txContext := NewEVMTxContext(msg)
323-
txContext.Accesses = statedb.NewFreshAccessWitness()
323+
txContext.Accesses = statedb.NewAccessWitness()
324324
evm.Reset(txContext, statedb)
325325

326326
// Apply the transaction to the current state (included in the env).

core/vm/evm.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, chainConfig
138138
chainRules: chainConfig.Rules(blockCtx.BlockNumber, blockCtx.Random != nil, blockCtx.Time),
139139
}
140140
if txCtx.Accesses == nil && chainConfig.IsVerkle(blockCtx.BlockNumber, blockCtx.Time) {
141-
txCtx.Accesses = evm.StateDB.(*state.StateDB).NewFreshAccessWitness()
141+
txCtx.Accesses = evm.StateDB.(*state.StateDB).NewAccessWitness()
142142
}
143143
evm.interpreter = NewEVMInterpreter(evm)
144144
return evm
@@ -148,7 +148,7 @@ func NewEVM(blockCtx BlockContext, txCtx TxContext, statedb StateDB, chainConfig
148148
// This is not threadsafe and should only be done very cautiously.
149149
func (evm *EVM) Reset(txCtx TxContext, statedb StateDB) {
150150
if txCtx.Accesses == nil && evm.chainRules.IsVerkle {
151-
txCtx.Accesses = evm.StateDB.(*state.StateDB).NewFreshAccessWitness()
151+
txCtx.Accesses = evm.StateDB.(*state.StateDB).NewAccessWitness()
152152
}
153153
evm.TxContext = txCtx
154154
evm.StateDB = statedb

0 commit comments

Comments
 (0)