Skip to content

Commit 2db7a79

Browse files
Generate reports for allocators using metaallocator flow
1 parent 001e5bb commit 2db7a79

File tree

4 files changed

+12
-8
lines changed

4 files changed

+12
-8
lines changed

src/jobs/allocator-report-generator-job/allocator-report-generator-job.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,14 @@ export class AllocatorReportGeneratorJobService extends HealthIndicator {
5353
for (const [, allocator] of allocators.entries()) {
5454
try {
5555
this.logger.debug(
56-
`Starting generation of allocator report for ${allocator.address}`,
56+
`Starting generation of allocator report for ${allocator.multisig_address}`,
5757
);
5858

59-
await this.generateAllocatorReport(allocator.address);
59+
await this.generateAllocatorReport(allocator.multisig_address);
6060
} catch (err) {
6161
fails++;
6262
this.logger.error(
63-
`Error during generation of allocator report for ${allocator.address}: ${err.message}`,
63+
`Error during generation of allocator report for ${allocator.multisig_address}: ${err.message}`,
6464
err.cause || err.stack,
6565
);
6666

src/service/allocator-report/allocator-report.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class AllocatorReportService {
4848
0,
4949
) / storageProviderDistribution.length,
5050
clients_number: verifiedClients.data.length,
51-
data_types: allocatorInfo?.data_types,
51+
data_types: allocatorInfo?.data_types ?? [],
5252
required_copies: allocatorInfo?.required_replicas,
5353
required_sps: allocatorInfo?.required_sps,
5454
clients: {

src/service/allocator-tech/allocator-tech.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export class AllocatorTechService {
4141

4242
return data.filter(
4343
(allocator) =>
44-
allocator.address?.startsWith('f') && allocator.address?.length > 3,
44+
// assume multisig_address === address for standard allocators
45+
allocator.multisig_address?.startsWith('f') &&
46+
allocator.multisig_address?.length > 3,
4547
);
4648
}
4749

@@ -51,7 +53,9 @@ export class AllocatorTechService {
5153
const allocators = await this.getAllocators();
5254

5355
return allocators.find(
54-
(allocator) => allocator.address === allocatorAddress,
56+
(allocator) =>
57+
allocator.multisig_address === allocatorAddress || // standard allocator
58+
allocator.address === allocatorAddress, // metaallocator
5559
);
5660
}
5761
}

src/service/allocator-tech/types.allocator-tech.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export interface AllocatorTechAllocatorResponse {
1616
owner: string;
1717
repo: string;
1818
installation_id: number;
19-
multisig_address: string | null;
19+
multisig_address: string | null; // equals address for standard allocators
2020
verifiers_gh_handles: string | null;
2121
multisig_threshold: number | null;
2222
allocation_amount_type: any | null;
23-
address: string | null;
23+
address: string | null; // metaallocator address if different from multisig_address
2424
tooling: string | null;
2525
data_types: string[] | null;
2626
required_sps: string | null;

0 commit comments

Comments
 (0)