mirror of
https://github.com/Instadapp/dsa-resolvers-deprecated.git
synced 2024-07-29 22:38:16 +00:00
add test for getPosition
This commit is contained in:
parent
4d58a577f6
commit
14dd664e72
|
@ -213,18 +213,16 @@ contract Resolver is Helpers {
|
|||
|
||||
function getPosition(address owner, address[] memory crAddress)
|
||||
public
|
||||
returns (
|
||||
CreamData[] memory,
|
||||
CompReadInterface.CompBalanceMetadataExt memory
|
||||
)
|
||||
returns (CreamData[] memory)
|
||||
// CompReadInterface.CompBalanceMetadataExt memory
|
||||
{
|
||||
return (
|
||||
getCreamData(owner, crAddress),
|
||||
CompReadInterface(getCreamReadAddress()).getCompBalanceMetadataExt(
|
||||
getCreamToken(),
|
||||
getComptroller(),
|
||||
owner
|
||||
)
|
||||
getCreamData(owner, crAddress)
|
||||
// CompReadInterface(getCreamReadAddress()).getCompBalanceMetadataExt(
|
||||
// getCreamToken(),
|
||||
// getComptroller(),
|
||||
// owner
|
||||
// )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,17 +31,22 @@ module.exports = {
|
|||
{
|
||||
version: "0.7.3"
|
||||
}
|
||||
]
|
||||
],
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200,
|
||||
},
|
||||
},
|
||||
networks: {
|
||||
hardhat: {
|
||||
forking: {
|
||||
url: "https://eth-mainnet.alchemyapi.io/v2/" + ALCHEMY_API_KEY
|
||||
url: "https://eth-mainnet.alchemyapi.io/v2/" + ALCHEMY_API_KEY,
|
||||
blockNumber: 12386345
|
||||
}
|
||||
}
|
||||
},
|
||||
mocha: {
|
||||
timeout: 50000,
|
||||
timeout: 100000,
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
const { expect } = require("chai");
|
||||
const { ethers } = require("hardhat");
|
||||
|
||||
describe("InstaCreamResolver", function () {
|
||||
let cream;
|
||||
|
@ -13,7 +14,12 @@ describe("InstaCreamResolver", function () {
|
|||
await cream.deployed();
|
||||
});
|
||||
|
||||
it("should fetch cream data from CrUSDT", async function () {
|
||||
it("should fetch cream data for CrUSDT", async function () {
|
||||
expect(await cream.getCreamData(signer.address, [CrUSDT])).to.exist;
|
||||
});
|
||||
|
||||
it("should fetch cream position for CrUSDT", async function () {
|
||||
const res = await cream.callStatic.getPosition(signer.address, [CrUSDT]);
|
||||
expect(res).to.exist
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user