Skip to content

Commit

Permalink
update deps and fix __SOLIDITY_COVERAGE_RUNNING
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenSwen committed Mar 28, 2023
1 parent 3b013e5 commit c551c29
Show file tree
Hide file tree
Showing 6 changed files with 671 additions and 880 deletions.
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dotenv.config();

declare module 'hardhat/types/runtime' {
interface HardhatRuntimeEnvironment {
__SOLIDITY_COVERAGE_RUNNING?: boolean;
__SOLIDITY_COVERAGE_RUNNING?: boolean | undefined;
}
}

Expand Down
56 changes: 28 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,50 +28,50 @@
"typechain": "hardhat typechain"
},
"dependencies": {
"@metamask/eth-sig-util": "4.0.1",
"@nomicfoundation/hardhat-network-helpers": "1.0.6",
"@nomiclabs/hardhat-ethers": "2.1.1",
"@openzeppelin/contracts": "4.7.3",
"@metamask/eth-sig-util": "5.0.2",
"@nomicfoundation/hardhat-network-helpers": "1.0.8",
"@nomiclabs/hardhat-ethers": "2.2.2",
"@openzeppelin/contracts": "4.8.2",
"@uniswap/permit2-sdk": "^1.2.0",
"ethereumjs-util": "7.1.5",
"ethers": "5.7.1"
"ethers": "5.7.2"
},
"devDependencies": {
"@nomicfoundation/hardhat-chai-matchers": "1.0.3",
"@typechain/ethers-v5": "10.1.0",
"@typechain/hardhat": "6.1.3",
"@types/chai": "4.3.3",
"@nomicfoundation/hardhat-chai-matchers": "1.0.6",
"@typechain/ethers-v5": "10.2.0",
"@typechain/hardhat": "6.1.5",
"@types/chai": "4.3.4",
"@types/eth-sig-util": "2.1.1",
"@types/ethereumjs-util": "6.1.0",
"@types/mocha": "9.1.1",
"@types/node": "18.7.21",
"@typescript-eslint/eslint-plugin": "5.38.0",
"@typescript-eslint/parser": "5.38.0",
"acquit": "1.2.1",
"chai": "4.3.6",
"commander": "9.4.0",
"@types/mocha": "10.0.1",
"@types/node": "18.15.10",
"@typescript-eslint/eslint-plugin": "5.57.0",
"@typescript-eslint/parser": "5.57.0",
"acquit": "1.3.0",
"chai": "4.3.7",
"commander": "10.0.0",
"create-ts-index": "1.14.0",
"cross-spawn": "7.0.3",
"dotenv": "16.0.2",
"eslint": "8.23.1",
"dotenv": "16.0.3",
"eslint": "8.36.0",
"eslint-config-standard": "17.0.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-n": "15.2.5",
"eslint-plugin-promise": "6.0.1",
"eslint-plugin-import": "2.27.5",
"eslint-plugin-n": "15.6.1",
"eslint-plugin-promise": "6.1.1",
"eslint-plugin-standard": "5.0.0",
"ethereumjs-wallet": "1.0.2",
"hardhat": "2.12.8-viair.0",
"hardhat": "2.13.0",
"hardhat-gas-reporter": "1.0.9",
"hardhat-tracer": "2.1.2",
"prettier": "2.7.1",
"prettier-plugin-solidity": "1.0.0-beta.24",
"rimraf": "3.0.2",
"prettier": "2.8.7",
"prettier-plugin-solidity": "1.1.3",
"rimraf": "4.4.1",
"shx": "0.3.4",
"solhint": "3.3.7",
"solhint": "3.4.1",
"solidity-coverage": "0.8.2",
"ts-node": "10.9.1",
"typechain": "8.1.0",
"typescript": "4.8.3"
"typechain": "8.1.1",
"typescript": "5.0.2"
},
"bin": {
"solidity-utils-docify": "utils/docify.utils.js",
Expand Down
4 changes: 2 additions & 2 deletions test/contracts/SafestERC20.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ describe('SafeERC20', function () {
wrapper.deposit({ value: ether('1') }),
);
expect(received).to.be.equal(ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await countInstructions(ethers.provider, tx.events[0].transactionHash, ['STATICCALL', 'CALL', 'MSTORE', 'MLOAD', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 1, 6, 3, 1, 2,
]);
Expand All @@ -272,7 +272,7 @@ describe('SafeERC20', function () {
const [, tx] = await trackReceivedTokenAndTx(ethers.provider, weth, wrapper.address, () =>
wrapper.deposit(),
);
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await countInstructions(ethers.provider, tx.transactionHash, ['STATICCALL', 'CALL', 'MSTORE', 'MLOAD', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 0, 1, 1, 0, 1,
]);
Expand Down
10 changes: 5 additions & 5 deletions test/profileEVM.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('trace inspection', function () {
const { usdt } = await loadFixture(deployUSDT);

const txn = await usdt.transfer(signer2.address, ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await profileEVM(ethers.provider, txn.hash, ['STATICCALL', 'CALL', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 0, 2, 2,
]);
Expand All @@ -37,7 +37,7 @@ describe('trace inspection', function () {
const { usdt } = await loadFixture(deployUSDT);

const txn = await usdt.approve(signer2.address, ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await profileEVM(ethers.provider, txn.hash, ['STATICCALL', 'CALL', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 0, 1, 0,
]);
Expand All @@ -63,7 +63,7 @@ describe('trace inspection', function () {
const { usdt } = await loadFixture(deployUSDT);

const txn = await usdt.approve(signer2.address, ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await gasspectEVM(ethers.provider, txn.hash)).to.be.deep.equal(['0-0-SSTORE_I = 22100', '0-0-LOG3 = 1756']);
}
});
Expand All @@ -84,7 +84,7 @@ describe('trace inspection', function () {
const { usdt } = await loadFixture(deployUSDT);

const txn = await usdt.transfer(signer2.address, ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await gasspectEVM(ethers.provider, txn.hash, { args: true })).to.be.deep.equal([
'0-0-SLOAD(0x723077b8a1b173adc35e5f0e7e3662fd1208212cb629f9c128551ea7168da722) = 2100',
'0-0-SSTORE(0x723077b8a1b173adc35e5f0e7e3662fd1208212cb629f9c128551ea7168da722,0x00000000000000000000000000000000000000000000003627e8f712373c0000) = 2900',
Expand All @@ -99,7 +99,7 @@ describe('trace inspection', function () {
const { usdt } = await loadFixture(deployUSDT);

const txn = await usdt.transfer(signer2.address, ether('1'));
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await gasspectEVM(ethers.provider, txn.hash, { res: true })).to.be.deep.equal([
'0-0-SLOAD:0x00000000000000000000000000000000000000000000003635c9adc5dea00000 = 2100',
'0-0-SSTORE = 2900',
Expand Down
6 changes: 3 additions & 3 deletions test/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('timeIncreaseTo', function () {

it('should be thrown with increase time to a moment in the past', async function () {
await expect(shouldIncrease(-1000)).to.be.rejectedWith(
/Invalid timestamp \d+ is not larger than current timestamp \d+/,
/Timestamp \d+ is lower than the previous block's timestamp \d+/,
);
});
});
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('utils', function () {
const [, tx] = await trackReceivedTokenAndTx(ethers.provider, usdt, signer2.address, () =>
usdt.transfer(signer2.address, ether('1')),
);
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await countInstructions(ethers.provider, tx.events[0].transactionHash, ['STATICCALL', 'CALL', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 0, 2, 2,
]);
Expand All @@ -160,7 +160,7 @@ describe('utils', function () {
const [, tx] = await trackReceivedTokenAndTx(ethers.provider, usdt, signer2.address, () =>
usdt.approve(signer2.address, ether('1')),
);
if (hre.__SOLIDITY_COVERAGE_RUNNING) {
if (hre.__SOLIDITY_COVERAGE_RUNNING === undefined) {
expect(await countInstructions(ethers.provider, tx.events[0].transactionHash, ['STATICCALL', 'CALL', 'SSTORE', 'SLOAD'])).to.be.deep.equal([
0, 0, 1, 0,
]);
Expand Down
Loading

0 comments on commit c551c29

Please sign in to comment.