Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 14 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"build": "rm -rf dist && hardhat compile && hardhat compile --config hardhat.config.zksync.ts && tsc --declaration",
"docgen": "hardhat docgen",
"prepare": "husky install",
"clean": "hardhat clean && hardhat clean --config hardhat.config.zksync.ts"
"clean": "hardhat clean && hardhat clean --config hardhat.config.zksync.ts",
"postinstall": "yarn patch-package"
},
"repository": {
"type": "git",
Expand All @@ -48,15 +49,16 @@
"@openzeppelin/contracts-upgradeable": "^4.8.3",
"@openzeppelin/hardhat-upgrades": "^1.21.0",
"@solidity-parser/parser": "^0.13.2",
"@venusprotocol/solidity-utilities": "2.0.3",
"@venusprotocol/solidity-utilities": "2.1.0",
"ethers": "^5.7.0",
"hardhat-deploy": "^0.11.14",
"module-alias": "^2.2.2"
"module-alias": "^2.2.2",
"patch-package": "^8.0.0"
},
"devDependencies": {
"@commitlint/cli": "^17.0.3",
"@commitlint/config-conventional": "^17.0.3",
"@defi-wonderland/smock": "^2.2.0",
"@defi-wonderland/smock": "2.4.0",
"@matterlabs/hardhat-zksync": "^0.2.0",
"@matterlabs/hardhat-zksync-deploy": "^0.11.0",
"@matterlabs/hardhat-zksync-solc": "^1.2.1",
Expand All @@ -77,10 +79,10 @@
"@types/node": "^12.20.50",
"@typescript-eslint/eslint-plugin": "^5.27.1",
"@typescript-eslint/parser": "^5.27.1",
"@venusprotocol/governance-contracts": "2.9.0",
"@venusprotocol/oracle": "2.11.0",
"@venusprotocol/protocol-reserve": "3.3.0",
"@venusprotocol/venus-protocol": "9.7.0",
"@venusprotocol/governance-contracts": "2.13.0",
"@venusprotocol/oracle": "2.14.0",
"@venusprotocol/protocol-reserve": "3.4.0",
"@venusprotocol/venus-protocol": "10.0.0",
"bignumber.js": "9.0.0",
"chai": "^4.3.6",
"dotenv": "^10.0.0",
Expand All @@ -90,7 +92,7 @@
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "3.4.1",
"eslint-plugin-promise": "^5.2.0",
"hardhat": "^2.16.1",
"hardhat": "2.22.18",
"hardhat-dependency-compiler": "^1.2.1",
"hardhat-deploy": "^0.12.4",
"hardhat-deploy-ethers": "^0.3.0-beta.13",
Expand All @@ -112,9 +114,9 @@
"scrypt.js": "https://registry.npmjs.org/@compound-finance/ethereumjs-wallet/-/ethereumjs-wallet-0.6.3.tgz",
"ganache-core": "github:compound-finance/ganache-core.git#jflatow/unbreak-fork",
"solidity-parser-antlr": "https://github.com/solidity-parser/parser#0.8.2",
"@defi-wonderland/smock": "2.3.5",
"hardhat": "2.19.4",
"@venusprotocol/solidity-utilities": "2.0.3"
"@defi-wonderland/smock": "2.4.0",
"hardhat": "2.22.18",
"@venusprotocol/solidity-utilities": "2.1.0"
},
"publishConfig": {
"access": "public",
Expand Down
18 changes: 18 additions & 0 deletions patches/@defi-wonderland+smock+2.4.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/node_modules/@defi-wonderland/smock/dist/src/utils/hardhat.js b/node_modules/@defi-wonderland/smock/dist/src/utils/hardhat.js
index 15b140c..7a0c157 100644
--- a/node_modules/@defi-wonderland/smock/dist/src/utils/hardhat.js
+++ b/node_modules/@defi-wonderland/smock/dist/src/utils/hardhat.js
@@ -6,7 +6,12 @@ const getHardhatBaseProvider = async (runtime) => {
const maxLoopIterations = 1024;
let currentLoopIterations = 0;
let provider = runtime.network.provider;
- await provider.init();
+ if ('init' in provider) {
+ // Newer versions of Hardhat initialize the provider lazily, so we need to
+ // call provider.init() explicitly. This is a no-op if the provider is
+ // already initialized.
+ await provider.init();
+ }
while (provider._wrapped !== undefined) {
provider = provider._wrapped;
currentLoopIterations += 1;
1 change: 1 addition & 0 deletions tests/hardhat/Comptroller/accountLiquidityTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async function makeFakeVToken({
await comptroller.setMaxLoopsLimit(maxLoopsLimit);
if (supportMarket) {
const poolRegistrySigner = await ethers.getSigner(poolRegistry.address);
await setBalance(poolRegistry.address, 100n ** 18n);
await comptroller.connect(poolRegistrySigner).supportMarket(vToken.address);
}
if (underlyingPrice) {
Expand Down
1 change: 1 addition & 0 deletions tests/hardhat/Comptroller/assetsListTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ describe("assetListTest", () => {
});
}
const poolRegistrySigner = await ethers.getSigner(poolRegistry.address);
await setBalance(poolRegistry.address, 100n ** 18n);
await comptroller.connect(poolRegistrySigner).supportMarket(vToken.address);
}
return vToken;
Expand Down
3 changes: 2 additions & 1 deletion tests/hardhat/Comptroller/setters.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FakeContract, MockContract, smock } from "@defi-wonderland/smock";
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
import { loadFixture, setBalance } from "@nomicfoundation/hardhat-network-helpers";
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
import chai from "chai";
import { Signer } from "ethers";
Expand Down Expand Up @@ -61,6 +61,7 @@ describe("setters", async () => {
OMG = await smock.fake<VToken>("VToken");
OMG.isVToken.returns(true);
poolRegistrySigner = await ethers.getSigner(poolRegistry.address);
await setBalance(poolRegistry.address, 100n ** 18n);

// Sending transaction cost
await owner.sendTransaction({ to: poolRegistry.address, value: ethers.utils.parseEther("1") });
Expand Down
Loading
Loading