From 35944341674d38ad7b1fcb8d64748d61037ece23 Mon Sep 17 00:00:00 2001 From: Chaitanya Date: Wed, 27 Nov 2024 18:25:23 +0530 Subject: [PATCH] fix: use checksum addresses in delegations (#5) --- src/compute.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/compute.ts b/src/compute.ts index d1efdff..1b57200 100644 --- a/src/compute.ts +++ b/src/compute.ts @@ -37,12 +37,18 @@ async function getNetworkDelegations(network: string) { return cache.data; } - const delegations = await snapshotjs.utils.getDelegatesBySpace( + const delegationsData = await snapshotjs.utils.getDelegatesBySpace( network, null, 'latest' ); + const delegations = delegationsData.map(delegation => ({ + ...delegation, + delegate: snapshotjs.utils.getFormattedAddress(delegation.delegate, 'evm'), + delegator: snapshotjs.utils.getFormattedAddress(delegation.delegator, 'evm') + })); + networkDelegationsCache.set(network, { timestamp: now, data: delegations