Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update @thesis-co/eslint-config to the latest 0.8.0-pre version #98

Merged
merged 11 commits into from
Jan 4, 2024
33 changes: 20 additions & 13 deletions .github/workflows/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ defaults:
working-directory: ./core

jobs:
core-format:
core-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -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
Expand All @@ -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]
Expand Down
1 change: 1 addition & 0 deletions core/deploy/00_resolve_tbtc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { isNonZeroAddress } from "../helpers/address"

const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { getNamedAccounts, deployments } = hre
// eslint-disable-next-line @typescript-eslint/unbound-method
const { log } = deployments
const { deployer } = await getNamedAccounts()

Expand Down
2 changes: 2 additions & 0 deletions core/deploy/21_transfer_ownership_acre.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { getNamedAccounts, deployments } = hre
const { deployer, governance } = await getNamedAccounts()
// eslint-disable-next-line @typescript-eslint/unbound-method
const { log } = deployments

log(`transferring ownership of Acre contract to ${governance}`)
Expand All @@ -20,4 +21,5 @@ export default func

func.tags = ["TransferOwnershipAcre"]
// TODO: Enable once Acre extends Ownable
// eslint-disable-next-line @typescript-eslint/require-await
func.skip = async () => true
r-czajkowski marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions core/deploy/22_transfer_ownership_acre_router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import type { DeployFunction } from "hardhat-deploy/types"
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { getNamedAccounts, deployments } = hre
const { deployer, governance } = await getNamedAccounts()
// eslint-disable-next-line @typescript-eslint/unbound-method
r-czajkowski marked this conversation as resolved.
Show resolved Hide resolved
const { log } = deployments

log(`transferring ownership of Dispatcher contract to ${governance}`)
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
17 changes: 9 additions & 8 deletions core/test/Acre.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
loadFixture,
} from "@nomicfoundation/hardhat-toolbox/network-helpers"
import { expect } from "chai"
import { ethers } from "hardhat"
import { ContractTransactionResponse, ZeroAddress } from "ethers"

import type { HardhatEthersSigner } from "@nomicfoundation/hardhat-ethers/signers"
Expand All @@ -20,8 +21,8 @@ async function fixture() {
const [staker1, staker2] = 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 }
}
Expand All @@ -37,7 +38,7 @@ describe("Acre", () => {
})

describe("stake", () => {
const referral = ethers.encodeBytes32String("referral")
const referral: string = ethers.encodeBytes32String("referral")
let snapshot: SnapshotRestorer

context("when staking as first staker", () => {
Expand Down Expand Up @@ -74,8 +75,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.
Expand All @@ -87,8 +88,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)
})
Expand Down Expand Up @@ -367,7 +368,7 @@ describe("Acre", () => {
sharesBefore = await acre.balanceOf(staker1.address)
availableToRedeemBefore = await acre.previewRedeem(sharesBefore)

tbtc.mint(staker1.address, newAmountToStake)
await tbtc.mint(staker1.address, newAmountToStake)

await tbtc
.connect(staker1)
Expand Down
3 changes: 1 addition & 2 deletions core/test/helpers/contract.ts
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
44 changes: 38 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading