fix chainId default

This commit is contained in:
Sina Mahmoodi 2024-06-12 13:11:26 +02:00
parent 638d82bdf7
commit ac690f0d4c

View file

@ -189,12 +189,11 @@ func (sim *simulator) processBlock(ctx context.Context, block *simBlock, header,
if err := sim.sanitizeCall(&call, sim.state, &gasUsed, blockContext); err != nil {
return nil, err
}
tx := call.ToTransaction(call.GasPrice == nil)
txes[i] = tx
if err := call.CallDefaults(gp.Gas(), header.BaseFee, config.ChainID); err != nil {
return nil, err
}
tx := call.ToTransaction(call.GasPrice == nil)
txes[i] = tx
msg := call.ToMessage(header.BaseFee, !sim.validate)
tracer.reset(tx.Hash(), uint(i))
evm.Reset(core.NewEVMTxContext(msg), sim.state)
@ -276,11 +275,6 @@ func (sim *simulator) sanitizeCall(call *TransactionArgs, state *state.StateDB,
remaining := blockContext.GasLimit - *gasUsed
call.Gas = (*hexutil.Uint64)(&remaining)
}
// TODO: check chainID and against current header for london fees
if call.GasPrice == nil && call.MaxFeePerGas == nil && call.MaxPriorityFeePerGas == nil {
call.MaxFeePerGas = (*hexutil.Big)(big.NewInt(0))
call.MaxPriorityFeePerGas = (*hexutil.Big)(big.NewInt(0))
}
return nil
}