-
Notifications
You must be signed in to change notification settings - Fork 1
Updating CTL version, fixing for breaking changes #39
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
Conversation
2652218 to
62f5ec0
Compare
CTL updates caused it to throw a bigger error than it was before. Unsure how it wasn't throwing a bigger error before, the way we were providing the function didn't make any sense
samuelWilliams99
left a comment
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 assume merging this will mean we'll need to update the ctl ref in the monorepo as well?
| , image: params.imageUri | ||
| , mediaType: Nothing | ||
| , description: [ params.name, params.description ] | ||
| , description: Just params.description |
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 seems like an API change? will the frontend handle this correctly?
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.
You're right, forgot about this, I'll make the update in this PR
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.
The description and name aren't actually parsed from the metadata, they're retrieved from the database. However the image field is parsed from the metadata, and that format changed from an array to a string, so I updated the parsing for it. According to the cip25 standard the image field can be a string or an array, so I made the parsing handle both possibilities, and this also means the nfts minted before this update are still useable
It would probably be for the best. Maybe we should merge into some kind of staging branch instead? |
|
Perhaps, but it's a relatively uncommon change, I think it's fine to just pr both of them |
…racts into calum/ctl-breaking-changes
The fix implemented by that branch was merged into `develop`
| { caseArray = | ||
| ( lmap (const "Image array does not contain a string") <<< | ||
| decodeAeson | ||
| ) <=< note "Image field contains empty array" <<< head |
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 believe in the CIP standard, long strings are split into arrays, is this how the image field works? or is each element intended to be a separate image?
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 metadata created by us, we shouldn't be getting any images which are long strings split up, unless we change the length of our image value.
We could use CTL's cip25 modules to parse this and that should handle long strings being split into arrays, but then the NFTs minted previously would no longer be valid. I guess it's okay though, the old nfts are just for testing anyways
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.
We'll need to support arbitrary cNFTs that adhere to the standard, as we won't always be the ones minting them. In future, artists will want a way to take their existing nft and import it to the protocol.
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.
Closes #37 and #30
Changes:
Contract'sextraConfiggetWalletBalanceso it doesn't cause a major error, see e04e2f2 and https://github.com/mlabs-haskell/nft-marketplace/tree/calum/contracts-updatesTODO:
extraConfigprojectIdliftXfunctions to make interoperating with all of CTL'sContractfunctions easier, but I don't think it's worth it right now