Skip to content

Commit 3286bed

Browse files
committed
support network that do not provide an extra baseFeePerGas value (somnia)
1 parent 0afe7e0 commit 3286bed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

v-next/hardhat/src/internal/builtin-plugins/network-manager/request-handlers/handlers/gas/automatic-gas-price-handler.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,9 @@ export class AutomaticGasPriceHandler implements RequestHandler {
200200
// next N blocks here.
201201

202202
maxFeePerGas:
203-
(hexStringToBigInt(response.baseFeePerGas[1]) *
203+
(hexStringToBigInt(
204+
response.baseFeePerGas[response.baseFeePerGas.length - 1],
205+
) *
204206
9n **
205207
(AutomaticGasPriceHandler.EIP1559_BASE_FEE_MAX_FULL_BLOCKS_PREFERENCE -
206208
1n)) /

0 commit comments

Comments
 (0)