Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge duplicate token transaction data from evmscan #832

Merged
merged 1 commit into from
Sep 12, 2024

Conversation

samholmes
Copy link
Collaborator

@samholmes samholmes commented Sep 11, 2024

CHANGELOG

Does this branch warrant an entry to the CHANGELOG?

  • Yes
  • No

Dependencies

none

Description

none

Copy link
Member

@paullinator paullinator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional change for clarity

@@ -557,6 +567,11 @@ export function mergeEdgeTransactions(
isSend: nativeAmount.startsWith('-'),
nativeAmount,
networkFee: mergedNetworkFee,
...(mergedParentNetworkFee != null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get it. but this is a good example of high cognitive load to understand. Maybe in the future declare the tx object outside of the .set(), then add the parentNetworkFee to it if needed. Then call the .set() with the tx object

const edgeTransaction: EdgeTransaction =  {
      ...existingTransaction,
      isSend: nativeAmount.startsWith('-'),
      nativeAmount,
      networkFee: mergedNetworkFee,
      ourReceiveAddresses: [
        ...existingTransaction.ourReceiveAddresses,
        ...transaction.ourReceiveAddresses
      ]
}

if (mergedParentNetworkFee != null) {
  edgeTransaction.parentNetworkFee = mergedParentNetworkFee
}

txidToTransaction.set(uniqueKey, edgeTransaction)

@samholmes samholmes merged commit 85f4c54 into master Sep 12, 2024
2 checks passed
@samholmes samholmes deleted the sam/fix-token-amount-merging branch September 12, 2024 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants