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

feat: Integrate NFT api to display image & names in simulations includes erc721s #12160

Open
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

OGPoyraz
Copy link
Member

@OGPoyraz OGPoyraz commented Nov 4, 2024

Description

This PR integrates NFT api to display name and image of collection for nfts within simulations include ERC721 nfts.

Related issues

Fixes:

Manual testing steps

  1. Go to Opensea, try to buy https://opensea.io/assets/ethereum/0xd4307e0acd12cf46fd6cf93bc264f5d5d1598792/41757 (you don't need to buy) - this is ERC721
  2. See collection name and image in simulations

Screenshots/Recordings

Before

1

After

2

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

@OGPoyraz OGPoyraz requested a review from a team as a code owner November 4, 2024 13:39
@github-actions github-actions bot added the team-confirmations Push issues to confirmations team label Nov 4, 2024
@OGPoyraz OGPoyraz changed the title Integrate NFT api to display names for nfts within simulations includ… feat: Integrate NFT api to display image & names in simulations includes erc721s Nov 4, 2024
@OGPoyraz OGPoyraz added the Run Smoke E2E Triggers smoke e2e on Bitrise label Nov 4, 2024
Copy link
Contributor

github-actions bot commented Nov 4, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 3493505
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1efd9dcb-27e5-468e-b0b6-21287f1c30d2

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@sleepytanya
Copy link
Contributor

Bitrise buildshttps://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8d445077-9d44-4c22-b759-7dba6b39f8ea?tab=artifacts

NFT name and image within simulations for ERC721 NFTs are successfully displayed on Android and iOS devices.

iOS:

IMG_0266

Android:

Screenshot_20241104_143826_MetaMask

@sleepytanya sleepytanya added the QA Passed A successful QA run through has been done label Nov 4, 2024
@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 5, 2024
Copy link
Contributor

github-actions bot commented Nov 5, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 26e42ea
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/a2be44df-43fb-4bec-a398-b6fa5ad5c34d

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Project coverage is 55.79%. Comparing base (080a77b) to head (26e42ea).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nts/hooks/DisplayName/useNftCollectionsMetadata.ts 95.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #12160      +/-   ##
==========================================
+ Coverage   55.76%   55.79%   +0.03%     
==========================================
  Files        1785     1786       +1     
  Lines       40325    40352      +27     
  Branches     5045     5051       +6     
==========================================
+ Hits        22486    22514      +28     
+ Misses      16292    16290       -2     
- Partials     1547     1548       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 5, 2024
@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 8, 2024
Copy link
Contributor

github-actions bot commented Nov 8, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: 6e5ce92
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/d71b3538-2f09-4f1e-8bc4-5cd6051956c8

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

app/components/hooks/DisplayName/useDisplayName.ts Outdated Show resolved Hide resolved
app/components/UI/Name/Name.tsx Outdated Show resolved Hide resolved
jpuri
jpuri previously approved these changes Nov 13, 2024
@OGPoyraz OGPoyraz dismissed stale reviews from jpuri and pedronfigueiredo via b730f14 November 15, 2024 11:10
@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: e742c68
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/6b9e848f-c482-47ba-bf48-bc3c4b32cc88

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 19, 2024
@OGPoyraz OGPoyraz added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Nov 19, 2024
Copy link
Contributor

github-actions bot commented Nov 19, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: 19c9a7a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/1e6db795-df5b-4f10-9a04-a5e562f84768

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Tip

  • Check the documentation if you have any doubts on how to understand the failure on bitrise

Copy link

sonarcloud bot commented Nov 19, 2024

}

export function useNftCollectionsMetadata(requests: UseDisplayNameRequest[]) {
const chainId = requests?.[0]?.variation;
Copy link
Member

Choose a reason for hiding this comment

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

We shouldn't really assume they all have the same chain ID since they are distinct requests.

I refactored the same hook in the extension to support alternate chains in the requests, can we copy and paste here?

const nftCollections = useNftCollectionsMetadata(requests);

return requests.map(({ value }) => {
const nftCollectionProperties = nftCollections[value.toLowerCase()];
Copy link
Member

Choose a reason for hiding this comment

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

Can we add the standard type check to return undefined if it's not an Ethereum address?

return requests.map(({ value }) => {
const nftCollectionProperties = nftCollections[value.toLowerCase()];

const isNotSpam = nftCollectionProperties?.isSpam === false;
Copy link
Member

Choose a reason for hiding this comment

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

Minor, could we also just early return if it is spam?

import { UseDisplayNameRequest } from './useDisplayName';
import { useNftCollectionsMetadata } from './useNftCollectionsMetadata';

export interface UseNFTNameResponse {
Copy link
Member

Choose a reason for hiding this comment

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

Minor, type rather than interface?

import { useNftCollectionsMetadata } from './useNftCollectionsMetadata';

export interface UseNFTNameResponse {
nftCollectionName: string | undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Minor, in this context is name and image sufficient as the rest is implied?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
QA Passed A successful QA run through has been done Run Smoke E2E Triggers smoke e2e on Bitrise team-confirmations Push issues to confirmations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants