core: polish

This commit is contained in:
Gary Rong 2026-02-27 21:03:40 +08:00
parent 87c071ba88
commit 47495935cd
2 changed files with 2 additions and 5 deletions

View file

@ -115,11 +115,9 @@ func (b *BlockGen) addTx(bc *BlockChain, vmConfig vm.Config, tx *types.Transacti
var (
blockContext = NewEVMBlockContext(b.header, bc, &b.header.Coinbase)
evm = vm.NewEVM(blockContext, b.statedb, b.cm.config, vmConfig)
receipt *types.Receipt
err error
)
b.statedb.SetTxContext(tx.Hash(), len(b.txs))
receipt, err = ApplyTransaction(evm, b.gasPool, b.statedb, b.header, tx)
receipt, err := ApplyTransaction(evm, b.gasPool, b.statedb, b.header, tx)
if err != nil {
panic(err)
}

View file

@ -106,8 +106,7 @@ func (p *StateProcessor) Process(ctx context.Context, block *types.Block, stated
telemetry.Int64Attribute("tx.index", int64(i)),
)
var receipt *types.Receipt
receipt, err = ApplyTransactionWithEVM(msg, gp, statedb, blockNumber, blockHash, context.Time, tx, evm)
receipt, err := ApplyTransactionWithEVM(msg, gp, statedb, blockNumber, blockHash, context.Time, tx, evm)
if err != nil {
return nil, fmt.Errorf("could not apply tx %d [%v]: %w", i, tx.Hash().Hex(), err)
}