Skip to content

Commit

Permalink
feat(core): Allow disabling gas price overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
RPate97 committed Jan 4, 2024
1 parent 70e3e08 commit 187c913
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/slimy-toes-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sphinx-labs/core': patch
---

Allow disabling gas price overrides
7 changes: 7 additions & 0 deletions packages/core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,13 @@ export const getGasPriceOverrides = async (
signer: ethers.Signer,
overridden: ethers.TransactionRequest = {}
): Promise<ethers.TransactionRequest> => {
// Allows us to test cases where we execute deployments using wallets with normal amounts of funds on local networks.
// If we do not disable this function using the env variable, then the gas limit will be set extremely high which
// will cause transactions to fail for wallets with normal amounts of funds.
if (process.env.SPHINX_INTERNAL__DISABLE_GAS_PRICE_OVERRIDES) {
return overridden
}

const [block, isLiveNetwork_, feeData, network] = await Promise.all([
provider.getBlock('latest'),
isLiveNetwork(provider),
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/script/Sample.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract Sample is Sphinx {
MyContract1 myContract;

function setUp() public {
sphinxConfig.projectName = "test project";
sphinxConfig.projectName = "test_project";
sphinxConfig.owners = [0x9fd58Bf0F2E6125Ffb0CBFa9AE91893Dbc1D5c51];
sphinxConfig.threshold = 1;
sphinxConfig.testnets = [Network.sepolia, Network.arbitrum_sepolia];
Expand Down

0 comments on commit 187c913

Please sign in to comment.