Skip to content

Commit

Permalink
refactor: remove unused param honestMeasurements (#443)
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos authored Jan 9, 2025
1 parent 6709840 commit 42f22d6
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 @@ -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
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 @@ -202,7 +196,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -230,7 +223,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -252,7 +244,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -282,7 +273,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand All @@ -305,7 +295,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients: (_minerId, _cid) => ['f0client']
})
Expand Down Expand Up @@ -338,7 +327,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand All @@ -364,7 +352,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -417,7 +404,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -456,7 +442,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -503,7 +488,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down Expand Up @@ -539,7 +523,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand All @@ -566,7 +549,6 @@ describe('public-stats', () => {
await updatePublicStats({
createPgClient,
committees,
honestMeasurements,
allMeasurements,
findDealClients
})
Expand Down

0 comments on commit 42f22d6

Please sign in to comment.