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)
|
function getPosition(address owner, address[] memory crAddress)
|
||||||
public
|
public
|
||||||
returns (
|
returns (CreamData[] memory)
|
||||||
CreamData[] memory,
|
// CompReadInterface.CompBalanceMetadataExt memory
|
||||||
CompReadInterface.CompBalanceMetadataExt memory
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
return (
|
return (
|
||||||
getCreamData(owner, crAddress),
|
getCreamData(owner, crAddress)
|
||||||
CompReadInterface(getCreamReadAddress()).getCompBalanceMetadataExt(
|
// CompReadInterface(getCreamReadAddress()).getCompBalanceMetadataExt(
|
||||||
getCreamToken(),
|
// getCreamToken(),
|
||||||
getComptroller(),
|
// getComptroller(),
|
||||||
owner
|
// owner
|
||||||
)
|
// )
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,17 +31,22 @@ module.exports = {
|
||||||
{
|
{
|
||||||
version: "0.7.3"
|
version: "0.7.3"
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
optimizer: {
|
||||||
|
enabled: true,
|
||||||
|
runs: 200,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
networks: {
|
networks: {
|
||||||
hardhat: {
|
hardhat: {
|
||||||
forking: {
|
forking: {
|
||||||
url: "https://eth-mainnet.alchemyapi.io/v2/" + ALCHEMY_API_KEY
|
url: "https://eth-mainnet.alchemyapi.io/v2/" + ALCHEMY_API_KEY,
|
||||||
|
blockNumber: 12386345
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mocha: {
|
mocha: {
|
||||||
timeout: 50000,
|
timeout: 100000,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
const { expect } = require("chai");
|
const { expect } = require("chai");
|
||||||
|
const { ethers } = require("hardhat");
|
||||||
|
|
||||||
describe("InstaCreamResolver", function () {
|
describe("InstaCreamResolver", function () {
|
||||||
let cream;
|
let cream;
|
||||||
|
@ -13,7 +14,12 @@ describe("InstaCreamResolver", function () {
|
||||||
await cream.deployed();
|
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;
|
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