1- import { Inject , Injectable , Logger } from '@nestjs/common'
1+ import { Injectable , Logger } from '@nestjs/common'
22import { ScoreData } from './schemas/score-data'
33import { ConfigService } from '@nestjs/config'
44import _ from 'lodash'
@@ -12,11 +12,8 @@ import { RelayInfo } from './interfaces/8_3/relay-info'
1212import { DetailsResponse } from './interfaces/8_3/details-response'
1313import { OperatorRegistryService } from 'src/operator-registry/operator-registry.service'
1414import { TasksService } from 'src/tasks/tasks.service'
15- import { InjectModel } from '@nestjs/mongoose'
16- import { Model } from 'mongoose'
17- import { differenceInDays , startOfDay , subDays } from 'date-fns'
1815import { BundlingService } from '../bundling/bundling.service'
19- import { ethers , lock } from 'ethers'
16+ import { ethers } from 'ethers'
2017
2118@Injectable ( )
2219export class DistributionService {
@@ -140,7 +137,7 @@ export class DistributionService {
140137 const operatorRegistryState = await this . operatorRegistryService . getOperatorRegistryState ( )
141138 const verificationData = operatorRegistryState . VerifiedFingerprintsToOperatorAddresses
142139 const isHardware = operatorRegistryState . VerifiedHardwareFingerprints
143-
140+
144141 const data : { [ key : string ] : {
145142 expected : number ,
146143 running : number ,
@@ -157,7 +154,7 @@ export class DistributionService {
157154 data [ pVA ] . expected = data [ pVA ] . expected + 1
158155 }
159156 } )
160-
157+
161158 relaysData . forEach ( relay => {
162159 const verifiedAddress = verificationData [ relay . fingerprint ]
163160 if ( verifiedAddress && verifiedAddress . length > 0 ) {
@@ -166,8 +163,8 @@ export class DistributionService {
166163
167164 if ( (
168165 isHardware [ relay . fingerprint ] ||
169- ( locksData [ relay . fingerprint ] && locksData [ relay . fingerprint ] . includes ( pVA ) )
170- ) &&
166+ ( locksData [ relay . fingerprint ] && locksData [ relay . fingerprint ] . includes ( pVA ) )
167+ ) &&
171168 relay . running && relay . consensus_weight > this . minHealthyConsensusWeight ) {
172169 data [ pVA ] . running = data [ pVA ] . running + 1
173170 }
@@ -217,7 +214,7 @@ export class DistributionService {
217214 Network : data ,
218215 Locks : locksCount
219216 }
220-
217+
221218 if ( this . isLive !== 'true' ) {
222219 this . logger . warn ( `NOT LIVE: Not storing staking/snapshot [${ stamp } ]` )
223220 } else {
0 commit comments