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

Add new events support to refresh cache when changes happen #1084

Merged

Conversation

danielailie
Copy link
Collaborator

No description provided.

andreibancioiu
andreibancioiu previously approved these changes Oct 9, 2024
const collectionUpdateInfo = await this.mxApiService.getCollectionByIdentifierForQuery(updateTopics.collection, 'fields=name,type');
if (collectionUpdateInfo?.type === NftTypeEnum.NonFungibleESDT || collectionUpdateInfo?.type === NftTypeEnum.SemiFungibleESDT) {
await this.triggerCacheInvalidation(
`${updateTopics.collection}-${updateTopics.nonce}`,

Choose a reason for hiding this comment

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

Double check: nonce is here as hex (not number), correct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes

@@ -18,7 +18,7 @@ export class ElasiticUpdatesConsumer {
const mintNftEvents = events?.events?.filter((e: { identifier: NftEventEnum }) => e.identifier === NftEventEnum.ESDTNFTCreate);
const burnAndUpdateNftAttributesEvents = events?.events?.filter(
(e: { identifier: NftEventEnum }) =>
e.identifier === NftEventEnum.ESDTNFTBurn || e.identifier === NftEventEnum.ESDTNFTUpdateAttributes,
e.identifier === NftEventEnum.ESDTNFTBurn || e.identifier === NftEventEnum.ESDTNFTUpdateAttributes || e.identifier === NftEventEnum.ESDTMetaDataUpdate || e.identifier === NftEventEnum.ESDTMetaDataRecreate,

Choose a reason for hiding this comment

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

Can have a collection of identifiers of interest, then do: arr.includes(value). Though, if this approach is used in other places, keep it for consistency.

@danielailie danielailie merged commit b35637b into development Oct 9, 2024
1 check failed
@danielailie danielailie deleted the TOOL-270-add-new-events-for-esdt-improvments branch October 9, 2024 13:28
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.

3 participants