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

updating metadata with multiple uris fix #11538

Merged
merged 1 commit into from
May 16, 2022

Conversation

trepca
Copy link
Contributor

@trepca trepca commented May 16, 2022

No description provided.

key = metadata_entry[0]
if key == b"u":
new_metadata.append((b"u", [condition.rest().rest().first().atom] + list(metadata_entry[1:])))
else:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it reasonable to assume that h is the only other metadata key? I thought we were going to support keys like l, lh, m and mh (or similar), but maybe those can't be updated at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, only made a fix for current codebase, this will need to be expanded as part of the "support updating metadata url and license" task

for metadata_entry in metadata_list:
key = metadata_entry[0]
if key == b"u":
new_metadata.append((b"u", [condition.rest().rest().first().atom] + list(metadata_entry[1:])))
Copy link
Contributor

Choose a reason for hiding this comment

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

Why list(metadata_entry[1:]) here? Shouldn't be metadata_entry[1]? Since it's a list of uris

Copy link
Contributor Author

Choose a reason for hiding this comment

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

metadata_entry looks something like this when deserialized: (b'u', 'url1', 'url2' ... ) not sure why .as_python deserializes it like that

Copy link
Contributor

@paninaro paninaro left a comment

Choose a reason for hiding this comment

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

lgtm

@trepca trepca merged commit 5128d50 into Chia-Network:main_dids May 16, 2022
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