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

Deduplicate NFT transfers #2164

Merged
merged 2 commits into from
Jun 23, 2021
Merged

Deduplicate NFT transfers #2164

merged 2 commits into from
Jun 23, 2021

Conversation

Nana-EC
Copy link
Contributor

@Nana-EC Nana-EC commented Jun 22, 2021

Detailed description:
A duplicate nft transfer entry exists when the /api/v1/transactions?account.id={account} is called and the account in question is the recipient.

  • Update aggregation to use distinct jsonb_build_object
  • Add an extra test for multiple nft transfers across different tokens in one transaction

Which issue(s) this PR fixes:
Fixes #2139

Special notes for your reviewer:
Postgres doesn't support distinct and order by for json. This should be okay though as the rows are mostly ordered prior to aggregation

Checklist

  • Documentation added
  • Tests updated

Signed-off-by: Nana-EC <nana.essilfie-conduah@hedera.com>
@Nana-EC Nana-EC added bug Type: Something isn't working P1 rest Area: REST API nft Non-Fungible Token labels Jun 22, 2021
@Nana-EC Nana-EC added this to the Mirror 0.37.0 milestone Jun 22, 2021
@Nana-EC Nana-EC requested a review from a team June 22, 2021 22:58
@Nana-EC Nana-EC self-assigned this Jun 22, 2021
@codecov
Copy link

codecov bot commented Jun 22, 2021

Codecov Report

❗ No coverage uploaded for pull request base (main@1a4df5d). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2164   +/-   ##
=======================================
  Coverage        ?   81.72%           
  Complexity      ?     2135           
=======================================
  Files           ?      412           
  Lines           ?    10982           
  Branches        ?      931           
=======================================
  Hits            ?     8975           
  Misses          ?     1695           
  Partials        ?      312           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1a4df5d...b606476. Read the comment docs.

@steven-sheehy steven-sheehy changed the title Deduplicate nft trasnfers list Deduplicate NFT transfers Jun 22, 2021
steven-sheehy
steven-sheehy previously approved these changes Jun 23, 2021
Signed-off-by: Nana-EC <nana.essilfie-conduah@hedera.com>
@sonarcloud
Copy link

sonarcloud bot commented Jun 23, 2021

Copy link
Collaborator

@xin-hedera xin-hedera left a comment

Choose a reason for hiding this comment

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

LGTM

@Nana-EC Nana-EC merged commit a32f3f2 into main Jun 23, 2021
@Nana-EC Nana-EC deleted the nft-trasnfers-deduplicate branch June 23, 2021 18:08
Nana-EC added a commit that referenced this pull request Jun 23, 2021
* Deduplicate nft trasnfers list

A duplicate nft transfer entry exists when the /api/v1/transactions?account.id={account} is called and the account in question is the recipient.

- Update aggregation to use `distinct jsonb_build_object`
- Add an extra test for multiple nft transfers across different tokens in one transaction

Signed-off-by: Nana-EC <nana.essilfie-conduah@hedera.com>
Nana-EC added a commit that referenced this pull request Jun 24, 2021
* Deduplicate nft trasnfers list
Cherry pick Deduplicate nft trasnfers list

A duplicate nft transfer entry exists when the /api/v1/transactions?account.id={account} is called and the account in question is the recipient.

- Update aggregation to use `distinct jsonb_build_object`
- Add an extra test for multiple nft transfers across different tokens in one transaction

Signed-off-by: Nana-EC <nana.essilfie-conduah@hedera.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Type: Something isn't working nft Non-Fungible Token P1 rest Area: REST API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate nft transfers returned by /transactions rest api
4 participants