@@ -19,7 +19,7 @@ defmodule Ethers.Transaction do
19
19
gas_price: nil ,
20
20
hash: nil ,
21
21
max_fee_per_gas: nil ,
22
- max_priority_fee_per_gas: "0x0" ,
22
+ max_priority_fee_per_gas: nil ,
23
23
nonce: nil ,
24
24
signature_r: nil ,
25
25
signature_s: nil ,
@@ -58,7 +58,7 @@ defmodule Ethers.Transaction do
58
58
@ common_fillable_params [ :chain_id , :nonce ]
59
59
@ type_fillable_params % {
60
60
legacy: [ :gas_price ] ,
61
- eip1559: [ :max_fee_per_gas ]
61
+ eip1559: [ :max_fee_per_gas , :max_priority_fee_per_gas ]
62
62
}
63
63
@ integer_type_values [
64
64
:block_number ,
@@ -231,6 +231,7 @@ defmodule Ethers.Transaction do
231
231
defp fill_action ( :chain_id , _tx ) , do: :chain_id
232
232
defp fill_action ( :nonce , tx ) , do: { :get_transaction_count , [ tx . from , "latest" ] }
233
233
defp fill_action ( :max_fee_per_gas , _tx ) , do: :gas_price
234
+ defp fill_action ( :max_priority_fee_per_gas , _tx ) , do: :max_priority_fee_per_gas
234
235
defp fill_action ( :gas_price , _tx ) , do: :gas_price
235
236
236
237
defp post_process ( [ ] , [ ] , acc ) , do: { :ok , Enum . into ( acc , % { } ) }
@@ -251,6 +252,11 @@ defmodule Ethers.Transaction do
251
252
end
252
253
end
253
254
255
+ defp do_post_process ( :max_priority_fee_per_gas , { :ok , v_int } ) do
256
+ # use latest max_priority_fee_per_gas from the chain as default
257
+ { :ok , { :max_priority_fee_per_gas , Utils . integer_to_hex ( v_int ) } }
258
+ end
259
+
254
260
defp do_post_process ( key , { :ok , v_hex } ) do
255
261
{ :ok , { key , v_hex } }
256
262
end
0 commit comments