-
Notifications
You must be signed in to change notification settings - Fork 12
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 NFT Metadata queries #39
Conversation
Glad you came to the same conclusion, seems like for current purposes we need to use scripts as our actual tests and can't return any structs for now to any actual test cases |
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! It's good to see we aren't needing to make adjustments to the contract itself to cover these cases. Left some minor comments but I don't think they're blocking at all
let viewType: Type = Type<MetadataViews.NFTCollectionData>() | ||
|
||
// Iterate over each public path | ||
account.forEachStored(fun (path: StoragePath, type: Type): Bool { |
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.
My only concern here is that we might want a second script which makes sure to only return what you can actually get to. This script will return everything but that doesn't mean you can actually withdraw every nfts from every collection that comes back
I'm perfectly find with us tackling those separately though
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.
Very true. I figure we can leverage the code from #43 for that query
9ba9031
to
6a90a33
Compare
Related: #25
Note about tests:
I had to replace a script-defined struct with MetadataViews.NFTCollectionDisplay & create assertion scripts to validate return values against expected. This doesn't feel like a great way to write tests as it's fragile, and I'd prefer to construct comparison values from within the tests themselves. Definitely open to other ideas here.