From b75fd181f4a44dc68ab9630ad448ddfa5b3798b9 Mon Sep 17 00:00:00 2001 From: Richa-iitr Date: Tue, 6 Sep 2022 23:03:40 +0530 Subject: [PATCH 1/2] single tx --- .../compound-v3-import.test.ts | 40 +++++++------------ 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/test/mainnet/compound-import/compound-v3-import.test.ts b/test/mainnet/compound-import/compound-v3-import.test.ts index 57193b60..51cb1ac3 100644 --- a/test/mainnet/compound-import/compound-v3-import.test.ts +++ b/test/mainnet/compound-import/compound-v3-import.test.ts @@ -335,31 +335,6 @@ describe("Import Compound v3 Position", function () { console.log(`\tstructHash: ${structHash}`); 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 = [ { connector: "COMPOUND-V3-X", @@ -383,6 +358,21 @@ describe("Import Compound v3 Position", function () { } ]; 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", method: "flashBorrowAndCast", From c657c0e16faa4267acf9f3d7c4a2e8eacfacfa15 Mon Sep 17 00:00:00 2001 From: Richa-iitr Date: Tue, 6 Sep 2022 23:07:27 +0530 Subject: [PATCH 2/2] minor change --- test/mainnet/compound-import/compound-v3-import.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/mainnet/compound-import/compound-v3-import.test.ts b/test/mainnet/compound-import/compound-v3-import.test.ts index 51cb1ac3..59f32efe 100644 --- a/test/mainnet/compound-import/compound-v3-import.test.ts +++ b/test/mainnet/compound-import/compound-v3-import.test.ts @@ -380,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(); });