-
Notifications
You must be signed in to change notification settings - Fork 107
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
Make PrincipalId abstract #1128
Conversation
This is the ASAP implementation called for by Andreas in For Linkedup, we also need |
Also, should we map this, when used as a parameter in the IDL, to
|
Cannot be, it is only 32 bits! |
Right! (I wasn’t complaining about the hash, but the misuse). Let’s continue that LinkedUp discussion in dfinity/linkedup#6 (comment) |
Do we need blob in the IDL for anything else, why not rename IDL blob to Principal ID. Also, I'm really note sure we should identify users with canisters - aren't there operations on canister but not users (like upgrade) that don't make sense? |
Well, you can only upgrade a canister if are its admin (or later: if you have the capability). For users, nobody gets that ability. There are always things you can do to some canisters that you can’t do to other canisters or users. |
done in this commit: * Abstract `PrincipalId` * Equality, ordering * Primitive conversion to blob (meaning that hashing, pretty-printing can be done in stdlib) * IDL mapping as blob.
799d030
to
090fd53
Compare
Ok, this should be all we need to to make the caller abstract, without breaking too much. IDL type discussion can happen later if we don't want that bike shed to hold up this ASAP change. |
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.
In case you need expedited delivery.
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.
LGTM, my only suggestion would be to rename it to simply Principal
-- the Id suffix seems redundant.
@stanleygjones knows about this. We've already corrected it together, once. I think he reverted it because he was missing this PR. He can confirm. |
fixing an omission from #1128 this was reported by @stanleygjones in https://dfinity.slack.com/archives/CGA566TPV/p1581702931005500
fixing an omission from #1128 this was reported by @stanleygjones in https://dfinity.slack.com/archives/CGA566TPV/p1581702931005500
done in this commit:
PrincipalId
(meaning that hashing, pretty-printing can be done in stdlib)