-
Notifications
You must be signed in to change notification settings - Fork 11
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
unique tokenEntity id by both image and media #225
unique tokenEntity id by both image and media #225
Conversation
tested on local machine on AHK |
src/mappings/shared/token/utils.ts
Outdated
export function generateTokenId(collectionId: string, nft: NE): string | undefined { | ||
if (!nft.image && !nft.media) { | ||
warn(OPERATION, `MISSING NFT MEDIA ${nft.id}`) | ||
return undefined | ||
} | ||
|
||
return nftMedia | ||
const image = nft.image ?? '' | ||
const media = nft.media ?? '' | ||
const mediaHash = md5(image + media) |
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.
Check #224 pls
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.
what the difference?
md5(meta.image) + ':' md5(meta.animation_url)
is opaque just same as md5(image + media)
is opaque
also both image
and animation_utl
can be null | undefined
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.
plus it should be unique per collection
could be a situation where 2 different collection each have same artwork
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.
for the sake of speeding things along i complied
but i do not understand what difference does it make
…nEntity-is-merging-nfts
PR Type
Context
change from
tokenId = <collection_id>-<md5(image ?? media)>
to
tokenId = <collectionId>-md5(imge + media)
Did your issue had any of the "$" label on it?