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

Map historical transactions before grouping them #1505

Merged
merged 2 commits into from
May 8, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented May 6, 2024

Summary

This simplifies the mapping of historical transactions in preparation for tackling address poisoning, breaking down #1428.

We currently group domain transactions "as is". This means that we have duplicate logic for extracting the timestamp of domain transactions (of varying types) that is otherwise done in their respective mappers, e.g. for multisig transactions.

This maps domain transactions before grouping them, as well as simplifying the grouping logic. (This will allow for simpler filtering of address poisoning attempts as all transactions will be the same type.)

Changes

  • Change mapGroupTransactions to only map singular transaction (mapTransaction)
  • Map previous transaction (for date label calculation) if it exists
  • Map domain transactions before grouping them
  • Simplify grouping logic
  • Update tests accordingly (the mock data has always been wrong)

@iamacook iamacook self-assigned this May 6, 2024
@iamacook iamacook requested a review from a team as a code owner May 6, 2024 08:54
@coveralls
Copy link

coveralls commented May 6, 2024

Pull Request Test Coverage Report for Build 8989009054

Details

  • 28 of 33 (84.85%) changed or added relevant lines in 1 file are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.04%) to 92.191%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/transactions/mappers/transactions-history.mapper.ts 28 33 84.85%
Files with Coverage Reduction New Missed Lines %
src/routes/transactions/entities/tests/human-description.builder.ts 4 60.0%
Totals Coverage Status
Change from base Build 8923924899: -0.04%
Covered Lines: 6885
Relevant Lines: 7203

💛 - Coveralls

@iamacook iamacook requested a review from hectorgomezv May 7, 2024 16:33
@iamacook iamacook merged commit 3735158 into main May 8, 2024
16 checks passed
@iamacook iamacook deleted the refactor-history-mapping branch May 8, 2024 06:47
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.

None yet

3 participants