File tree 3 files changed +6
-6
lines changed
3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ interface _Block {
71
71
miner : string ;
72
72
extraData : string ;
73
73
74
- baseFee ?: null | BigNumber ;
74
+ baseFeePerGas ?: null | BigNumber ;
75
75
}
76
76
77
77
export interface Block extends _Block {
@@ -238,12 +238,12 @@ export abstract class Provider implements OnceBlockable {
238
238
239
239
let maxFeePerGas = null , maxPriorityFeePerGas = null ;
240
240
241
- if ( block && block . baseFee ) {
241
+ if ( block && block . baseFeePerGas ) {
242
242
// We may want to compute this more accurately in the future,
243
243
// using the formula "check if the base fee is correct".
244
244
// See: https://eips.ethereum.org/EIPS/eip-1559
245
245
maxPriorityFeePerGas = BigNumber . from ( "1000000000" ) ;
246
- maxFeePerGas = block . baseFee . mul ( 2 ) . add ( maxPriorityFeePerGas ) ;
246
+ maxFeePerGas = block . baseFeePerGas . mul ( 2 ) . add ( maxPriorityFeePerGas ) ;
247
247
}
248
248
249
249
return { maxFeePerGas, maxPriorityFeePerGas, gasPrice } ;
Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ export class Formatter {
145
145
146
146
transactions : Formatter . allowNull ( Formatter . arrayOf ( hash ) ) ,
147
147
148
- baseFee : Formatter . allowNull ( bigNumber )
148
+ baseFeePerGas : Formatter . allowNull ( bigNumber )
149
149
} ;
150
150
151
151
formats . blockWithTransactions = shallowCopy ( formats . block ) ;
Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ function _parseEip1559(payload: Uint8Array): Transaction {
362
362
nonce : handleNumber ( transaction [ 1 ] ) . toNumber ( ) ,
363
363
maxPriorityFeePerGas : maxPriorityFeePerGas ,
364
364
maxFeePerGas : maxFeePerGas ,
365
- gasPrice : maxPriorityFeePerGas . add ( maxFeePerGas ) ,
365
+ gasPrice : maxFeePerGas ,
366
366
gasLimit : handleNumber ( transaction [ 4 ] ) ,
367
367
to : handleAddress ( transaction [ 5 ] ) ,
368
368
value : handleNumber ( transaction [ 6 ] ) ,
@@ -375,7 +375,7 @@ function _parseEip1559(payload: Uint8Array): Transaction {
375
375
376
376
tx . hash = keccak256 ( payload ) ;
377
377
378
- _parseEipSignature ( tx , transaction . slice ( 9 ) , _serializeEip2930 ) ;
378
+ _parseEipSignature ( tx , transaction . slice ( 9 ) , _serializeEip1559 ) ;
379
379
380
380
return tx ;
381
381
}
You can’t perform that action at this time.
0 commit comments