From 5266a765a3661abc076ce926d32272aff0d5213b Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Wed, 6 Sep 2023 15:17:16 +0200 Subject: [PATCH 1/2] fix: send token --- scripts/test/send-token.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/test/send-token.ts b/scripts/test/send-token.ts index 735d122..e4ca273 100644 --- a/scripts/test/send-token.ts +++ b/scripts/test/send-token.ts @@ -91,6 +91,7 @@ const main = async function (...args: string[]) { gasLimit: 5_000_000, }) const txReceipt = await tx.wait() + // eslint-disable-next-line @typescript-eslint/no-explicit-any const logs = txReceipt.events?.find((e: any) => e.event === 'TokenDeployed') @@ -105,7 +106,8 @@ const main = async function (...args: string[]) { // Approve token burn const erc20 = new Contract(tokenAddress, ERC20.abi, wallet) - await erc20.approve(erc20Messaging.address, amount) + const tx1 = await erc20.approve(erc20Messaging.address, amount) + const txReceipt1 = await tx1.wait() // Send token console.log( @@ -120,16 +122,18 @@ const main = async function (...args: string[]) { ' token address:', tokenAddress ) - const tx = await erc20Messaging.sendToken( + + const tx2 = await erc20Messaging.sendToken( cc.TARGET_SUBNET_ID_4, tokenAddress, receiverAddress, amount, { - gasLimit: 5_000_000, + gasLimit: 5_100_000, } ) - const txReceipt = await tx.wait() + const txReceipt = await tx2.wait() + const logs = txReceipt.events?.find( // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) => From 84c7ed4532536c2757c88f1782c33db63ef7fd7c Mon Sep 17 00:00:00 2001 From: Marko Atanasievski Date: Wed, 6 Sep 2023 15:29:57 +0200 Subject: [PATCH 2/2] fix: format --- scripts/test/send-token.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/test/send-token.ts b/scripts/test/send-token.ts index e4ca273..03e9177 100644 --- a/scripts/test/send-token.ts +++ b/scripts/test/send-token.ts @@ -107,7 +107,7 @@ const main = async function (...args: string[]) { // Approve token burn const erc20 = new Contract(tokenAddress, ERC20.abi, wallet) const tx1 = await erc20.approve(erc20Messaging.address, amount) - const txReceipt1 = await tx1.wait() + await tx1.wait() // Send token console.log( @@ -133,7 +133,7 @@ const main = async function (...args: string[]) { } ) const txReceipt = await tx2.wait() - + const logs = txReceipt.events?.find( // eslint-disable-next-line @typescript-eslint/no-explicit-any (e: any) =>