Skip to content
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

UpdateDelegate Change UA/Collection #204

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blockiosaurus
Copy link
Contributor

Adding the ability to change the update authority or collection as the update delegate.

Copy link

vercel bot commented Dec 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
mpl-core-js-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 16, 2024 9:34pm

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark

Benchmark suite Current: ea8324b Previous: 729fde8 Ratio
CU: create a new, empty asset 11082 Compute Units 11082 Compute Units 1
Space: create a new, empty asset 91 Bytes 91 Bytes 1
CU: create a new, empty asset with empty collection 22555 Compute Units 22555 Compute Units 1
Space: create a new, empty asset with empty collection 91 Bytes 91 Bytes 1
CU: create a new asset with plugins 40123 Compute Units 40123 Compute Units 1
Space: create a new asset with plugins 194 Bytes 194 Bytes 1
CU: create a new asset with plugins and empty collection 46145 Compute Units 46145 Compute Units 1
Space: create a new asset with plugins and empty collection 194 Bytes 194 Bytes 1
CU: list an asset 30237 Compute Units 30237 Compute Units 1
CU: sell an asset 38824 Compute Units 38824 Compute Units 1
CU: list an asset with empty collection 37795 Compute Units 37795 Compute Units 1
CU: sell an asset with empty collection 51152 Compute Units 51152 Compute Units 1
CU: list an asset with collection royalties 38499 Compute Units 38499 Compute Units 1
CU: sell an asset with collection royalties 56077 Compute Units 56077 Compute Units 1
CU: transfer an empty asset 6320 Compute Units 6320 Compute Units 1
CU: transfer an empty asset with empty collection 8918 Compute Units 8918 Compute Units 1
CU: transfer an asset with plugins 14604 Compute Units 14604 Compute Units 1
CU: transfer an asset with plugins and empty collection 17202 Compute Units 17202 Compute Units 1

This comment was automatically generated by workflow using github-action-benchmark.

Comment on lines -167 to +172
if ((ctx.resolved_authorities.is_some()
&& ctx
.resolved_authorities
.unwrap()
.contains(ctx.self_authority))
|| self.additional_delegates.contains(ctx.authority_info.key))
// We do not allow the root authority (either Collection or Address) to be changed by this delegate.
&& ctx.new_collection_authority.is_none() && ctx.new_asset_authority.is_none()
if (ctx.resolved_authorities.is_some()
&& ctx
.resolved_authorities
.unwrap()
.contains(ctx.self_authority))
|| self.additional_delegates.contains(ctx.authority_info.key)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think validate_update is used for both asset plugins and collection plugins. So wouldn't this allow an update delegate on an asset to remove itself from a collection, which I think we don't want per the offline discussion?

test('it cannot remove an asset from collection using update delegate', async (t) => {
test('it can remove an asset from collection using update delegate', async (t) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my other comment is true then I think we should keep tests for not allowing asset update delegates and asset additional update delegates.

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.

2 participants