@@ -3,24 +3,36 @@ import { expectTypeOf, test } from 'vitest'
33import { estimateFeesPerGas } from './estimateFeesPerGas.js'
44
55test ( 'types' , async ( ) => {
6- const default_ = await estimateFeesPerGas ( config )
7- expectTypeOf ( default_ ) . toMatchTypeOf < {
8- gasPrice ?: undefined
9- maxFeePerGas : bigint
10- maxPriorityFeePerGas : bigint
11- } > ( )
6+ // default
7+ {
8+ const result = await estimateFeesPerGas ( config , { } )
9+ expectTypeOf ( result ) . toEqualTypeOf < {
10+ gasPrice ?: undefined
11+ maxFeePerBlobGas ?: undefined
12+ maxFeePerGas : bigint
13+ maxPriorityFeePerGas : bigint
14+ } > ( )
15+ }
1216
13- const legacy = await estimateFeesPerGas ( config , { type : 'legacy' } )
14- expectTypeOf ( legacy ) . toMatchTypeOf < {
15- gasPrice : bigint
16- maxFeePerGas ?: undefined
17- maxPriorityFeePerGas ?: undefined
18- } > ( )
17+ // legacy
18+ {
19+ const result = await estimateFeesPerGas ( config , { type : 'legacy' } )
20+ expectTypeOf ( result ) . toEqualTypeOf < {
21+ gasPrice : bigint
22+ maxFeePerBlobGas ?: undefined
23+ maxFeePerGas ?: undefined
24+ maxPriorityFeePerGas ?: undefined
25+ } > ( )
26+ }
1927
20- const eip1559 = await estimateFeesPerGas ( config , { type : 'eip1559' } )
21- expectTypeOf ( eip1559 ) . toMatchTypeOf < {
22- gasPrice ?: undefined
23- maxFeePerGas : bigint
24- maxPriorityFeePerGas : bigint
25- } > ( )
28+ // eip1559
29+ {
30+ const result = await estimateFeesPerGas ( config , { type : 'eip1559' } )
31+ expectTypeOf ( result ) . toEqualTypeOf < {
32+ gasPrice ?: undefined
33+ maxFeePerBlobGas ?: undefined
34+ maxFeePerGas : bigint
35+ maxPriorityFeePerGas : bigint
36+ } > ( )
37+ }
2638} )
0 commit comments