Skip to content

Commit

Permalink
Fix solidity-coverage and type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
alsco77 committed Nov 20, 2020
1 parent 08e58b9 commit 9c1246b
Show file tree
Hide file tree
Showing 9 changed files with 1,499 additions and 3,101 deletions.
12 changes: 0 additions & 12 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,4 @@
module.exports = {
port: 7546,
testrpcOptions: '-p 7546 -l 0xfffffffffff --allowUnlimitedContractSize',
buildDirPath: '/build',
dir: '.',
providerOptions: {
"gasLimit": 0xfffffffffff,
"callGasLimit": 0xfffffffffff,
"allowUnlimitedContractSize": true
},
silent: false,
// client: require("ganache-core"),
copyPackages: ['@openzeppelin'],
skipFiles: [
'Migrations.sol',
'interfaces',
Expand Down
2 changes: 1 addition & 1 deletion hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
require("hardhat-gas-reporter");
// require("solidity-coverage");
require("solidity-coverage");
require("@nomiclabs/hardhat-truffle5");
require("hardhat-typechain");

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"lint": "yarn run lint-ts; yarn run lint-sol",
"lint-ts": "yarn eslint ./test --ext .ts,.js --fix --quiet",
"lint-sol": "solium -d contracts/ --fix ",
"coverage": "node --max_old_space_size=6144 node_modules/.bin/hardhat coverage --network coverage --solcoverjs ./.solcover.js --testfiles 'test/**/Test*.ts' --show-stack-traces",
"coverage": "yarn hardhat compile --force && node --max_old_space_size=6144 node_modules/.bin/hardhat coverage --temp 'build/contracts' --testfiles 'test/**/Test*.ts' --show-stack-traces",
"script": "yarn truffle exec ./scripts/main.js",
"test": "yarn hardhat test;",
"test-file": "yarn hardhat test",
Expand Down Expand Up @@ -78,7 +78,7 @@
"hardhat-gas-reporter": "^1.0.1",
"hardhat-typechain": "^0.3.3",
"sol-merger": "^3.0.1",
"solidity-coverage": "^0.7.9",
"solidity-coverage": "^0.7.12",
"ts-generator": "^0.1.1",
"ts-node": "^8.4.1",
"tsconfig-paths": "^3.9.0"
Expand Down
2 changes: 1 addition & 1 deletion test-utils/machines/massetMachine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ export class MassetMachine {
: await c_MockInitializableToken.new();
const data = y.contract.methods.initialize(name, sym, dec, recipient, init).encodeABI();
await x.methods["initialize(address,address,bytes)"](y.address, this.sa.governor, data);
return c_MockERC20.at(x.address) as t.MockERC20Instance;
return (await c_MockERC20.at(x.address)) as t.MockERC20Instance;
}

public async loadBassetsLocal(
Expand Down
2 changes: 1 addition & 1 deletion test/masset/TestMassetRedemption.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1651,7 +1651,7 @@ contract("Masset - Redeem", async (accounts) => {
// Mint 6.25 of each bAsset, taking total to 100%
const approvals = await Promise.all(
onChainBassets.map((b, i) =>
massetMachine.approveMasset(b.contract, mAsset, new BN("6.25"), sa.default),
massetMachine.approveMasset(b.contract, mAsset, new BN(10), sa.default),
),
);
await mAsset.mintMulti(
Expand Down
4 changes: 2 additions & 2 deletions test/masset/liquidator/TestLiquidatorContract.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const { expect } = envSetup.configure();

contract("Liquidator", async (accounts) => {
const sa = new StandardAccounts(accounts);
const ctx: { module?: t.InitializableModuleInstance } = {};
const ctx: { module?: t.ModuleInstance } = {};

let nexus: t.MockNexusInstance;
let liquidator: t.LiquidatorInstance;
Expand Down Expand Up @@ -110,7 +110,7 @@ contract("Liquidator", async (accounts) => {
nexus = await MockNexus.new(sa.governor, sa.governor, sa.dummy1);

await redeployLiquidator();
ctx.module = liquidator as t.InitializableModuleInstance;
ctx.module = (liquidator as any) as t.ModuleInstance;
});

describe("verifying initialization", async () => {
Expand Down
4 changes: 2 additions & 2 deletions test/masset/platform-integrations/TestAaveIntegration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ contract("AaveIntegration", async (accounts) => {
let d_AaveIntegrationProxy: t.InitializableAdminUpgradeabilityProxyInstance;
let d_AaveIntegration: t.MockAaveIntegrationInstance;

const ctx: { module?: t.InitializableModuleInstance } = {};
const ctx: { module?: t.ModuleInstance } = {};

before("base init", async () => {
systemMachine = new SystemMachine(sa.all);
Expand Down Expand Up @@ -119,7 +119,7 @@ contract("AaveIntegration", async (accounts) => {
);
}

ctx.module = d_AaveIntegration;
ctx.module = d_AaveIntegration as t.ModuleInstance;
};

describe("initializing AaveIntegration", async () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ const c_MockCToken = artifacts.require("MockCToken");
const c_Nexus = artifacts.require("Nexus");
const c_DelayedProxyAdmin = artifacts.require("DelayedProxyAdmin");

const c_InitializableProxy = artifacts.require(
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
// @ts-ignore
"@openzeppelin/upgrades/InitializableAdminUpgradeabilityProxy",
);
const c_InitializableProxy = artifacts.require("InitializableAdminUpgradeabilityProxy");
const c_CompoundIntegration = artifacts.require("CompoundIntegration");

const convertUnderlyingToCToken = async (
Expand Down

0 comments on commit 9c1246b

Please sign in to comment.