Skip to content

Commit

Permalink
fix carbon vortex deployment tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanzhelyazkov committed Oct 7, 2024
1 parent a6a2f50 commit 51d57d3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion deploy/tests/mainnet/0004-fee-burner.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CarbonController, CarbonVortex, ProxyAdmin } from '../../../components/Contracts';
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy';
import { ZERO_ADDRESS } from '../../../utils/Constants';
import { expect } from 'chai';
import { ethers } from 'hardhat';

Expand Down Expand Up @@ -33,7 +34,7 @@ describeDeployment(__filename, () => {
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonVortex.address);
const carbonVortexImpl: CarbonVortex = await ethers.getContractAt('CarbonVortex', implementationAddress);
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonVortexImpl.initialize({ gasLimit: 6000000 });
const tx = await carbonVortexImpl.initialize(ZERO_ADDRESS, { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});
});
3 changes: 2 additions & 1 deletion deploy/tests/mainnet/0006-carbon-vortex-upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ZERO_ADDRESS } from '../../../utils/Constants';
import { CarbonController, CarbonVortex, ProxyAdmin } from '../../../components/Contracts';
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy';
import { expect } from 'chai';
Expand Down Expand Up @@ -38,7 +39,7 @@ describeDeployment(__filename, () => {
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonVortex.address);
const carbonVortexImpl: CarbonVortex = await ethers.getContractAt('CarbonVortex', implementationAddress);
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonVortexImpl.initialize({ gasLimit: 6000000 });
const tx = await carbonVortexImpl.initialize(ZERO_ADDRESS, { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});
});
3 changes: 2 additions & 1 deletion deploy/tests/mainnet/0012-carbon-vortex-upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CarbonController, CarbonVortex, ProxyAdmin } from '../../../components/Contracts';
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy';
import { ZERO_ADDRESS } from '../../../utils/Constants';
import { expect } from 'chai';
import { ethers } from 'hardhat';

Expand Down Expand Up @@ -38,7 +39,7 @@ describeDeployment(__filename, () => {
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonVortex.address);
const carbonVortexImpl: CarbonVortex = await ethers.getContractAt('CarbonVortex', implementationAddress);
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonVortexImpl.initialize({ gasLimit: 6000000 });
const tx = await carbonVortexImpl.initialize(ZERO_ADDRESS, { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});
});
3 changes: 2 additions & 1 deletion deploy/tests/mainnet/0016-carbon-vortex-upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CarbonVortex, ProxyAdmin } from '../../../components/Contracts';
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy';
import { ZERO_ADDRESS } from '../../../utils/Constants';
import { expect } from 'chai';
import { ethers } from 'hardhat';

Expand All @@ -21,7 +22,7 @@ describeDeployment(__filename, () => {
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonVortex.address);
const carbonControllerImpl: CarbonVortex = await ethers.getContractAt('CarbonVortex', implementationAddress);
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonControllerImpl.initialize({ gasLimit: 6000000 });
const tx = await carbonControllerImpl.initialize(ZERO_ADDRESS, { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});

Expand Down
3 changes: 2 additions & 1 deletion deploy/tests/mainnet/0017-carbon-vortex-upgrade.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { CarbonVortex, ProxyAdmin } from '../../../components/Contracts';
import { DeployedContracts, describeDeployment } from '../../../utils/Deploy';
import { ZERO_ADDRESS } from '../../../utils/Constants';
import { expect } from 'chai';
import { ethers } from 'hardhat';

Expand All @@ -21,7 +22,7 @@ describeDeployment(__filename, () => {
const implementationAddress = await proxyAdmin.getProxyImplementation(carbonVortex.address);
const carbonControllerImpl: CarbonVortex = await ethers.getContractAt('CarbonVortex', implementationAddress);
// hardcoding gas limit to avoid gas estimation attempts (which get rejected instead of reverted)
const tx = await carbonControllerImpl.initialize({ gasLimit: 6000000 });
const tx = await carbonControllerImpl.initialize(ZERO_ADDRESS, { gasLimit: 6000000 });
await expect(tx.wait()).to.be.reverted;
});

Expand Down

0 comments on commit 51d57d3

Please sign in to comment.