From e4788d173d7b56bbdc4c713d9693b0192b956cfb Mon Sep 17 00:00:00 2001 From: Raphael Flechtner Date: Wed, 15 Mar 2023 16:29:59 +0100 Subject: [PATCH] fix: use runtime version to check for ethereum linking --- packages/did/src/DidLinks/AccountLinks.chain.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/did/src/DidLinks/AccountLinks.chain.ts b/packages/did/src/DidLinks/AccountLinks.chain.ts index a570a51ea..ae62cbc60 100644 --- a/packages/did/src/DidLinks/AccountLinks.chain.ts +++ b/packages/did/src/DidLinks/AccountLinks.chain.ts @@ -41,21 +41,13 @@ type EncodedMultiAddress = | { AccountId32: Uint8Array } /** - * Detects whether api decoration indicates presence of Ethereum linking enabled pallet. + * Detects whether the spec version indicates presence of Ethereum linking enabled pallet. * * @param api The api object. * @returns True if Ethereum linking is supported. */ function isEthereumEnabled(api: ApiPromise): boolean { - const removeType = api.createType( - api.tx.didLookup.removeAccountAssociation.meta.args[0]?.type?.toString() || - 'bool' - ) - const associateType = api.createType( - api.tx.didLookup.associateAccount.meta.args[0]?.type?.toString() || 'bool' - ) - - return 'isAccountId20' in removeType || 'isEthereum' in associateType + return api.runtimeVersion.specVersion.gten(11000) } /**