From 939869ec529525171ab26276567b3f4fa6cd50cd Mon Sep 17 00:00:00 2001 From: Vinay Singh <122733374+vnaysngh-mudrex@users.noreply.github.com> Date: Mon, 3 Jun 2024 14:00:48 +0530 Subject: [PATCH] update simulate transaction (#323) --- src/hooks/useBestV3Trade.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/hooks/useBestV3Trade.ts b/src/hooks/useBestV3Trade.ts index 34c5b31a..81d98eb2 100644 --- a/src/hooks/useBestV3Trade.ts +++ b/src/hooks/useBestV3Trade.ts @@ -246,8 +246,7 @@ export function useBestV3TradeExactIn( ...call.calldata, }), } - const payload = !isWalletCairoVersionGreaterThanZero ? payloadForContractType0 : payloadForContractType1 - const payloadBasedOnCairoVersion = isWalletCairoVersionGreaterThanZero ? payloadForContractType1 : payload + const payloadBasedOnCairoVersion = isWalletCairoVersionGreaterThanZero ? payloadForContractType1 : payloadForContractType0 const response = provider.simulateTransaction( [{ type: TransactionType.INVOKE, ...payloadBasedOnCairoVersion, signature, nonce }], { @@ -568,8 +567,7 @@ export function useBestV3TradeExactOut( ...call.calldata, }), } - const payload = isWalletCairoVersionGreaterThanZero ? payloadForContractType0 : payloadForContractType1 - const payloadBasedOnCairoVersion = isWalletCairoVersionGreaterThanZero ? payloadForContractType1 : payload + const payloadBasedOnCairoVersion = isWalletCairoVersionGreaterThanZero ? payloadForContractType1 : payloadForContractType0 const response = provider.simulateTransaction( [{ type: TransactionType.INVOKE, ...payloadBasedOnCairoVersion, signature, nonce }],