Skip to content

Commit

Permalink
Merge branch 'main' into refactor-fraud-assessment-step2
Browse files Browse the repository at this point in the history
  • Loading branch information
bajtos committed Jan 9, 2025
2 parents 9e59ed6 + 42f22d6 commit 07be2cc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
1 change: 0 additions & 1 deletion lib/evaluate.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ export const evaluate = async ({
await updatePublicStats({
createPgClient,
committees,
honestMeasurements: measurementsToReward,
allMeasurements: measurements,
findDealClients: (minerId, cid) => sparkRoundDetails.retrievalTasks
.find(t => t.cid === cid && t.minerId === minerId)?.clients
Expand Down
3 changes: 1 addition & 2 deletions lib/public-stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ const debug = createDebug('spark:public-stats')
* @param {object} args
* @param {import('./typings.js').CreatePgClient} args.createPgClient
* @param {Iterable<Committee>} args.committees
* @param {import('./preprocess.js').Measurement[]} args.honestMeasurements
* @param {import('./preprocess.js').Measurement[]} args.allMeasurements
* @param {(minerId: string, cid: string) => (string[] | undefined)} args.findDealClients
*/
export const updatePublicStats = async ({ createPgClient, committees, honestMeasurements, allMeasurements, findDealClients }) => {
export const updatePublicStats = async ({ createPgClient, committees, allMeasurements, findDealClients }) => {
const stats = providerRetrievalResultStats.build(committees)
const pgClient = await createPgClient()
try {
Expand Down
4 changes: 2 additions & 2 deletions test/platform-stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ describe('platform-stats', () => {
describe('daily_participants', () => {
it('submits daily_participants data for today', async () => {
/** @type {Measurement[]} */
const honestMeasurements = [
const allMeasurements = [
{ ...VALID_MEASUREMENT, participantAddress: '0x10' },
{ ...VALID_MEASUREMENT, participantAddress: '0x10' },
{ ...VALID_MEASUREMENT, participantAddress: '0x20' }
]
await updatePlatformStats(pgClient, honestMeasurements)
await updatePlatformStats(pgClient, allMeasurements)

const { rows } = await pgClient.query(
'SELECT day::TEXT, participant_id FROM daily_participants'
Expand Down
18 changes: 0 additions & 18 deletions test/public-stats.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -75,7 +74,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -101,7 +99,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -119,7 +116,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -146,7 +142,6 @@ describe('public-stats', () => {

createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -165,7 +160,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -207,7 +201,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -235,7 +228,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -257,7 +249,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -287,7 +278,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -310,7 +300,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -343,7 +332,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand All @@ -369,7 +357,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -422,7 +409,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -461,7 +447,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -508,7 +493,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -544,7 +528,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand All @@ -571,7 +554,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down

0 comments on commit 07be2cc

Please sign in to comment.