From 2c49f7d91067c26e408cbf50f9216088aa5cdeb0 Mon Sep 17 00:00:00 2001 From: Antonio Date: Tue, 31 Oct 2023 13:44:55 +0000 Subject: [PATCH] feat: error management (#802) * Error types * Update DIP provider runtime APIs types * Update packages version --- .../src/runtime/dipProvider.ts | 2 +- packages/type-definitions/src/types_11000.ts | 26 +++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/packages/type-definitions/src/runtime/dipProvider.ts b/packages/type-definitions/src/runtime/dipProvider.ts index ac84515a4..b5cb5afc2 100644 --- a/packages/type-definitions/src/runtime/dipProvider.ts +++ b/packages/type-definitions/src/runtime/dipProvider.ts @@ -20,7 +20,7 @@ export const calls: DefinitionsCall = { type: 'DipProofRequest', }, ], - type: 'Result', + type: 'Result', }, }, version: 1, diff --git a/packages/type-definitions/src/types_11000.ts b/packages/type-definitions/src/types_11000.ts index 924ad4bf1..b1ced5620 100644 --- a/packages/type-definitions/src/types_11000.ts +++ b/packages/type-definitions/src/types_11000.ts @@ -58,4 +58,30 @@ export const types11000: RegistryTypes = { Web3NameMerkleValue: 'BlockNumber', LinkedAccountMerkleKey: 'PalletDidLookupLinkableAccountLinkableAccountId', LinkedAccountMerkleValue: 'Null', + RuntimeApiDipProofError: { + _enum: { + IdentityNotFound: null, + IdentityProviderError: 'CombineError', + MerkleProofError: 'DidMerkleProofError', + }, + }, + CombineError: { + _enum: { + A: 'DidIdentityProviderError', + B: 'DidIdentityProviderError', + C: 'DidIdentityProviderError', + }, + }, + DidIdentityProviderError: { + _enum: ['DidNotFound', 'Internal'], + }, + DidMerkleProofError: { + _enum: [ + 'DidNotFound', + 'KeyNotFound', + 'LinkedAccountNotFound', + 'Web3NameNotFound', + 'Internal', + ], + }, }