From 7fcbeb1e9cb5e018996ba8c1f475590f0f572b24 Mon Sep 17 00:00:00 2001 From: Jaco Date: Wed, 9 Jun 2021 12:13:10 +0300 Subject: [PATCH] Use correct ss58Format to encode loan addresses (#5523) --- packages/page-parachains/src/Crowdloan/Fund.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/page-parachains/src/Crowdloan/Fund.tsx b/packages/page-parachains/src/Crowdloan/Fund.tsx index f55b57044e..7c7a34f442 100644 --- a/packages/page-parachains/src/Crowdloan/Fund.tsx +++ b/packages/page-parachains/src/Crowdloan/Fund.tsx @@ -33,8 +33,8 @@ interface Contributions { const NO_CONTRIB: Contributions = { contributors: [], myAccounts: [] }; -function extractContributors (allAccounts: string[], keys: StorageKey[]): Contributions { - const contributors = keys.map((k) => encodeAddress(k)); +function extractContributors (allAccounts: string[], keys: StorageKey[], ss58Format?: number): Contributions { + const contributors = keys.map((k) => encodeAddress(k, ss58Format)); return { contributors, @@ -61,7 +61,7 @@ function Fund ({ bestNumber, className, isOngoing, leasePeriod, value: { childKe api.rpc.childstate .getKeys(childKey, '0x') .then((keys) => setContributors( - extractContributors(allAccounts, keys)) + extractContributors(allAccounts, keys, api.registry.chainSS58)) ) .catch(console.error); }, [allAccounts, api, childKey, trigger]);