-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* return to frontend raw data * fix type export * use single map * fix tests * fix trackValidatorsPerformance test * rename to fetchAndInsertEpochValidatorsData * write null if undefined * store db initialized * use keys with type of number instead of string in maps
- Loading branch information
1 parent
58db880
commit 725e61b
Showing
31 changed files
with
404 additions
and
1,428 deletions.
There are no files selected for viewing
21 changes: 5 additions & 16 deletions
21
packages/brain/src/calls/fetchValidatorsPerformanceData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,23 @@ | ||
import { fetchAndProcessValidatorsData } from "../modules/validatorsDataIngest/index.js"; | ||
import { minGenesisTime, secondsPerSlot } from "../index.js"; | ||
import type { | ||
ValidatorsDataProcessed, | ||
Granularity, | ||
NumberOfDaysToQuery | ||
} from "../modules/validatorsDataIngest/types.js"; | ||
import { PostgresClient } from "../modules/apiClients/index.js"; | ||
import type { NumberOfDaysToQuery } from "../modules/validatorsDataIngest/types.js"; | ||
import type { EpochsValidatorsMap } from "../modules/apiClients/postgres/types.js"; | ||
|
||
export async function fetchValidatorsPerformanceData({ | ||
postgresClient, | ||
validatorIndexes, | ||
numberOfDaysToQuery, | ||
granularity | ||
numberOfDaysToQuery | ||
}: { | ||
postgresClient: PostgresClient; | ||
validatorIndexes: string[]; | ||
numberOfDaysToQuery?: NumberOfDaysToQuery; | ||
granularity?: Granularity; | ||
}): Promise< | ||
Map< | ||
number, // validatorIndex | ||
ValidatorsDataProcessed // processed data of the validator | ||
> | ||
> { | ||
}): Promise<EpochsValidatorsMap> { | ||
return await fetchAndProcessValidatorsData({ | ||
validatorIndexes, | ||
postgresClient, | ||
minGenesisTime, | ||
secondsPerSlot, | ||
numberOfDaysToQuery, | ||
granularity | ||
numberOfDaysToQuery | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.