From 466fa2cafc1742794831ed6f0841f6caa781f543 Mon Sep 17 00:00:00 2001 From: eboado Date: Wed, 10 Jun 2020 12:31:08 +0200 Subject: [PATCH] - Changed ganache version --- buidler.config.ts | 2 +- docker-compose.yml | 2 +- helpers/contracts-helpers.ts | 14 ++++++++++++++ test/atoken-transfer.spec.ts | 17 ++++++++--------- 4 files changed, 24 insertions(+), 11 deletions(-) diff --git a/buidler.config.ts b/buidler.config.ts index e4afcf09..1bd10616 100644 --- a/buidler.config.ts +++ b/buidler.config.ts @@ -62,7 +62,7 @@ const config: BuidlerConfig = { url: "https://api-kovan.etherscan.io/api", apiKey: ETHERSCAN_KEY, }, - defaultNetwork: "buidlerevm", + defaultNetwork: "ganache", mocha: { timeout: 0, }, diff --git a/docker-compose.yml b/docker-compose.yml index 41a521e0..c6b67d2b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: - ./:/src ganache: - image: trufflesuite/ganache-cli:next + image: trufflesuite/ganache-cli:latest ports: - "8545:8545" command: [ diff --git a/helpers/contracts-helpers.ts b/helpers/contracts-helpers.ts index 487f5c6e..e3344b44 100644 --- a/helpers/contracts-helpers.ts +++ b/helpers/contracts-helpers.ts @@ -453,6 +453,20 @@ export const getAaveProtocolTestHelpers = async ( ); }; +export const getInterestRateStrategy = async (address?: tEthereumAddress) => { + return await getContract( + eContractid.DefaultReserveInterestRateStrategy, + address || + ( + await getDb() + .get( + `${eContractid.DefaultReserveInterestRateStrategy}.${BRE.network.name}` + ) + .value() + ).address + ); +}; + const linkBytecode = (artifact: Artifact, libraries: any) => { let bytecode = artifact.bytecode; diff --git a/test/atoken-transfer.spec.ts b/test/atoken-transfer.spec.ts index a1c34cc8..482f10bf 100644 --- a/test/atoken-transfer.spec.ts +++ b/test/atoken-transfer.spec.ts @@ -19,8 +19,7 @@ import { getLendingPool, } from "../helpers/contracts-helpers"; import {expect} from "chai"; -import {Signer} from "ethers"; -import {BigNumber as EthersBigNumber} from "ethers/utils"; +import {Signer, ethers} from "ethers"; describe("AToken: Transfer", () => { let deployer: Signer; @@ -167,13 +166,13 @@ describe("AToken: Transfer", () => { }); it("User 0 deposits 1 ETH and user tries to borrow, but the aTokens received as a transfer are not available as collateral (revert expected)", async () => { - // console.time("deposit()"); - // await _lendingPool - // .connect(users[0]) - // .deposit(MOCK_ETH_ADDRESS, oneEther.toFixed(), "0", { - // value: new EthersBigNumber(oneEther.toFixed()), - // }); - // console.timeEnd("deposit()"); + console.time("deposit()"); + await _lendingPool + .connect(users[0]) + .deposit(MOCK_ETH_ADDRESS, ethers.utils.parseEther("1.0"), "0", { + value: ethers.utils.parseEther("1.0"), + }); + console.timeEnd("deposit()"); // await expectRevert( // _lendingPoolInstance.borrow( // ETHEREUM_ADDRESS,