Skip to content

Commit

Permalink
Automated lint (snapshot-labs#1538)
Browse files Browse the repository at this point in the history
Co-authored-by: ChaituVR <ChaituVR@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and ChaituVR authored Jul 21, 2024
1 parent 1ee51d7 commit 9ea86b7
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/strategies/rocketpool-node-operator-delegate-v7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,21 @@ export async function strategy(
const signerRegistryResponse: Record<string, string> =
await signerRegistry.execute();

const addressMap: Map<any, any> = new Map(resp.map(obj => [getAddress(obj.address), obj]));
const addressMap: Map<any, any> = new Map(
resp.map((obj) => [getAddress(obj.address), obj])
);

const nodeData = addresses.map((address) => {
const nodeAddress = getAddress(signerRegistryResponse[address]);
const node = addressMap.get(nodeAddress);
return {
signallingAddress: address,
nodeAddress: nodeAddress,
delegators: node && node.delegators.length > 0 ? node.delegators.map((d) => getAddress(d.address)) : [nodeAddress],
}
delegators:
node && node.delegators.length > 0
? node.delegators.map((d) => getAddress(d.address))
: [nodeAddress]
};
});

const delegations: Record<string, string[]> = Object.fromEntries(
Expand All @@ -74,8 +79,12 @@ export async function strategy(

return Object.fromEntries(
addresses.map((address) => {
const addressData = nodeData.find((node) => node.signallingAddress === address);
if (addressData.nodeAddress === "0x0000000000000000000000000000000000000000") {
const addressData = nodeData.find(
(node) => node.signallingAddress === address
);
if (
addressData.nodeAddress === '0x0000000000000000000000000000000000000000'
) {
return [address, 0];
}
const delegators = addressData.delegators;
Expand Down

0 comments on commit 9ea86b7

Please sign in to comment.