Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: allow getDelegatesBySpace to fetch delegates for all spaces #1050

Merged
merged 2 commits into from
Aug 23, 2024

Conversation

Sekhmet
Copy link
Member

@Sekhmet Sekhmet commented Aug 23, 2024

With this change space can be passed as null and this will result in all delegates to be returned instead of per-space results only.

This will be used on new delegate-registry-api.

With this change space can be passed as null and this will result in all
delegates to be returned instead of per-space results only.

This will be used on new delegate-registry-api.
@@ -26,7 +26,7 @@ export default async function getDelegatesBySpace(

let pivot = 0;
const result = new Map<string, Delegation>();
const spaceIn = buildSpaceIn(space);
const spaceIn = space ? buildSpaceIn(space) : null;
Copy link
Member

@ChaituVR ChaituVR Aug 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It takes too much time to get all delegations 😅 (100.418 seconds for mainnet delegations) but yea it works

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, this will be reused on the server to only do it once every 24 hours for all spaces on given network so it shouldn't be terrible.

Copy link
Member

@ChaituVR ChaituVR left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tAck

@ChaituVR ChaituVR merged commit 08d5289 into master Aug 23, 2024
4 checks passed
@ChaituVR ChaituVR deleted the sekhmet/fetch-global-delegations branch August 23, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants