-
Notifications
You must be signed in to change notification settings - Fork 2
Implement core NFT views to conform to Flow NFT Metadata standard #16
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
contracts/AllDay.cdc
Outdated
//------------------------------------------------------------ | ||
|
||
// The address to which royalties should be deposited | ||
pub fun RoyaltyAddress() : Address { |
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.
Do we need to have a RoyaltyAddress in order to implement the metadata views?
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.
No, I'll get rid of this method and move the variable into resolveView()
lib/go/test/allday_test.go
Outdated
mediasView := result[3] | ||
editions := mediasView.Fields[0].(cadence.Array) | ||
assert.Equal(t, "https://assets.nflallday.com/editions/1/media/image?format=jpeg&width=512", | ||
editions.Values[0].(cadence.Struct).Fields[0].(cadence.Struct).Fields[0].ToGoValue()) |
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.
nice tests! You could have a helper func that takes in the index and editions
and returns the result of
editions.Values[0].(cadence.Struct).Fields[0].(cadence.Struct).Fields[0].ToGoValue())
that you could use in the assert.Equal just to make the tests a little less verbose
The Metadata Views implementations LGTM |
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.
Nice! Non blocking, but would you mind adding some info to the Readme about the metadata views as well?
Implement Core NFT Views from the MetadataViews contract to conform to the Flow NFT Metadata standard https://www.flow-nft-catalog.com/