Skip to content

Conversation

@ntn-x2
Copy link
Contributor

@ntn-x2 ntn-x2 commented Aug 4, 2021

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:

  • I have verified that the code works
    • No panics! (checked arithmetic ops, no indexing array[3] use get(3), ...)
  • I have verified that the code is easy to understand
  • This PR does not introduce new custom types
  • I have left the code in a better state
  • I have documented the changes (where applicable)

@ntn-x2 ntn-x2 self-assigned this Aug 4, 2021
ntn-x2 added 12 commits August 4, 2021 10:55
* 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
@ntn-x2 ntn-x2 marked this pull request as ready for review August 4, 2021 11:13
@ntn-x2 ntn-x2 requested review from weichweich and wischli and removed request for wischli August 4, 2021 11:13
Copy link
Contributor

@wischli wischli left a 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.

//! - `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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
//! - `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.
Copy link
Contributor

@wischli wischli Aug 4, 2021

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?

Copy link
Contributor Author

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?

Copy link
Contributor

@weichweich weichweich left a 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?

Copy link
Contributor

@weichweich weichweich left a comment

Choose a reason for hiding this comment

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

Love it!

@ntn-x2 ntn-x2 merged commit 5f92a39 into develop Aug 4, 2021
@ntn-x2 ntn-x2 deleted the aa-did-pallet-origin branch August 4, 2021 13:49
@wischli wischli mentioned this pull request Aug 6, 2021
6 tasks
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.

4 participants