From 32b78ddd01dc92781dd6b3d638e568ee49c28d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Thu, 9 Jan 2025 15:41:59 +0100 Subject: [PATCH] refactor: remove unused param honestMeasurements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miroslav Bajtoš --- lib/evaluate.js | 1 - lib/public-stats.js | 3 +-- test/platform-stats.test.js | 4 ++-- test/public-stats.test.js | 18 ------------------ 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/lib/evaluate.js b/lib/evaluate.js index 4ee81a75..1c82301f 100644 --- a/lib/evaluate.js +++ b/lib/evaluate.js @@ -193,7 +193,6 @@ export const evaluate = async ({ await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements: measurements, findDealClients: (minerId, cid) => sparkRoundDetails.retrievalTasks .find(t => t.cid === cid && t.minerId === minerId)?.clients diff --git a/lib/public-stats.js b/lib/public-stats.js index 44bb7dc9..d1a49d61 100644 --- a/lib/public-stats.js +++ b/lib/public-stats.js @@ -13,11 +13,10 @@ const debug = createDebug('spark:public-stats') * @param {object} args * @param {import('./typings.js').CreatePgClient} args.createPgClient * @param {Iterable} 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 { diff --git a/test/platform-stats.test.js b/test/platform-stats.test.js index 9f498ffe..b93183c9 100644 --- a/test/platform-stats.test.js +++ b/test/platform-stats.test.js @@ -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' diff --git a/test/public-stats.test.js b/test/public-stats.test.js index d344a69f..81ff4dd3 100644 --- a/test/public-stats.test.js +++ b/test/public-stats.test.js @@ -58,7 +58,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -75,7 +74,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -101,7 +99,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -119,7 +116,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -146,7 +142,6 @@ describe('public-stats', () => { createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -165,7 +160,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -202,7 +196,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -230,7 +223,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -252,7 +244,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -282,7 +273,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -305,7 +295,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients: (_minerId, _cid) => ['f0client'] }) @@ -338,7 +327,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -364,7 +352,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -417,7 +404,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -456,7 +442,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -503,7 +488,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -539,7 +523,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients }) @@ -566,7 +549,6 @@ describe('public-stats', () => { await updatePublicStats({ createPgClient, committees, - honestMeasurements, allMeasurements, findDealClients })