53
53
ISTANBUL_TX_GAS_SCHEDULE ,
54
54
)
55
55
56
- from .constants import BASE_GAS_FEE_TRANSACTION_TYPE
56
+ from .constants import DYNAMIC_FEE_TRANSACTION_TYPE
57
57
58
58
59
59
class LondonLegacyTransaction (BerlinLegacyTransaction ):
@@ -78,8 +78,8 @@ def as_signed_transaction(self,
78
78
)
79
79
80
80
81
- class UnsignedBaseGasFeeTransaction (rlp .Serializable ):
82
- _type_id = BASE_GAS_FEE_TRANSACTION_TYPE
81
+ class UnsignedDynamicFeeTransaction (rlp .Serializable ):
82
+ _type_id = DYNAMIC_FEE_TRANSACTION_TYPE
83
83
fields = [
84
84
('chain_id' , big_endian_int ),
85
85
('nonce' , big_endian_int ),
@@ -105,7 +105,7 @@ def as_signed_transaction(self, private_key: PrivateKey) -> 'TypedTransaction':
105
105
signature = private_key .sign_msg (message )
106
106
y_parity , r , s = signature .vrs
107
107
108
- signed_transaction = BaseGasFeeTransaction (
108
+ signed_transaction = DynamicFeeTransaction (
109
109
self .chain_id ,
110
110
self .nonce ,
111
111
self .max_priority_fee_per_gas ,
@@ -122,8 +122,8 @@ def as_signed_transaction(self, private_key: PrivateKey) -> 'TypedTransaction':
122
122
return LondonTypedTransaction (self ._type_id , signed_transaction )
123
123
124
124
125
- class BaseGasFeeTransaction (rlp .Serializable , SignedTransactionMethods , SignedTransactionAPI ):
126
- _type_id = BASE_GAS_FEE_TRANSACTION_TYPE
125
+ class DynamicFeeTransaction (rlp .Serializable , SignedTransactionMethods , SignedTransactionAPI ):
126
+ _type_id = DYNAMIC_FEE_TRANSACTION_TYPE
127
127
fields = [
128
128
('chain_id' , big_endian_int ),
129
129
('nonce' , big_endian_int ),
@@ -141,14 +141,15 @@ class BaseGasFeeTransaction(rlp.Serializable, SignedTransactionMethods, SignedTr
141
141
142
142
@property
143
143
def gas_price (self ) -> None :
144
- # maybe add a warning, or raise an exception instead?
145
- return None
144
+ raise AttributeError (
145
+ "Gas price is no longer available. See max_priority_fee_per_gas or max_fee_per_gas"
146
+ )
146
147
147
148
def get_sender (self ) -> Address :
148
149
return extract_transaction_sender (self )
149
150
150
151
def get_message_for_signing (self ) -> bytes :
151
- unsigned = UnsignedBaseGasFeeTransaction (
152
+ unsigned = UnsignedDynamicFeeTransaction (
152
153
self .chain_id ,
153
154
self .nonce ,
154
155
self .max_priority_fee_per_gas ,
@@ -206,16 +207,16 @@ def make_receipt(
206
207
)
207
208
208
209
209
- class BaseGasFeePayloadDecoder (TransactionDecoderAPI ):
210
+ class DynamicFeePayloadDecoder (TransactionDecoderAPI ):
210
211
@classmethod
211
212
def decode (cls , payload : bytes ) -> SignedTransactionAPI :
212
- return rlp .decode (payload , sedes = BaseGasFeeTransaction )
213
+ return rlp .decode (payload , sedes = DynamicFeeTransaction )
213
214
214
215
215
216
class LondonTypedTransaction (TypedTransaction ):
216
217
decoders : Dict [int , Type [TransactionDecoderAPI ]] = {
217
218
ACCESS_LIST_TRANSACTION_TYPE : AccessListPayloadDecoder ,
218
- BASE_GAS_FEE_TRANSACTION_TYPE : BaseGasFeePayloadDecoder ,
219
+ DYNAMIC_FEE_TRANSACTION_TYPE : DynamicFeePayloadDecoder ,
219
220
}
220
221
221
222
@@ -225,7 +226,7 @@ class LondonTransactionBuilder(BerlinTransactionBuilder):
225
226
typed_transaction = LondonTypedTransaction
226
227
227
228
@classmethod
228
- def new_unsigned_fee_burn_transaction (
229
+ def new_unsigned_dynamic_fee_transaction (
229
230
cls ,
230
231
chain_id : int ,
231
232
nonce : int ,
@@ -236,7 +237,7 @@ def new_unsigned_fee_burn_transaction(
236
237
value : int ,
237
238
data : bytes ,
238
239
access_list : Sequence [Tuple [Address , Sequence [int ]]],) -> LondonTypedTransaction :
239
- transaction = UnsignedBaseGasFeeTransaction (
240
+ transaction = UnsignedDynamicFeeTransaction (
240
241
chain_id ,
241
242
nonce ,
242
243
max_priority_fee_per_gas ,
@@ -250,7 +251,7 @@ def new_unsigned_fee_burn_transaction(
250
251
return transaction
251
252
252
253
@classmethod
253
- def new_fee_burn_transaction (
254
+ def new_dynamic_fee_transaction (
254
255
cls ,
255
256
chain_id : int ,
256
257
nonce : int ,
@@ -264,7 +265,7 @@ def new_fee_burn_transaction(
264
265
y_parity : int ,
265
266
r : int ,
266
267
s : int ) -> LondonTypedTransaction :
267
- transaction = BaseGasFeeTransaction (
268
+ transaction = DynamicFeeTransaction (
268
269
chain_id ,
269
270
nonce ,
270
271
max_priority_fee_per_gas ,
@@ -278,4 +279,4 @@ def new_fee_burn_transaction(
278
279
r ,
279
280
s ,
280
281
)
281
- return LondonTypedTransaction (BASE_GAS_FEE_TRANSACTION_TYPE , transaction )
282
+ return LondonTypedTransaction (DYNAMIC_FEE_TRANSACTION_TYPE , transaction )
0 commit comments