From ff179b479a1f8dd584be4bacb102e3c5760aad31 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 19 Jul 2021 14:55:09 +0200 Subject: [PATCH 1/5] feat: types for new delegation pallet (runtime version 17) --- package.json | 2 +- src/index.ts | 25 ++++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 40e3ca3..9409100 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,5 @@ "@polkadot/types": "^3.11.1", "typescript": "^3.9.7" }, - "version": "0.1.9" + "version": "0.1.10" } diff --git a/src/index.ts b/src/index.ts index 4dd2662..9e55dca 100644 --- a/src/index.ts +++ b/src/index.ts @@ -502,6 +502,25 @@ export const types12: RegistryTypes = { }, }; +export const types17: RegistryTypes = { + ...types12, + // Delegation updated types + DelegationNode: { + hierarchy_root_id: "DelegationNodeIdOf", + parent: "Option", + children: "BTreeSet", + details: "DelegationDetails", + }, + DelegationDetails: { + owner: "DelegatorIdOf", + revoked: "bool", + permissions: "Permissions", + }, + DelegationHierarchyDetails: { + ctype_hash: "CtypeHashOf", + }, +}; + export const typeBundleForPolkadot: OverrideBundleDefinition = { types: [ { @@ -517,8 +536,12 @@ export const typeBundleForPolkadot: OverrideBundleDefinition = { types: types10, }, { - minmax: [12, undefined], + minmax: [12, 16], types: types12, }, + { + minmax: [17, undefined], + types: types17, + }, ], }; From 6ca305679bad9b60d57a94bab6f1c988c98894c6 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Mon, 19 Jul 2021 17:17:33 +0200 Subject: [PATCH 2/5] fix: use camel case --- src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9e55dca..e5f2642 100644 --- a/src/index.ts +++ b/src/index.ts @@ -506,7 +506,7 @@ export const types17: RegistryTypes = { ...types12, // Delegation updated types DelegationNode: { - hierarchy_root_id: "DelegationNodeIdOf", + hierarchyRootId: "DelegationNodeIdOf", parent: "Option", children: "BTreeSet", details: "DelegationDetails", @@ -517,7 +517,7 @@ export const types17: RegistryTypes = { permissions: "Permissions", }, DelegationHierarchyDetails: { - ctype_hash: "CtypeHashOf", + ctypeHash: "CtypeHashOf", }, }; From 5d36bdd4f5d768fbe8fbd5456dfb5c9d75084db1 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 4 Aug 2021 11:31:11 +0200 Subject: [PATCH 3/5] feat: add support for DID origin integration for DID updates and deletions --- src/index.ts | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e5f2642..367951d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -521,6 +521,26 @@ export const types17: RegistryTypes = { }, }; +export const types18: RegistryTypes = { + ...types17, + // DID management update + DidCreationDetails: { + did: "DidIdentifierOf", + newKeyAgreementKeys: "BTreeSet", + newAttestationKey: "Option", + newDelegationKey: "Option", + newEndpointUrl: "Option", + }, + DidUpdateDetails: { + newAuthenticationKey: "Option", + newKeyAgreementKeys: "BTreeSet", + attestationKeyUpdate: "DidVerificationKeyUpdateAction", + delegationKeyUpdate: "DidVerificationKeyUpdateAction", + publicKeysToRemove: "BTreeSet", + newEndpointUrl: "Option", + }, +}; + export const typeBundleForPolkadot: OverrideBundleDefinition = { types: [ { @@ -540,8 +560,12 @@ export const typeBundleForPolkadot: OverrideBundleDefinition = { types: types12, }, { - minmax: [17, undefined], + minmax: [17, 17], types: types17, }, + { + minmax: [18, undefined], + types: types18, + }, ], }; From 454cde640fe5d1931bfa0bff5aac4907cb3fd390 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 4 Aug 2021 12:12:46 +0200 Subject: [PATCH 4/5] fix: remove old DID types from types18 --- src/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/index.ts b/src/index.ts index 367951d..2d8081a 100644 --- a/src/index.ts +++ b/src/index.ts @@ -523,6 +523,11 @@ export const types17: RegistryTypes = { export const types18: RegistryTypes = { ...types17, + // Remove old DID types + DidCreationOperation: undefined, + DidUpdateOperation: undefined, + DidDeletionOperation: undefined, + // DID management update DidCreationDetails: { did: "DidIdentifierOf", From 40da6308365b9a543d99d0eee78a9c1647719441 Mon Sep 17 00:00:00 2001 From: Antonio Antonino Date: Wed, 4 Aug 2021 13:11:35 +0200 Subject: [PATCH 5/5] fix: bump version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 9409100..8f3ec40 100644 --- a/package.json +++ b/package.json @@ -19,5 +19,5 @@ "@polkadot/types": "^3.11.1", "typescript": "^3.9.7" }, - "version": "0.1.10" + "version": "0.1.12" }