Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: cgewecke/hardhat-gas-reporter
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.0.9
Choose a base ref
...
head repository: cgewecke/hardhat-gas-reporter
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 373412d97ebba9ed79778bf770d63c421ec81d0b
Choose a head ref
  • 15 commits
  • 11 files changed
  • 2 contributors

Commits on Jan 23, 2024

  1. Add drip funding config (#160)

    cgewecke authored Jan 23, 2024
    Copy the full SHA
    378a542 View commit details
  2. Fix funding file (#161)

    cgewecke authored Jan 23, 2024
    Copy the full SHA
    2977877 View commit details

Commits on Jan 30, 2024

  1. Bump cross-fetch from 2.2.3 to 2.2.6 (#128)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    2895cd1 View commit details
  2. Bump decode-uri-component from 0.2.0 to 0.2.2 (#137)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    3fca18b View commit details
  3. Bump qs from 6.5.2 to 6.5.3 (#138)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    9ecb74e View commit details
  4. Bump express from 4.17.1 to 4.18.2 (#139)

    Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.18.2.
    - [Release notes](https://github.com/expressjs/express/releases)
    - [Changelog](https://github.com/expressjs/express/blob/master/History.md)
    - [Commits](expressjs/express@4.17.1...4.18.2)
    
    ---
    updated-dependencies:
    - dependency-name: express
      dependency-type: indirect
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    a806ee9 View commit details
  5. Bump cookiejar from 2.1.2 to 2.1.4 (#143)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    61989d6 View commit details
  6. Bump http-cache-semantics from 4.1.0 to 4.1.1 (#145)

    dependabot[bot] authored Jan 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    8105dd9 View commit details
  7. Bump minimist from 1.2.5 to 1.2.8 (#151)

    dependabot[bot] authored Jan 30, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    05c069e View commit details
  8. Bump undici from 5.10.0 to 5.28.2 (#165)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    aff519e View commit details
  9. Bump follow-redirects from 1.14.8 to 1.15.5 (#164)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    3b867c2 View commit details
  10. Bump get-func-name from 2.0.0 to 2.0.2 (#163)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    fe7e700 View commit details
  11. Bump browserify-sign from 4.2.0 to 4.2.2 (#162)

    dependabot[bot] authored Jan 30, 2024
    Copy the full SHA
    d930f49 View commit details
  12. Fixes errors during remote contract gathering (#153) (#166)

    cgewecke authored Jan 30, 2024
    Copy the full SHA
    bae9546 View commit details

Commits on Jan 31, 2024

  1. 1.0.10

    cgewecke committed Jan 31, 2024
    Copy the full SHA
    373412d View commit details
Showing with 1,224 additions and 321 deletions.
  1. +2 −0 .gitignore
  2. +7 −0 FUNDING.json
  3. +2 −2 package.json
  4. +3 −0 scripts/run-tests.sh
  5. +4 −3 src/index.ts
  6. +13 −0 test/forked.ts
  7. +281 −0 test/hardhat-forked-project/abi.ts
  8. +81 −0 test/hardhat-forked-project/contracts/WETH.sol
  9. +29 −0 test/hardhat-forked-project/hardhat.config.ts
  10. +13 −0 test/hardhat-forked-project/test/weth.ts
  11. +789 −316 yarn.lock
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -70,5 +70,7 @@ test/hardhat-ethers-project/artifacts
test/hardhat-ethers-project/cache
test/hardhat-waffle-project/artifacts
test/hardhat-waffle-project/cache
test/hardhat-forked-project/artifacts
test/hardhat-forked-project/cache
dist/

7 changes: 7 additions & 0 deletions FUNDING.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"drips": {
"ethereum": {
"ownedBy": "0xaA4c632684180bf781108c84E7a294B483D12053"
}
}
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hardhat-gas-reporter",
"version": "1.0.9",
"version": "1.0.10",
"description": "Hardhat plugin for eth-gas-reporter, a mocha reporter for Ethereum test suites",
"repository": "github:cgewecke/hardhat-gas-reporter",
"author": "cgewecke",
@@ -44,7 +44,7 @@
"ethereum-waffle": "^3.2.1",
"ethers": "^5.0.0",
"ganache-cli": "^6.4.3",
"hardhat": "^2.11.0",
"hardhat": "^2.19.4",
"mocha": "7",
"prettier": "^1.17.0",
"source-map-support": "^0.5.12",
3 changes: 3 additions & 0 deletions scripts/run-tests.sh
Original file line number Diff line number Diff line change
@@ -44,6 +44,9 @@ npx mocha test/ethers.ts --timeout 100000 --exit
# Waffle + HardhatEVM
npx mocha test/waffle.ts --timeout 100000 --exit

# Forked Network + HardhatEVM
npx mocha test/forked.ts --timeout 100000 --exit

# Ethers + Hardhat Node
start_hardhatevm
npx mocha test/hardhatevm.node.ts --timeout 100000 --exit
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ async function getResolvedRemoteContracts(
provider: EGRAsyncApiProviderT,
remoteContracts: RemoteContract[] = []
) : Promise <RemoteContract[]> {
const { defualt : sha1 } = await import("sha1");
const { default : sha1 } = await import("sha1");
for (const contract of remoteContracts){
let code;
try {
@@ -187,7 +187,8 @@ subtask(TASK_TEST_RUN_MOCHA_TESTS).setAction(
const InternalReporterConfig = require('eth-gas-reporter/lib/config');

// Fetch data from gas and coin price providers
options = new InternalReporterConfig(options);
const originalOptions = options
options = new InternalReporterConfig(originalOptions);
await setGasAndPriceRates(options);

mochaConfig = hre.config.mocha || {};
@@ -211,7 +212,7 @@ subtask(TASK_TEST_RUN_MOCHA_TESTS).setAction(
const asyncProvider = new EGRAsyncApiProvider(hre.network.provider);
resolvedRemoteContracts = await getResolvedRemoteContracts(
asyncProvider,
options.remoteContracts
originalOptions.remoteContracts
);

mochaConfig.reporterOptions.provider = asyncProvider;
13 changes: 13 additions & 0 deletions test/forked.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { TASK_TEST } from "hardhat/builtin-tasks/task-names";
// tslint:disable-next-line no-implicit-dependencies
import { assert } from "chai";

import { useEnvironment } from "./helpers";

describe("Forked Network", function() {
useEnvironment(__dirname + "/hardhat-forked-project");

it("default", async function() {
await this.env.run(TASK_TEST, { testFiles: [] });
});
});
281 changes: 281 additions & 0 deletions test/hardhat-forked-project/abi.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
export const ABI: any = {
wethABI: [
{
"constant": true,
"inputs": [],
"name": "name",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "guy",
"type": "address"
},
{
"name": "wad",
"type": "uint256"
}
],
"name": "approve",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalSupply",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "src",
"type": "address"
},
{
"name": "dst",
"type": "address"
},
{
"name": "wad",
"type": "uint256"
}
],
"name": "transferFrom",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "wad",
"type": "uint256"
}
],
"name": "withdraw",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "decimals",
"outputs": [
{
"name": "",
"type": "uint8"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "symbol",
"outputs": [
{
"name": "",
"type": "string"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"name": "dst",
"type": "address"
},
{
"name": "wad",
"type": "uint256"
}
],
"name": "transfer",
"outputs": [
{
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "deposit",
"outputs": [],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"name": "",
"type": "address"
},
{
"name": "",
"type": "address"
}
],
"name": "allowance",
"outputs": [
{
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "src",
"type": "address"
},
{
"indexed": true,
"name": "guy",
"type": "address"
},
{
"indexed": false,
"name": "wad",
"type": "uint256"
}
],
"name": "Approval",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "src",
"type": "address"
},
{
"indexed": true,
"name": "dst",
"type": "address"
},
{
"indexed": false,
"name": "wad",
"type": "uint256"
}
],
"name": "Transfer",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "dst",
"type": "address"
},
{
"indexed": false,
"name": "wad",
"type": "uint256"
}
],
"name": "Deposit",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"name": "src",
"type": "address"
},
{
"indexed": false,
"name": "wad",
"type": "uint256"
}
],
"name": "Withdrawal",
"type": "event"
}
]
}
Loading