mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
feat: add testscript for min depoist,mint,withdraw,redeem
This commit is contained in:
parent
a6110bfa5b
commit
8f0cbf710b
|
|
@ -106,6 +106,12 @@ describe("BASIC-D", function () {
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("Main", function () {
|
describe("Main", function () {
|
||||||
|
it("Calculate Total Asset and Total Supply", async () => {
|
||||||
|
const totalAsset = await erc4626Contract.totalAssets();
|
||||||
|
const totalSupply = await erc4626Contract.totalSupply();
|
||||||
|
console.log("totalAsset :>> ", totalAsset);
|
||||||
|
console.log("totalSupply :>> ", totalSupply);
|
||||||
|
});
|
||||||
it("should deposit asset to ERC4626", async () => {
|
it("should deposit asset to ERC4626", async () => {
|
||||||
const assets = ethers.utils.parseEther("1");
|
const assets = ethers.utils.parseEther("1");
|
||||||
const previewDeposit = await erc4626Contract.previewDeposit(assets);
|
const previewDeposit = await erc4626Contract.previewDeposit(assets);
|
||||||
|
|
@ -117,6 +123,11 @@ describe("BASIC-D", function () {
|
||||||
// console.log("maxMint :>> ", maxMint);
|
// console.log("maxMint :>> ", maxMint);
|
||||||
|
|
||||||
const spells = [
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: connectorName,
|
||||||
|
method: "deposit",
|
||||||
|
args: [sDAIaddress, new BigNumber(1).toString(), 0, 0]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "deposit",
|
method: "deposit",
|
||||||
|
|
@ -134,6 +145,11 @@ describe("BASIC-D", function () {
|
||||||
const previewMint = await erc4626Contract.previewMint(shares);
|
const previewMint = await erc4626Contract.previewMint(shares);
|
||||||
console.log("previewMint :>> ", previewMint);
|
console.log("previewMint :>> ", previewMint);
|
||||||
const spells = [
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: connectorName,
|
||||||
|
method: "mint",
|
||||||
|
args: [sDAIaddress, new BigNumber(1).toString(), 0, 0]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "mint",
|
method: "mint",
|
||||||
|
|
@ -154,6 +170,11 @@ describe("BASIC-D", function () {
|
||||||
|
|
||||||
const setId = "83478237";
|
const setId = "83478237";
|
||||||
const spells = [
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: connectorName,
|
||||||
|
method: "redeem",
|
||||||
|
args: [sDAIaddress, new BigNumber(1).toString(), wallet0.address, 0, setId]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "redeem",
|
method: "redeem",
|
||||||
|
|
@ -165,11 +186,16 @@ describe("BASIC-D", function () {
|
||||||
const receipt = await tx.wait();
|
const receipt = await tx.wait();
|
||||||
});
|
});
|
||||||
it("should withdraw asset to ERC4626", async () => {
|
it("should withdraw asset to ERC4626", async () => {
|
||||||
const maxWithdraw = await erc4626Contract.maxWithdraw(dsaWallet0.address);
|
const maxWithdraw : BigNumber = await erc4626Contract.maxWithdraw(dsaWallet0.address);
|
||||||
console.log("maxWithdraw :>> ", maxWithdraw);
|
console.log("maxWithdraw :>> ", maxWithdraw);
|
||||||
|
|
||||||
const setId = "83478237";
|
const setId = "83478237";
|
||||||
const spells = [
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: connectorName,
|
||||||
|
method: "withdraw",
|
||||||
|
args: [sDAIaddress, new BigNumber(1).toString(), wallet0.address, 0, setId]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
connector: connectorName,
|
connector: connectorName,
|
||||||
method: "withdraw",
|
method: "withdraw",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user