-
Notifications
You must be signed in to change notification settings - Fork 7
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
adding fallback when indexer is down to fetch nfts owners #671
adding fallback when indexer is down to fetch nfts owners #671
Conversation
✅ Deploy Preview for wallet-develop-mainnet ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for wallet-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
…for-stale-nft-indexer-data
@@ -383,6 +411,14 @@ export default abstract class EVMChainSettings implements ChainSettings { | |||
|
|||
this.processNftContractsCalldata(response.contracts); | |||
const shapedNftData = this.shapeNftRawData(shapedIndexerNftData, response.contracts); | |||
|
|||
// if the owner does not comes from the indexer, let's set it | |||
shapedNftData.forEach((nft) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should only be set for erc721, which is why line 409 has a ternary like
owner: isErc1155 ? undefined : nftResponse.owner,
so here we should also only set owner if it's 1155
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this forEach
and just set it in the original mapping?
owner: isErc1155 ? account : nftResponse.owner,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I updated to use owner: nftResponse.owner ?? account
in mapping and remove forEach
const getAccount = jest.fn().mockImplementation(() => null); | ||
const getAccount = jest.fn().mockImplementation(() => ({ | ||
authenticator: jest.fn().mockImplementation(() => ({ | ||
web3Provider: jest.fn().mockImplementation(() => 'do you need to get deeper?'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆
when i click Demos, it kicks me back to the home page Recording.2023-11-16.162443.mp4 |
…indexer-data' of https://github.com/telosnetwork/telos-wallet into 659-implement-back-up-query-notification-for-stale-nft-indexer-data
Fixes #659
Description
This Pull Request addresses the issue of stale NFT indexer data. It implements a backup query mechanism and user notifications for cases where the indexer data is stale. The main enhancements include:
ownerOf
andbalanceOf
updates when needed.These changes ensure that NFT ownership and quantity are accurately reflected, even when the indexer data is not up-to-date.
Test Scenarios
Currently, the indexer is up to date so I created a way to simulate the indexer is not healthy.
Videocapture
Owners-When-Indexer-Down.mp4
Checklist: