File tree Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Expand file tree Collapse file tree 3 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -77,3 +77,42 @@ def new_access_list_transaction(
77
77
)
78
78
79
79
return tx .as_signed_transaction (private_key )
80
+
81
+
82
+ @curry
83
+ def new_fee_burn_transaction (
84
+ vm ,
85
+ from_ ,
86
+ to ,
87
+ private_key ,
88
+ amount = 0 ,
89
+ max_priority_fee_per_gas = 1 ,
90
+ max_fee_per_gas = 10 ** 10 ,
91
+ gas = 100000 ,
92
+ data = b'' ,
93
+ nonce = None ,
94
+ chain_id = 1 ,
95
+ access_list = None ):
96
+ """
97
+ Create and return a transaction sending amount from <from_> to <to>.
98
+
99
+ The transaction will be signed with the given private key.
100
+ """
101
+ if nonce is None :
102
+ nonce = vm .state .get_nonce (from_ )
103
+ if access_list is None :
104
+ access_list = []
105
+
106
+ tx = vm .get_transaction_builder ().new_unsigned_fee_burn_transaction (
107
+ chain_id = chain_id ,
108
+ nonce = nonce ,
109
+ max_priority_fee_per_gas = max_priority_fee_per_gas ,
110
+ max_fee_per_gas = max_fee_per_gas ,
111
+ gas = gas ,
112
+ to = to ,
113
+ value = amount ,
114
+ data = data ,
115
+ access_list = access_list ,
116
+ )
117
+
118
+ return tx .as_signed_transaction (private_key )
Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ class LondonTransactionBuilder(BerlinTransactionBuilder):
224
224
legacy_unsigned = LondonUnsignedLegacyTransaction
225
225
226
226
@classmethod
227
- def new_unsigned_base_gas_price_transaction (
227
+ def new_unsigned_fee_burn_transaction (
228
228
cls ,
229
229
chain_id : int ,
230
230
nonce : int ,
@@ -249,7 +249,7 @@ def new_unsigned_base_gas_price_transaction(
249
249
return transaction
250
250
251
251
@classmethod
252
- def new_base_gas_price_transaction (
252
+ def new_fee_burn_transaction (
253
253
cls ,
254
254
chain_id : int ,
255
255
nonce : int ,
Original file line number Diff line number Diff line change @@ -38,7 +38,7 @@ def validate_london_normalized_transaction(
38
38
)
39
39
40
40
effective_gas_price = priority_fee_per_gas + base_fee_per_gas
41
- total_transaction_cost = transaction .value + effective_gas_price
41
+ total_transaction_cost = transaction .value + effective_gas_price * transaction . gas
42
42
43
43
if sender_balance < total_transaction_cost :
44
44
raise ValidationError (
You can’t perform that action at this time.
0 commit comments