Skip to content

Conversation

@danenbm
Copy link
Contributor

@danenbm danenbm commented Apr 28, 2023

Idea to bring back InternalUpdateArgs, but instead of implementing From trait like last time, use a default() and then populate as we go in validate_update.

This prevents us from having to destructure the UpdateArgs a second time within Metadata::update_v1.

However, this increases the binary size from 700240 to 702752 so I think we should avoid this implementation in the short term.

danenbm and others added 30 commits April 4, 2023 10:50
* Add support in Delegate and Revoke for Authority, Data,
CollectionItem, and ProgrammableConfigItem Metadata
delegates.
* Remove Update Metadata delegate.
* Modify authority check to separate out item and
collection-level delegates.
* Add V2 Update args struct to allow user to specify token
standard.
* Check that new delegates are only changing metadata
for which they are meant to have access.
* Modify Update handler to update metadata fields based
on the delegate type.
* Also add macro to help destructure UpdateArgs fields.
* Update is still changed to Data but order is preserved.
* Also remove unnecessary Option for token_record in Update.
* Add some comments clarifying authority types in Unverify.
* Return the value derived in the delegate method.
* Also add a test for Authority delegate.
* If the collection toggle value passed in by a collection-level
delegate contains a new collection value, that is used when
determining authority.
* This allows for setting a collection using a collection delegate
when previously there was no collection in the metadata.
* Also add tests for delegates on collection parent: collection
delegate can update members of collection but collection item
delegate cannot.
* Also add test to fail updating to a verified collection.
…ction

This is important because the passed in collection is also used for
permissions.  If we allowed the collection-level programmable config
delegate to pass in a new collection, it would also use that value
in `get_authority_type`.
* Added a test that uses old token-metadata lib to build the
instructions and interact with the data.
* As part of this needed to run `cargo update -p mpl-token-metadata@1.9.1`
which resulted in the following updates to lateset versions:
    Updating crates.io index
    Updating git repository `https://github.com/metaplex-foundation/rooster`
    Updating mpl-token-metadata v1.8.0 -> v1.9.1
    Updating mpl-utils v0.0.6 -> v0.1.0
    Updating rooster v0.1.0 (https://github.com/metaplex-foundation/rooster#6923ee3b) -> #ca1221c9
* Use different UpdateArg types for different delegates

* Change new UpdateArg types to V2

Also use a Default method to cleanup InternalUpdateArgs
danenbm added 16 commits April 21, 2023 01:27
- Adding authorization data to all UpdateArgs variants.
- Add helper functions to create default versions for each
UpdateArgs variant.
- Add back in legacy support for ProgrammableConfig delegate
so that it can use V1 UpdateArgs.
- Update tests to use new UpdateArgs.
- Add more tests for ProgrammableConfig delegate.
- Update "old lib" test to test ProgrammableConfig delegate.
Make consistent in instruction builder and shank annotation.
* Remove InternalUpdateArgs struct and `From` trait
implementation.
* Deconstruct `UpdateArgs` where used.
* Remove redundant authority type and metadata delegate
role checks from `Metadata::update_v1` because `validate_update`
already checks that the authority is allowed to perform an update,
and the `UpdateArgs` enforces that the authority is only changing
fields for which it is authorized.
Also make match statements in validate_update
more concise.
* Holder authority test.
* Pass with same token standard being passed in.
* Token doesn't match mint test.
* Metadata doesn't match mint test.
* Wrong edition test.
* Some failure cases around collection-level delegates.
@danenbm danenbm changed the base branch from master to danenbm/new-update April 28, 2023 19:26
Base automatically changed from danenbm/new-update to master May 1, 2023 20:02
@danenbm
Copy link
Contributor Author

danenbm commented May 1, 2023

Omitted this from #1058 due to size constraints.

@danenbm danenbm closed this May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants