From ae9ab4008a91f6571aff5b193edd1daa7b3cb55d Mon Sep 17 00:00:00 2001 From: abefernan <44572727+abefernan@users.noreply.github.com> Date: Tue, 11 Apr 2023 16:38:17 +0200 Subject: [PATCH] Remove checkValidatorAddress --- lib/displayHelpers.ts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/lib/displayHelpers.ts b/lib/displayHelpers.ts index a84edb3..e8654cd 100644 --- a/lib/displayHelpers.ts +++ b/lib/displayHelpers.ts @@ -126,32 +126,6 @@ const checkAddress = (input: string, chainAddressPrefix: string) => { return null; }; -/** - * Returns an error message for invalid addresses. - * - * Returns null of there is no error. - */ -const checkValidatorAddress = (input: string, chainAddressPrefix: string): string | null => { - if (!input) return "Empty"; - let prefix; - try { - ({ prefix } = fromBech32(input)); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - } catch (error: any) { - return error.toString(); - } - - if (prefix !== chainAddressPrefix) { - return `Expected address prefix '${chainAddressPrefix}' but got '${prefix}'`; - } - - if (input.length !== 52) { - return "Invalid address length in validator address. Must be 52 bytes."; - } - - return null; -}; - /** * Returns a link to a transaction in an explorer if an explorer is configured * for transactions. Returns null otherwise. @@ -171,5 +145,4 @@ export { examplePubkey, checkAddress, explorerLinkTx, - checkValidatorAddress, };