@@ -166,7 +166,14 @@ func initFeesServer(t *testing.T, backtraceLimit int, fixedCacheSize int, number
166166 Clause (cla ).
167167 BlockRef (tx .NewBlockRef (uint32 (i ))).
168168 Build ()
169- require .NoError (t , thorChain .MintBlock (genesis .DevAccounts ()[0 ], tx .MustSign (trx1 , genesis .DevAccounts ()[0 ].PrivateKey ), tx .MustSign (trx2 , genesis .DevAccounts ()[0 ].PrivateKey )))
169+ require .NoError (
170+ t ,
171+ thorChain .MintBlock (
172+ genesis .DevAccounts ()[0 ],
173+ tx .MustSign (trx1 , genesis .DevAccounts ()[0 ].PrivateKey ),
174+ tx .MustSign (trx2 , genesis .DevAccounts ()[0 ].PrivateKey ),
175+ ),
176+ )
170177 }
171178
172179 allBlocks , err := thorChain .GetAllBlocks ()
@@ -188,9 +195,13 @@ func getFeeHistoryWithSummaries(t *testing.T, tclient *thorclient.Client, bestch
188195 expectedOldestBlock , err := bestchain .GetBlockID (2 )
189196 require .NoError (t , err )
190197 expectedFeesHistory := api.FeesHistory {
191- OldestBlock : expectedOldestBlock ,
192- BaseFeePerGas : []* hexutil.Big {(* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee ))},
193- GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio },
198+ OldestBlock : expectedOldestBlock ,
199+ BaseFeePerGas : []* hexutil.Big {
200+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
201+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
202+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
203+ },
204+ GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio },
194205 }
195206 assert .Equal (t , expectedFeesHistory , feesHistory )
196207}
@@ -233,9 +244,14 @@ func getFeeHistoryBestBlock(t *testing.T, tclient *thorclient.Client, bestchain
233244 expectedOldestBlock , err := bestchain .GetBlockID (6 )
234245 require .NoError (t , err )
235246 expectedFeesHistory := api.FeesHistory {
236- OldestBlock : expectedOldestBlock ,
237- BaseFeePerGas : []* hexutil.Big {(* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee ))},
238- GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio },
247+ OldestBlock : expectedOldestBlock ,
248+ BaseFeePerGas : []* hexutil.Big {
249+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
250+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
251+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
252+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
253+ },
254+ GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , expectedGasPriceUsedRatio },
239255 }
240256
241257 assert .Equal (t , expectedFeesHistory , feesHistory )
@@ -414,9 +430,13 @@ func getFeeHistoryNextBlock(t *testing.T, tclient *thorclient.Client, bestchain
414430 expectedOldestBlock , err := bestchain .GetBlockID (8 )
415431 require .NoError (t , err )
416432 expectedFeesHistory := api.FeesHistory {
417- OldestBlock : expectedOldestBlock ,
418- BaseFeePerGas : []* hexutil.Big {(* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee )), (* hexutil .Big )(big .NewInt (expectedBaseFee ))},
419- GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , 0 },
433+ OldestBlock : expectedOldestBlock ,
434+ BaseFeePerGas : []* hexutil.Big {
435+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
436+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
437+ (* hexutil .Big )(big .NewInt (expectedBaseFee )),
438+ },
439+ GasUsedRatio : []float64 {expectedGasPriceUsedRatio , expectedGasPriceUsedRatio , 0 },
420440 }
421441
422442 assert .Equal (t , expectedFeesHistory , feesHistory )
@@ -453,7 +473,9 @@ func getFeePriority(t *testing.T, tclient *thorclient.Client, bestchain *chain.C
453473 }
454474
455475 expectedFeesPriority := api.FeesPriority {
456- MaxPriorityFeePerGas : (* hexutil .Big )(new (big.Int ).Div (new (big.Int ).Mul (big .NewInt (thor .InitialBaseFee ), big .NewInt (priorityFeesPercentage )), big .NewInt (100 ))),
476+ MaxPriorityFeePerGas : (* hexutil .Big )(
477+ new (big.Int ).Div (new (big.Int ).Mul (big .NewInt (thor .InitialBaseFee ), big .NewInt (priorityFeesPercentage )), big .NewInt (100 )),
478+ ),
457479 }
458480
459481 assert .Equal (t , expectedFeesPriority , feesPriority )
0 commit comments