diff --git a/internal/ethapi/transaction_args.go b/internal/ethapi/transaction_args.go index 284a2ab308..ab709d3558 100644 --- a/internal/ethapi/transaction_args.go +++ b/internal/ethapi/transaction_args.go @@ -40,7 +40,7 @@ import ( // TransactionArgs represents the arguments to construct a new transaction // or a message call. type TransactionArgs struct { - Type *hexutil.Uint64 `json:"type,omitempty"` + Type *hexutil.Uint64 `json:"type,omitempty"` From *common.Address `json:"from"` To *common.Address `json:"to"` @@ -75,21 +75,21 @@ type TransactionArgs struct { } func (args *TransactionArgs) inferTxType(defaultType int) int { - usedType := types.LegacyTxType - switch { - case args.AuthorizationList != nil || defaultType == types.SetCodeTxType: - usedType = types.SetCodeTxType - case args.BlobHashes != nil || defaultType == types.BlobTxType: - usedType = types.BlobTxType - case args.MaxFeePerGas != nil || defaultType == types.DynamicFeeTxType: - usedType = types.DynamicFeeTxType - case args.AccessList != nil || defaultType == types.AccessListTxType: - usedType = types.AccessListTxType - } - if args.GasPrice != nil { - usedType = types.LegacyTxType - } - return usedType + usedType := types.LegacyTxType + switch { + case args.AuthorizationList != nil || defaultType == types.SetCodeTxType: + usedType = types.SetCodeTxType + case args.BlobHashes != nil || defaultType == types.BlobTxType: + usedType = types.BlobTxType + case args.MaxFeePerGas != nil || defaultType == types.DynamicFeeTxType: + usedType = types.DynamicFeeTxType + case args.AccessList != nil || defaultType == types.AccessListTxType: + usedType = types.AccessListTxType + } + if args.GasPrice != nil { + usedType = types.LegacyTxType + } + return usedType } // from retrieves the transaction sender address.