@@ -6,8 +6,8 @@ const web3 = conf.web3
66
77it ( 'should update the value of eth_gasPrice' , async ( ) => {
88 let gasPrice = await web3 . eth . getGasPrice ( )
9- // The surge factor was set to 2 .0
10- assert . equal ( gasPrice , 2n * conf . minGasPrice )
9+ // The surge factor was last set to 100 .0
10+ assert . equal ( gasPrice , 100n * conf . minGasPrice )
1111} )
1212
1313it ( 'should update the value of eth_MaxPriorityFeePerGas' , async ( ) => {
@@ -18,17 +18,17 @@ it('should update the value of eth_MaxPriorityFeePerGas', async () => {
1818 assert . equal ( response . status , 200 )
1919 assert . isDefined ( response . body . result )
2020 let maxPriorityFeePerGas = utils . hexToNumber ( response . body . result )
21- // The surge factor was set to 2 .0
22- assert . equal ( maxPriorityFeePerGas , 2n * conf . minGasPrice )
21+ // The surge factor was last set to 100 .0
22+ assert . equal ( maxPriorityFeePerGas , 100n * conf . minGasPrice )
2323} )
2424
2525it ( 'should reject transactions with gas price lower than the updated value' , async ( ) => {
2626 let receiver = web3 . eth . accounts . create ( )
2727 let transferValue = utils . toWei ( '2.5' , 'ether' )
2828
2929 let gasPrice = await web3 . eth . getGasPrice ( )
30- // The surge factor was set to 2 .0
31- assert . equal ( gasPrice , 2n * conf . minGasPrice )
30+ // The surge factor was last set to 100 .0
31+ assert . equal ( gasPrice , 100n * conf . minGasPrice )
3232
3333 // assert that the minimum acceptable gas price
3434 // has been multiplied by the surge factor
@@ -54,8 +54,8 @@ it('should accept transactions with the updated gas price', async () => {
5454 let transferValue = utils . toWei ( '2.5' , 'ether' )
5555
5656 let gasPrice = await web3 . eth . getGasPrice ( )
57- // The surge factor was set to 2 .0
58- assert . equal ( gasPrice , 2n * conf . minGasPrice )
57+ // The surge factor was last set to 100 .0
58+ assert . equal ( gasPrice , 100n * conf . minGasPrice )
5959
6060 let transfer = await helpers . signAndSend ( {
6161 from : conf . eoa . address ,
@@ -79,3 +79,28 @@ it('should accept transactions with the updated gas price', async () => {
7979 let coinbaseFeesTx = await web3 . eth . getTransactionFromBlock ( latestBlockNumber , 1 )
8080 assert . equal ( coinbaseFeesTx . value , transferTxReceipt . gasUsed * gasPrice )
8181} )
82+
83+ it ( 'should update gas price for eth_feeFistory' , async ( ) => {
84+ let response = await web3 . eth . getFeeHistory ( 10 , 'latest' , [ 20 ] )
85+ console . log ( 'Response: ' , response )
86+
87+ assert . deepEqual (
88+ response ,
89+ {
90+ oldestBlock : 1n ,
91+ reward : [
92+ [ '0x3a98' ] , // 100 * gas price = 15000
93+ [ '0x3a98' ] , // 100 * gas price = 15000
94+ [ '0x3a98' ] , // 100 * gas price = 15000
95+ [ '0x3a98' ] , // 100 * gas price = 15000
96+ [ '0x3a98' ] , // 100 * gas price = 15000
97+ [ '0x3a98' ] , // 100 * gas price = 15000
98+ [ '0x3a98' ] , // 100 * gas price = 15000
99+ [ '0x3a98' ] , // 100 * gas price = 15000
100+ [ '0x3a98' ] , // 100 * gas price = 15000
101+ ] ,
102+ baseFeePerGas : [ 1n , 1n , 1n , 1n , 1n , 1n , 1n , 1n , 1n ] ,
103+ gasUsedRatio : [ 0 , 0.006205458333333334 , 0 , 0 , 0 , 0 , 0 , 0 , 0.00035 ]
104+ }
105+ )
106+ } )
0 commit comments