diff --git a/.github/workflows/core.yaml b/.github/workflows/core.yaml index a0501e05b..6b431ba4e 100644 --- a/.github/workflows/core.yaml +++ b/.github/workflows/core.yaml @@ -13,7 +13,7 @@ defaults: working-directory: ./core jobs: - core-format: + core-build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -30,10 +30,20 @@ jobs: - name: Install Dependencies run: pnpm install --prefer-offline --frozen-lockfile - - name: Format - run: pnpm run format + - name: Build + run: pnpm run build - core-build: + - name: Upload Build Artifacts + uses: actions/upload-artifact@v3 + with: + name: core-build + path: | + core/build/ + core/typechain/ + if-no-files-found: error + + core-format: + needs: [core-build] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -50,17 +60,14 @@ jobs: - name: Install Dependencies run: pnpm install --prefer-offline --frozen-lockfile - - name: Build - run: pnpm run build - - - name: Upload Build Artifacts - uses: actions/upload-artifact@v3 + - name: Download Build Artifacts + uses: actions/download-artifact@v3 with: name: core-build - path: | - core/build/ - core/typechain/ - if-no-files-found: error + path: core/ + + - name: Format + run: pnpm run format core-slither: needs: [core-build] diff --git a/core/.eslintrc b/core/.eslintrc index 39419600b..8090228c6 100644 --- a/core/.eslintrc +++ b/core/.eslintrc @@ -13,5 +13,19 @@ ] } ] - } + }, + "overrides": [ + { + "files": ["deploy/*.ts"], + "rules": { + "@typescript-eslint/unbound-method": "off" + } + }, + { + "files": ["*.test.ts"], + "rules": { + "@typescript-eslint/no-unused-expressions": "off" + } + } + ] } diff --git a/core/deploy/00_resolve_testing_erc4626.ts b/core/deploy/00_resolve_testing_erc4626.ts index b8e483897..d1e82b665 100644 --- a/core/deploy/00_resolve_testing_erc4626.ts +++ b/core/deploy/00_resolve_testing_erc4626.ts @@ -24,4 +24,4 @@ func.tags = ["TestERC4626"] func.dependencies = ["TBTC"] func.skip = async (hre: HardhatRuntimeEnvironment): Promise => - hre.network.name === "mainnet" + Promise.resolve(hre.network.name === "mainnet") diff --git a/core/package.json b/core/package.json index ff7aa5197..ca5b4e175 100644 --- a/core/package.json +++ b/core/package.json @@ -35,7 +35,7 @@ "@nomicfoundation/hardhat-verify": "^2.0.1", "@nomiclabs/hardhat-etherscan": "^3.1.7", "@openzeppelin/hardhat-upgrades": "^2.4.1", - "@thesis-co/eslint-config": "^0.6.1", + "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@typechain/ethers-v6": "^0.5.1", "@typechain/hardhat": "^9.1.0", "@types/chai": "^4.3.11", diff --git a/core/test/Acre.test.ts b/core/test/Acre.test.ts index fa6e5ddf1..2a872dc02 100644 --- a/core/test/Acre.test.ts +++ b/core/test/Acre.test.ts @@ -9,6 +9,7 @@ import { ZeroAddress, encodeBytes32String, } from "ethers" +import { ethers } from "hardhat" import type { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers" import type { SnapshotRestorer } from "@nomicfoundation/hardhat-toolbox/network-helpers" @@ -26,8 +27,8 @@ async function fixture() { const [staker1, staker2, thirdParty] = await getUnnamedSigner() const amountToMint = to1e18(100000) - tbtc.mint(staker1, amountToMint) - tbtc.mint(staker2, amountToMint) + await tbtc.mint(staker1, amountToMint) + await tbtc.mint(staker2, amountToMint) return { acre, tbtc, staker1, staker2, dispatcher, governance, thirdParty } } @@ -85,8 +86,8 @@ describe("Acre", () => { .stake(amountToStake, receiver.address, referral) }) - it("should emit Deposit event", () => { - expect(tx).to.emit(acre, "Deposit").withArgs( + it("should emit Deposit event", async () => { + await expect(tx).to.emit(acre, "Deposit").withArgs( // Caller. tbtcHolder.address, // Receiver. @@ -98,8 +99,8 @@ describe("Acre", () => { ) }) - it("should emit StakeReferral event", () => { - expect(tx) + it("should emit StakeReferral event", async () => { + await expect(tx) .to.emit(acre, "StakeReferral") .withArgs(referral, amountToStake) }) @@ -558,8 +559,8 @@ describe("Acre", () => { tx = await acre.connect(staker1).mint(sharesToMint, staker1.address) }) - it("should emit Deposit event", () => { - expect(tx).to.emit(acre, "Deposit").withArgs( + it("should emit Deposit event", async () => { + await expect(tx).to.emit(acre, "Deposit").withArgs( // Caller. staker1.address, // Receiver. @@ -1032,8 +1033,8 @@ describe("Acre", () => { tx = await acre.deposit(amountToDeposit, staker1.address) }) - it("should emit Deposit event", () => { - expect(tx).to.emit(acre, "Deposit").withArgs( + it("should emit Deposit event", async () => { + await expect(tx).to.emit(acre, "Deposit").withArgs( // Caller. staker1.address, // Receiver. diff --git a/core/test/helpers/contract.ts b/core/test/helpers/contract.ts index 88a83812a..6ba7b36ae 100644 --- a/core/test/helpers/contract.ts +++ b/core/test/helpers/contract.ts @@ -1,5 +1,4 @@ -import { ethers } from "ethers" -import { deployments } from "hardhat" +import { deployments, ethers } from "hardhat" import type { BaseContract } from "ethers" import { getUnnamedSigner } from "./signer" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1c334a15e..cdb2852f8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -46,8 +46,8 @@ importers: specifier: ^2.4.1 version: 2.4.1(@nomicfoundation/hardhat-ethers@3.0.5)(@nomicfoundation/hardhat-verify@2.0.1)(ethers@6.8.1)(hardhat@2.19.1) '@thesis-co/eslint-config': - specifier: ^0.6.1 - version: 0.6.1(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) + specifier: github:thesis/eslint-config#7b9bc8c + version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) '@typechain/ethers-v6': specifier: ^0.5.1 version: 0.5.1(ethers@6.8.1)(typechain@8.3.2)(typescript@5.3.2) @@ -173,8 +173,8 @@ importers: sdk: devDependencies: '@thesis-co/eslint-config': - specifier: ^0.6.1 - version: 0.6.1(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) + specifier: github:thesis/eslint-config#7b9bc8c + version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) '@types/chai': specifier: ^4.3.11 version: 4.3.11 @@ -225,8 +225,8 @@ importers: version: 6.1.0(react@18.2.0) devDependencies: '@thesis-co/eslint-config': - specifier: ^0.6.1 - version: 0.6.1(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) + specifier: github:thesis/eslint-config#7b9bc8c + version: github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2) '@types/node': specifier: ^20.9.4 version: 20.9.4 @@ -15524,6 +15524,38 @@ packages: resolution: {integrity: sha512-iC+8Io04lddc+mVqQ9AZ7OQ2MrUKGN+oIQyq1vemgt46jwCwLfhq7/pwnBnNXXXZb8VTVLKwp9EDkx+ryxIWmg==} dev: false + github.com/thesis/eslint-config/7b9bc8c(eslint@8.54.0)(prettier@3.1.0)(typescript@5.3.2): + resolution: {tarball: https://codeload.github.com/thesis/eslint-config/tar.gz/7b9bc8c} + id: github.com/thesis/eslint-config/7b9bc8c + name: '@thesis-co/eslint-config' + version: 0.8.0-pre + engines: {node: '>=14.0.0'} + peerDependencies: + eslint: '>=6.8.0' + dependencies: + '@thesis-co/prettier-config': github.com/thesis/prettier-config/daeaac564056a7885e4366ce12bfde6fd823fc90(prettier@3.1.0) + '@typescript-eslint/eslint-plugin': 6.12.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0)(typescript@5.3.2) + '@typescript-eslint/parser': 6.12.0(eslint@8.54.0)(typescript@5.3.2) + eslint: 8.54.0 + eslint-config-airbnb: 19.0.4(eslint-plugin-import@2.29.0)(eslint-plugin-jsx-a11y@6.8.0)(eslint-plugin-react-hooks@4.6.0)(eslint-plugin-react@7.33.2)(eslint@8.54.0) + eslint-config-airbnb-base: 15.0.0(eslint-plugin-import@2.29.0)(eslint@8.54.0) + eslint-config-airbnb-typescript: 17.1.0(@typescript-eslint/eslint-plugin@6.12.0)(@typescript-eslint/parser@6.12.0)(eslint-plugin-import@2.29.0)(eslint@8.54.0) + eslint-config-prettier: 9.0.0(eslint@8.54.0) + eslint-plugin-import: 2.29.0(@typescript-eslint/parser@6.12.0)(eslint@8.54.0) + eslint-plugin-jsx-a11y: 6.8.0(eslint@8.54.0) + eslint-plugin-no-only-tests: 3.1.0 + eslint-plugin-prettier: 5.0.1(eslint-config-prettier@9.0.0)(eslint@8.54.0)(prettier@3.1.0) + eslint-plugin-react: 7.33.2(eslint@8.54.0) + eslint-plugin-react-hooks: 4.6.0(eslint@8.54.0) + transitivePeerDependencies: + - '@types/eslint' + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - prettier + - supports-color + - typescript + dev: true + github.com/thesis/prettier-config/daeaac564056a7885e4366ce12bfde6fd823fc90(prettier@3.1.0): resolution: {tarball: https://codeload.github.com/thesis/prettier-config/tar.gz/daeaac564056a7885e4366ce12bfde6fd823fc90} id: github.com/thesis/prettier-config/daeaac564056a7885e4366ce12bfde6fd823fc90 diff --git a/sdk/package.json b/sdk/package.json index 49d9e8580..2c95625aa 100644 --- a/sdk/package.json +++ b/sdk/package.json @@ -14,7 +14,7 @@ "test": "mocha --exit --recursive 'test/**/*.test.ts'" }, "devDependencies": { - "@thesis-co/eslint-config": "^0.6.1", + "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@types/chai": "^4.3.11", "@types/mocha": "^10.0.6", "@types/node": "^20.9.4", diff --git a/website/package.json b/website/package.json index 23f6fdb53..3d0dcc6fd 100644 --- a/website/package.json +++ b/website/package.json @@ -28,7 +28,7 @@ "react-helmet": "^6.1.0" }, "devDependencies": { - "@thesis-co/eslint-config": "^0.6.1", + "@thesis-co/eslint-config": "github:thesis/eslint-config#7b9bc8c", "@types/node": "^20.9.4", "@types/react": "^18.2.38", "@types/react-dom": "^18.2.17",