Skip to content

Commit

Permalink
Merge pull request #268 from morpho-org/fix/ci
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
MerlinEgalite authored Oct 25, 2023
2 parents e674526 + 9dc74c4 commit 04ef549
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 55 deletions.
8 changes: 0 additions & 8 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,8 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand Down
24 changes: 0 additions & 24 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand All @@ -39,17 +31,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache
Expand Down Expand Up @@ -90,17 +74,9 @@ jobs:
invariant-depth: 256

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install-cache
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/hardhat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Generate a token
id: generate-token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.APP_PRIVATE_KEY }}

- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ steps.generate-token.outputs.token }}
submodules: recursive

- uses: ./.github/actions/install
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
[submodule "lib/universal-rewards-distributor"]
path = lib/universal-rewards-distributor
url = https://github.com/morpho-org/universal-rewards-distributor
[submodule "lib/morpho-blue-irm"]
path = lib/morpho-blue-irm
url = https://github.com/morpho-labs/morpho-blue-irm
[submodule "lib/erc4626-tests"]
path = lib/erc4626-tests
url = https://github.com/a16z/erc4626-tests
1 change: 0 additions & 1 deletion lib/morpho-blue-irm
Submodule morpho-blue-irm deleted from 8440cb
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
"build:forge": "FOUNDRY_PROFILE=build forge build",
"build:hardhat": "npx hardhat compile",
"build:blue": "cd lib/morpho-blue/ && yarn build:forge && cd ../..",
"build:irm": "cd lib/morpho-blue-irm/ && forge build && cd ../..",
"typecheck": "tsc --noEmit",
"test:forge": "yarn build:blue && FOUNDRY_PROFILE=test forge test",
"test:hardhat": "yarn build:blue && yarn build:irm && npx hardhat test",
"test:hardhat": "yarn build:blue && npx hardhat test",
"lint": "yarn lint:forge && yarn lint:ts",
"lint:ts": "prettier --check test/hardhat",
"lint:forge": "forge fmt --check",
Expand Down
15 changes: 6 additions & 9 deletions test/hardhat/MetaMorpho.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { AbiCoder, MaxUint256, ZeroHash, keccak256, toBigInt } from "ethers";
import hre from "hardhat";
import _range from "lodash/range";
import { ERC20Mock, OracleMock, MetaMorpho, IIrm, IMorpho, MetaMorphoFactory, MetaMorpho__factory } from "types";
import { ERC20Mock, OracleMock, MetaMorpho, IMorpho, MetaMorphoFactory, MetaMorpho__factory, IrmMock } from "types";
import { MarketParamsStruct } from "types/@morpho-blue/interfaces/IMorpho";

import { SignerWithAddress } from "@nomicfoundation/hardhat-ethers/signers";
Expand All @@ -13,7 +13,6 @@ import {
} from "@nomicfoundation/hardhat-network-helpers/dist/src/helpers/time";

// Must use relative import path.
import SpeedJumpIrmArtifact from "../../lib/morpho-blue-irm/out/SpeedJumpIrm.sol/SpeedJumpIrm.json";
import MorphoArtifact from "../../lib/morpho-blue/out/Morpho.sol/Morpho.json";

// Without the division it overflows.
Expand Down Expand Up @@ -72,7 +71,7 @@ describe("MetaMorpho", () => {
let loan: ERC20Mock;
let collateral: ERC20Mock;
let oracle: OracleMock;
let irm: IIrm;
let irm: IrmMock;

let factory: MetaMorphoFactory;
let metaMorpho: MetaMorpho;
Expand Down Expand Up @@ -148,13 +147,11 @@ describe("MetaMorpho", () => {

const morphoAddress = await morpho.getAddress();

const SpeedJumpIrmFactory = await hre.ethers.getContractFactory(
SpeedJumpIrmArtifact.abi,
SpeedJumpIrmArtifact.bytecode.object,
admin,
);
const IrmMockFactory = await hre.ethers.getContractFactory("IrmMock", admin);

irm = await IrmMockFactory.deploy();

irm = (await SpeedJumpIrmFactory.deploy(morphoAddress, ln2, speedFactor, targetUtilization, initialRate)) as IIrm;
await irm.setApr(BigInt.WAD / 100n); // 1%

const loanAddress = await loan.getAddress();
const collateralAddress = await collateral.getAddress();
Expand Down

0 comments on commit 04ef549

Please sign in to comment.