Skip to content

Commit

Permalink
add random order in fp (#384)
Browse files Browse the repository at this point in the history
* add random order in fp

---------

Co-authored-by: wjrjerome <[email protected]>
  • Loading branch information
jeremy-babylonlabs and jrwbabylonlab authored Nov 26, 2024
1 parent 45fe9f1 commit 82700e3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simple-staking",
"version": "0.3.11",
"version": "0.3.12",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
2 changes: 2 additions & 0 deletions src/app/api/getFinalityProviders.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,14 @@ interface DescriptionAPI {

export const getFinalityProviders = async (
key: string,
sort: string,
): Promise<PaginatedFinalityProviders> => {
// const limit = 100;
// const reverse = false;

const params = {
pagination_key: encode(key),
sort,
// "pagination_reverse": reverse,
// "pagination_limit": limit,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const FinalityProviders: React.FC<FinalityProvidersProps> = ({
isRefetchError: isRefetchFinalityProvidersError,
} = useInfiniteQuery({
queryKey: ["finality providers"],
queryFn: ({ pageParam = "" }) => getFinalityProviders(pageParam),
queryFn: ({ pageParam = "" }) => getFinalityProviders(pageParam, "random"),
getNextPageParam: (lastPage) =>
lastPage?.pagination?.next_key !== ""
? lastPage?.pagination?.next_key
Expand Down

0 comments on commit 82700e3

Please sign in to comment.