Skip to content

Commit

Permalink
update simulate transaction (#323)
Browse files Browse the repository at this point in the history
  • Loading branch information
vnaysngh-mudrex authored Jun 3, 2024
1 parent 0356463 commit 939869e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hooks/useBestV3Trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }],
{
Expand Down Expand Up @@ -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 }],
Expand Down

0 comments on commit 939869e

Please sign in to comment.