Skip to content

Commit 877ef7f

Browse files
author
ycyraum
committed
core: remove unused bc ChainContext in applyTransaction
1 parent a41ea8a commit 877ef7f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: core/state_processor.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
7979
return nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
8080
}
8181
statedb.Prepare(tx.Hash(), i)
82-
receipt, err := applyTransaction(msg, p.config, p.bc, nil, gp, statedb, blockNumber, blockHash, tx, usedGas, vmenv)
82+
receipt, err := applyTransaction(msg, p.config, nil, gp, statedb, blockNumber, blockHash, tx, usedGas, vmenv)
8383
if err != nil {
8484
return nil, nil, 0, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
8585
}
@@ -92,7 +92,7 @@ func (p *StateProcessor) Process(block *types.Block, statedb *state.StateDB, cfg
9292
return receipts, allLogs, *usedGas, nil
9393
}
9494

95-
func applyTransaction(msg types.Message, config *params.ChainConfig, bc ChainContext, author *common.Address, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) {
95+
func applyTransaction(msg types.Message, config *params.ChainConfig, author *common.Address, gp *GasPool, statedb *state.StateDB, blockNumber *big.Int, blockHash common.Hash, tx *types.Transaction, usedGas *uint64, evm *vm.EVM) (*types.Receipt, error) {
9696
// Create a new context to be used in the EVM environment.
9797
txContext := NewEVMTxContext(msg)
9898
evm.Reset(txContext, statedb)
@@ -149,5 +149,5 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
149149
// Create a new context to be used in the EVM environment
150150
blockContext := NewEVMBlockContext(header, bc, author)
151151
vmenv := vm.NewEVM(blockContext, vm.TxContext{}, statedb, config, cfg)
152-
return applyTransaction(msg, config, bc, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv)
152+
return applyTransaction(msg, config, author, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv)
153153
}

0 commit comments

Comments
 (0)