mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
draft-tests
This commit is contained in:
parent
7bdddc1c02
commit
2fc7ddf4e0
|
@ -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);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user