draft-tests

This commit is contained in:
Richa-iitr 2022-04-28 23:55:45 +05:30
parent 7bdddc1c02
commit 2fc7ddf4e0

View File

@ -53,7 +53,7 @@ describe("UniswapV3", function() {
forking: {
// @ts-ignore
jsonRpcUrl: hre.config.networks.hardhat.forking.url,
blockNumber: 13005785,
blockNumber: 14674358,
},
},
],
@ -357,6 +357,48 @@ describe("UniswapV3", function() {
.cast(...encodeSpells(spells), wallet1.address);
const receipt = await tx.wait();
});
it("Should buy successfully", async function() {
const daiAmount = ethers.utils.parseEther("400");
const ethAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
const getId = "0";
const setId = "0";
const spells = [
{
connector: connectorName,
method: "buy",
args: [DAI_ADDR, ethAddress, FeeAmount.MEDIUM, daiAmount, getId, setId],
},
];
const tx = await dsaWallet0
.connect(wallet0)
.cast(...encodeSpells(spells), wallet1.address);
const receipt = await tx.wait();
console.log(receipt);
});
it("Should sell successfully", async function() {
const ethAmount = ethers.utils.parseEther("0.1");
const ethAddress = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
const getId = "0";
const setId = "0";
const spells = [
{
connector: connectorName,
method: "sell",
args: [DAI_ADDR, ethAddress, FeeAmount.MEDIUM, ethAmount, getId, setId],
},
];
const tx = await dsaWallet0
.connect(wallet0)
.cast(...encodeSpells(spells), wallet1.address);
const receipt = await tx.wait();
console.log(receipt);
});
});
});