Skip to content

Commit

Permalink
Merge pull request #51 from gnosis/fix-tx-translation-check
Browse files Browse the repository at this point in the history
fix: check if tx is eligible for translation
  • Loading branch information
jfschwarz authored Jan 18, 2023
2 parents f4de141 + 2a6bbe7 commit 72ee07a
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extension/src/transactionTranslations/uniswapMulticall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ export default {
recommendedFor: [KnownContracts.ROLES],

translate: (transaction) => {
if (!transaction.data) return [transaction]
if (!transaction.data) {
return undefined
}

let functionCalls: string[] = []
for (const fragment of uniswapMulticallInterface.fragments) {
Expand All @@ -31,10 +33,10 @@ export default {
}
}

if (functionCalls.length > 0) {
return functionCalls.map((data) => ({ ...transaction, data }))
if (functionCalls.length === 0) {
return undefined
}

return [transaction]
return functionCalls.map((data) => ({ ...transaction, data }))
},
} satisfies TransactionTranslation

0 comments on commit 72ee07a

Please sign in to comment.