Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused param honestMeasurements #443

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updatePlatformStats is defined here:

/**
* @param {import('pg').Client} pgClient
* @param {import('./preprocess.js').Measurement[]} allMeasurements
*/
export const updatePlatformStats = async (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
Loading