Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DID
: Decentralized identifiers (DIDs) (XLS-40): #4636DID
: Decentralized identifiers (DIDs) (XLS-40): #4636Changes from 1 commit
cef1f64
2f4c285
99b53be
5916f5f
7ee38f9
27ad50c
ed9e915
10b6ff7
7fc2015
298077f
04066ae
13dac8e
7609a66
4705908
f347bae
6bda30b
31117f7
4acc54b
b0c99a4
fa63fc3
36716d6
c6e6b26
d02176b
7eb733f
d65b77f
9885bf5
ea560af
7c2768d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
It's your call, but I don't find much value in making this a separate function. I'd probably just make a block in the one place it's called. But also fine as-is. (Although it should live in an anonymous namespace if you do keep it a separate function).
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.
I made it a separate function because I'd like to make it a helper function for the future, but I figured that the refactor wasn't worth doing in this PR and could wait for a separate PR.
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.
That makes sense. I'm fine with it as-is. Thanks for the explanation.
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.
You should be able to just reduce this
if
/else
with:Notice that you don't check if one or both the URI and DATA fields are being set to the same value that they already hold; so it's possible for someone to "update" the object while making no change. You may want to elide the call to
update
in that case.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.
I don't think that reduction works.
What I want is: do nothing if the field doesn't exist in the transaction, delete the field if the field is an empty string, and replace it in any other case.
What my understanding of that line of code is: delete the field if it doesn't exist, and replace it in any other case.
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.
You're right, given what you're trying to do my proposed construct won't work. It's fine as it, but I wouldn't have personally structured this as you have; I'd have included two flags that, if set, indicate the type of value you're setting/clearing. So, if
sfFlags & flagURI
was set, then theURI
field is replaced with theURI
field from the transaction.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.
This was the method that @seelabs and @aanchal4 thought was most user-intuitive.