mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
update
This commit is contained in:
parent
659d22f0be
commit
2bd78bf6a8
|
@ -3,7 +3,7 @@ import * as path from "path";
|
||||||
|
|
||||||
const forbiddenStrings: any = ["selfdestruct"];
|
const forbiddenStrings: any = ["selfdestruct"];
|
||||||
|
|
||||||
const getConnectorsList = async (connectorsRootsDirs: string | any[]) => {
|
const getConnectorsList= async (connectorsRootsDirs: string | any[]): Promise<Record<string, any>> => {
|
||||||
try {
|
try {
|
||||||
const connectors = [];
|
const connectors = [];
|
||||||
for (let index = 0; index < connectorsRootsDirs.length; index++) {
|
for (let index = 0; index < connectorsRootsDirs.length; index++) {
|
||||||
|
|
|
@ -35,7 +35,6 @@ async function setStatus(context, state, description) {
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
console.log(`Starting status checks for commit ${sha}`);
|
console.log(`Starting status checks for commit ${sha}`);
|
||||||
|
|
||||||
// Run in parallel
|
// Run in parallel
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
checks.map(async (check: { name: any; callback: any }) => {
|
checks.map(async (check: { name: any; callback: any }) => {
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
|
import hre from "hardhat";
|
||||||
import { expect } from "chai";
|
import { expect } from "chai";
|
||||||
import "hardhat";
|
|
||||||
import { abis } from "../../../scripts/constant/abis";
|
import { abis } from "../../../scripts/constant/abis";
|
||||||
import { addresses } from "../../../scripts/constant/addresses";
|
import { addresses } from "../../../scripts/constant/addresses";
|
||||||
import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector";
|
import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnableConnector";
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner";
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2";
|
||||||
|
import { ConnectV2AaveV1, ConnectV2AaveV1__factory } from "../../../typechain";
|
||||||
import ConnectV2AaveV1 from "../../artifacts/contracts/mainnet/connectors/aave/v1/main.sol/ConnectV2AaveV1.json";
|
|
||||||
import { parseEther } from "@ethersproject/units";
|
import { parseEther } from "@ethersproject/units";
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells";
|
||||||
import { tokens } from "../../../scripts/constant/tokens";
|
import { tokens } from "../../../scripts/constant/tokens";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
import { constants } from "../../../scripts/constant/constant";
|
||||||
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
import { addLiquidity } from "../../../scripts/tests/addLiquidity";
|
||||||
// const { ethers } = hre;
|
const { ethers } = hre;
|
||||||
|
import type { Signer, Contract } from "ethers";
|
||||||
const ALCHEMY_ID = process.env.ALCHEMY_ID;
|
|
||||||
|
|
||||||
describe("Aave V1", function () {
|
describe("Aave V1", function () {
|
||||||
const connectorName = "AAVEV1-TEST-A";
|
const connectorName = "AAVEV1-TEST-A";
|
||||||
|
|
||||||
let wallet0: any, wallet1: any;
|
let wallet0: any, wallet1: any;
|
||||||
let dsaWallet0: any;
|
let dsaWallet0: any;
|
||||||
let instaConnectorsV2: any;
|
let instaConnectorsV2: Contract;
|
||||||
let connector: any;
|
let connector: any;
|
||||||
let masterSigner: any;
|
let masterSigner: Signer;
|
||||||
|
|
||||||
before(async () => {
|
before(async () => {
|
||||||
try {
|
try {
|
||||||
|
@ -32,6 +30,7 @@ describe("Aave V1", function () {
|
||||||
params: [
|
params: [
|
||||||
{
|
{
|
||||||
forking: {
|
forking: {
|
||||||
|
// @ts-ignore
|
||||||
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
||||||
blockNumber: 12796965,
|
blockNumber: 12796965,
|
||||||
},
|
},
|
||||||
|
@ -46,7 +45,7 @@ describe("Aave V1", function () {
|
||||||
);
|
);
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: ConnectV2AaveV1,
|
contractArtifact: ConnectV2AaveV1__factory,
|
||||||
signer: masterSigner,
|
signer: masterSigner,
|
||||||
connectors: instaConnectorsV2,
|
connectors: instaConnectorsV2,
|
||||||
});
|
});
|
||||||
|
@ -59,7 +58,7 @@ describe("Aave V1", function () {
|
||||||
it("should have contracts deployed", async () => {
|
it("should have contracts deployed", async () => {
|
||||||
expect(!!instaConnectorsV2.address).to.be.true;
|
expect(!!instaConnectorsV2.address).to.be.true;
|
||||||
expect(!!connector.address).to.be.true;
|
expect(!!connector.address).to.be.true;
|
||||||
expect(!!masterSigner.address).to.be.true;
|
expect(!!(await masterSigner.getAddress())).to.be.true;
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("DSA wallet setup", function () {
|
describe("DSA wallet setup", function () {
|
||||||
|
|
|
@ -7,20 +7,18 @@ import { deployAndEnableConnector } from "../../../scripts/tests/deployAndEnable
|
||||||
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
import { buildDSAv2 } from "../../../scripts/tests/buildDSAv2"
|
||||||
import { encodeSpells } from "../../../scripts/tests/encodeSpells.js"
|
import { encodeSpells } from "../../../scripts/tests/encodeSpells.js"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
||||||
|
|
||||||
import { addresses } from "../../../scripts/constant/addresses";
|
import { addresses } from "../../../scripts/constant/addresses";
|
||||||
import { abis } from "../../../scripts/constant/abis";
|
import { abis } from "../../../scripts/constant/abis";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
import { constants } from "../../../scripts/constant/constant";
|
||||||
import { tokens } from "../../../scripts/constant/tokens";
|
import { ConnectV2Compound__factory } from "../../../typechain";
|
||||||
|
import type { Signer, Contract } from "ethers";
|
||||||
import connectV2CompoundArtifacts from "../../artifacts/contracts/mainnet/connectors/b.protocol/compound/main.sol/ConnectV2BCompound.json"
|
|
||||||
|
|
||||||
describe("B.Compound", function () {
|
describe("B.Compound", function () {
|
||||||
const connectorName = "B.COMPOUND-TEST-A"
|
const connectorName = "B.COMPOUND-TEST-A"
|
||||||
|
|
||||||
let dsaWallet0: any;
|
let dsaWallet0: any;
|
||||||
let masterSigner: any;
|
let masterSigner: Signer;
|
||||||
let instaConnectorsV2: any;
|
let instaConnectorsV2: Contract;
|
||||||
let connector: any;
|
let connector: any;
|
||||||
|
|
||||||
const wallets = provider.getWallets()
|
const wallets = provider.getWallets()
|
||||||
|
@ -31,17 +29,18 @@ describe("B.Compound", function () {
|
||||||
params: [
|
params: [
|
||||||
{
|
{
|
||||||
forking: {
|
forking: {
|
||||||
|
// @ts-ignore
|
||||||
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
||||||
blockNumber: 13300000,
|
blockNumber: 13300000,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
masterSigner = await getMasterSigner(wallet3)
|
masterSigner = await getMasterSigner()
|
||||||
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
|
instaConnectorsV2 = await ethers.getContractAt(abis.core.connectorsV2, addresses.core.connectorsV2);
|
||||||
connector = await deployAndEnableConnector({
|
connector = await deployAndEnableConnector({
|
||||||
connectorName,
|
connectorName,
|
||||||
contractArtifact: connectV2CompoundArtifacts,
|
contractArtifact: ConnectV2Compound__factory,
|
||||||
signer: masterSigner,
|
signer: masterSigner,
|
||||||
connectors: instaConnectorsV2
|
connectors: instaConnectorsV2
|
||||||
})
|
})
|
||||||
|
@ -51,7 +50,7 @@ describe("B.Compound", function () {
|
||||||
it("Should have contracts deployed.", async function () {
|
it("Should have contracts deployed.", async function () {
|
||||||
expect(!!instaConnectorsV2.address).to.be.true;
|
expect(!!instaConnectorsV2.address).to.be.true;
|
||||||
expect(!!connector.address).to.be.true;
|
expect(!!connector.address).to.be.true;
|
||||||
expect(!!masterSigner.address).to.be.true;
|
expect(!!(await masterSigner.getAddress())).to.be.true;
|
||||||
expect(await connector.name()).to.be.equal("B.Compound-v1.0");
|
expect(await connector.name()).to.be.equal("B.Compound-v1.0");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,10 @@ import { encodeSpells } from "../../../scripts/tests/encodeSpells.js"
|
||||||
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
import { getMasterSigner } from "../../../scripts/tests/getMasterSigner"
|
||||||
import { addresses } from "../../../scripts/constant/addresses";
|
import { addresses } from "../../../scripts/constant/addresses";
|
||||||
import { abis } from "../../../scripts/constant/abis";
|
import { abis } from "../../../scripts/constant/abis";
|
||||||
import { constants } from "../../../scripts/constant/constant";
|
import { ConnectV2BLiquity__factory } from "../../../typechain";
|
||||||
import { tokens } from "../../../scripts/constant/tokens";
|
import type { Signer, Contract } from "ethers";
|
||||||
|
|
||||||
import connectorLiquityArtifacts from ("../../artifacts/contracts/mainnet/connectors/b.protocol/liquity/main.sol/ConnectV2BLiquity.json")
|
|
||||||
|
|
||||||
const LUSD_WHALE = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb" // stability pool
|
const LUSD_WHALE = "0x66017D22b0f8556afDd19FC67041899Eb65a21bb" // stability pool
|
||||||
|
|
||||||
const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598"
|
const BAMM_ADDRESS = "0x0d3AbAA7E088C2c82f54B2f47613DA438ea8C598"
|
||||||
|
|
||||||
describe("B.Liquity", function () {
|
describe("B.Liquity", function () {
|
||||||
|
@ -23,8 +20,8 @@ describe("B.Liquity", function () {
|
||||||
|
|
||||||
let dsaWallet0: any;
|
let dsaWallet0: any;
|
||||||
let dsaWallet1: any
|
let dsaWallet1: any
|
||||||
let masterSigner: any;
|
let masterSigner: Signer;
|
||||||
let instaConnectorsV2: any;
|
let instaConnectorsV2: Contract;
|
||||||
let connector: any;
|
let connector: any;
|
||||||
let manager: any;
|
let manager: any;
|
||||||
let vat: any;
|
let vat: any;
|
||||||
|
@ -40,6 +37,7 @@ describe("B.Liquity", function () {
|
||||||
params: [
|
params: [
|
||||||
{
|
{
|
||||||
forking: {
|
forking: {
|
||||||
|
// @ts-ignore
|
||||||
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
|
||||||
blockNumber: 12996875,
|
blockNumber: 12996875,
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue
Block a user