diff --git a/internal/ethapi/simulate.go b/internal/ethapi/simulate.go index 307e7d7ec8..280156bb77 100644 --- a/internal/ethapi/simulate.go +++ b/internal/ethapi/simulate.go @@ -167,12 +167,7 @@ func (mc *multicall) execute(ctx context.Context, opts mcOpts) ([]mcBlockResult, if err := mc.sanitizeCall(&call, state, &gasUsed, blockContext); err != nil { return nil, err } - // Default to dynamic-fee transaction type. - type2 := true - if call.GasPrice != nil { - type2 = false - } - tx := call.ToTransaction(type2) + tx := call.ToTransaction() txes[i] = tx // TODO: repair log block hashes post execution. vmConfig := &vm.Config{ diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index afc866d0e9..906210f957 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -366,7 +366,9 @@ func (args *TransactionArgs) toTransaction(type2 bool) *types.Transaction { } // ToTransaction converts the arguments to a transaction. +// It defaults to a dynamic fee transaction unless legacy gas price +// is explicitly provided. // This assumes that setDefaults has been called. -func (args *TransactionArgs) ToTransaction(type2 bool) *types.Transaction { - return args.toTransaction(type2) +func (args *TransactionArgs) ToTransaction() *types.Transaction { + return args.toTransaction(args.GasPrice == nil) }