mirror of
https://github.com/Instadapp/dsa-connectors.git
synced 2024-07-29 22:37:00 +00:00
Merge pull request #264 from Instadapp/comp-import-test
Compound import test
This commit is contained in:
commit
5a53219cb5
|
@ -335,31 +335,6 @@ describe("Import Compound v3 Position", function () {
|
||||||
console.log(`\tstructHash: ${structHash}`);
|
console.log(`\tstructHash: ${structHash}`);
|
||||||
console.log(`\tblock timestamp: ${(await provider.getBlock(15469858)).timestamp}`);
|
console.log(`\tblock timestamp: ${(await provider.getBlock(15469858)).timestamp}`);
|
||||||
|
|
||||||
console.log(await ethers.provider.getBalance(walletSigner.address));
|
|
||||||
const spells1 = [
|
|
||||||
{
|
|
||||||
connector: "COMPOUND-V3-X",
|
|
||||||
method: "toggleAccountManagerWithPermit",
|
|
||||||
args: [
|
|
||||||
market,
|
|
||||||
wallet.address,
|
|
||||||
dsaWallet0.address,
|
|
||||||
true,
|
|
||||||
nonce,
|
|
||||||
expiry,
|
|
||||||
v,
|
|
||||||
ethers.utils.hexlify(r),
|
|
||||||
ethers.utils.hexlify(s)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
];
|
|
||||||
let [targets, calldata] = encodeSpells(spells1);
|
|
||||||
console.log(targets);
|
|
||||||
console.log(calldata);
|
|
||||||
let tx = await dsaWallet0.connect(walletSigner).cast(...encodeSpells(spells1), wallet0.address);
|
|
||||||
const receipt = await tx.wait();
|
|
||||||
console.log("DSA Permitted as manager");
|
|
||||||
|
|
||||||
const flashSpells = [
|
const flashSpells = [
|
||||||
{
|
{
|
||||||
connector: "COMPOUND-V3-X",
|
connector: "COMPOUND-V3-X",
|
||||||
|
@ -383,6 +358,21 @@ describe("Import Compound v3 Position", function () {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
const spells = [
|
const spells = [
|
||||||
|
{
|
||||||
|
connector: "COMPOUND-V3-X",
|
||||||
|
method: "toggleAccountManagerWithPermit",
|
||||||
|
args: [
|
||||||
|
market,
|
||||||
|
wallet.address,
|
||||||
|
dsaWallet0.address,
|
||||||
|
true,
|
||||||
|
nonce,
|
||||||
|
expiry,
|
||||||
|
v,
|
||||||
|
ethers.utils.hexlify(r),
|
||||||
|
ethers.utils.hexlify(s)
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
connector: "INSTAPOOL-C",
|
connector: "INSTAPOOL-C",
|
||||||
method: "flashBorrowAndCast",
|
method: "flashBorrowAndCast",
|
||||||
|
@ -390,7 +380,7 @@ describe("Import Compound v3 Position", function () {
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
tx = await dsaWallet0.connect(walletSigner).cast(...encodeSpells(spells), wallet0.address);
|
let tx = await dsaWallet0.connect(walletSigner).cast(...encodeSpells(spells), wallet0.address);
|
||||||
await tx.wait();
|
await tx.wait();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user