Skip to content

Commit

Permalink
Support config.gasPrice
Browse files Browse the repository at this point in the history
  • Loading branch information
orenyomtov committed Feb 12, 2024
1 parent 6de3f01 commit 7c8c217
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { BackwardsCompatibilityProviderAdapter } from "hardhat/internal/core/pro
import {
AutomaticGasPriceProvider,
AutomaticGasProvider,
FixedGasPriceProvider,
} from "hardhat/internal/core/providers/gas-providers";
import { HttpProvider } from "hardhat/internal/core/providers/http";
import {
Expand Down Expand Up @@ -68,7 +69,11 @@ extendEnvironment((hre) => {
wrappedProvider,
hre.network.config.gasMultiplier
);
wrappedProvider = new AutomaticGasPriceProvider(wrappedProvider);
if (hre.network.config.gasPrice === undefined || hre.network.config.gasPrice === "auto") {
wrappedProvider = new AutomaticGasPriceProvider(wrappedProvider);
} else {
wrappedProvider = new FixedGasPriceProvider(wrappedProvider, hre.network.config.gasPrice);
}
hre.network.provider = new BackwardsCompatibilityProviderAdapter(
wrappedProvider
);
Expand Down

0 comments on commit 7c8c217

Please sign in to comment.