-
Notifications
You must be signed in to change notification settings - Fork 0
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 validate_core_asset fn #28
Conversation
let (mut royalties, collection) = | ||
if let UpdateAuthority::Collection(asset_collection) = asset.update_authority { | ||
// Collection account must be provided. | ||
if maybe_collection_info.is_none() { |
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.
Nit: could be cleaner with a match
on maybe_collection_info
royalty_fee_bps, | ||
royalty_enforced: true, | ||
}) | ||
} |
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.
So this will replace validate_asset
right? If so, remember to remove validate_asset
from all uses + toolbox goforward.
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.
Yeah, I've removed it from toolbox now and have it removed from AMM in an open PR.
royalty_enforced: true, | ||
}) | ||
} | ||
|
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.
Is the biggest difference that this now:
- Validates
maybe_collection_info
always - Extracts
whitelist_creators
+royalty_fee_bps
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 main differences are 1) it fetches the verified creators plugin in addition to royalties and 2) returns the data more generically so it can be used for both royalty and whitelist validation purposes.
The checks are the same:
- asset is owned by mpl-core
- asset is valid AssetV1
- if collection is passed in it's owned by mpl-core and is a valid CollectionV1
- collection on the asset, must match passed in collection, if present on the asset
I'll add more explicit account type checks for good measure.
No description provided.