-
Notifications
You must be signed in to change notification settings - Fork 47
feat: use DidOrigin for DID update and deletion #231
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
Conversation
* feat: initial commit * feat: pallet compiling * wip: fixing test cases * wip: refactoring test cases * test: unit tests passing again * benchmark tests passing * test: attestation unit tests passing * chore: clippy fixes * chore: fmt fixes * bench: re-execute benchmarks for delegation and attestation + temporarily remove benchmarks from peregrine runtime * fix: adjust pre-condition for an attestation unit test * wip: add initial support for delegation storage migrations * delegation storage migrator compiling * wip: storage migrator working, now writing unit tests for it * test: unit tests passing * chore: clippy hints * chore: further clippy fixes * chore: fmt * wip: adjusting last things before possible to review * chore: clippy + fmt * fix: address part of PR review comments * fix: more comments from PR review * wip: change vector of versions to enum * test: unit tests refactor for the new storage migrator version * chore: refactor * test: unit tests passing again * chore: move deprecated type to deprecated.rs * chore: refactor import/export * doc: refine documentation * chore: fmt + clippy * test: add TODO to improve post_migration tests * feat: remove test feature from traits * test: add checks during migration in try-runtime * bench: add spiritnet benchmarks for delegation and attestation * feat: additional logs for count of migrated nodes * chore: fmt * chore: removed useless file * chore: bump runtime version * fix: PR comments * fix: re-introduce root_id in delegation creation hash * chore: capitalize storage version enum * chore: move migrations in their own module * chore: move migrations.rs out of the migrations folder * fix: add check for parent revocation status when creating a delegation * chore: fmt * feat: remove revoke_hierarchy extrinsic * bench: add peregrine benchmarks * bench: re-run delegation and attestation default benchmarks * chore: fmt
wischli
left a comment
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! Just found a minor typo and I have a question.
pallets/did/src/lib.rs
Outdated
| //! - `create` - Register a new DID on the KILT blockchain under the given DID | ||
| //! identifier. | ||
| //! - `update` - Update any keys or the endpoint URL of an existing DID. | ||
| //! - `dekete` - Delete the specified DID and all related keys from the KILT |
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.
| //! - `dekete` - Delete the specified DID and all related keys from the KILT | |
| //! - `delete` - Delete the specified DID and all related keys from the KILT |
| Call::Attestation(_) => Some(did::DidVerificationKeyRelationship::AssertionMethod), | ||
| Call::Ctype(_) => Some(did::DidVerificationKeyRelationship::AssertionMethod), | ||
| Call::Delegation(_) => Some(did::DidVerificationKeyRelationship::CapabilityDelegation), | ||
| // DID creation is not allowed through the DID proxy. |
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.
Just wondering what can happen if we allowed this?
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.
The verification prior to dispatch would always fail with a DidNotPresent error as there's no DID in the storage. I think it would be most clear to fail with a BadOrigin error, as is the case now, rather than with a DidNotPresent. What do you think?
weichweich
left a comment
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.
few minor things that i would like to talk about.
Do we need the generic origin? Can we not require a did origin?
weichweich
left a comment
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.
Love it!
fixes KILTProtocol/ticket#1490
Please include a summary of the changes provided with this pull request and which issue has been fixed.
Please also provide some context if necessary.
Checklist:
array[3]useget(3), ...)