Skip to content

Commit facf4ac

Browse files
authored
Fix compile errors in governance contracts (#2657)
* temporarily disable governance contracts * fix test * fix job launcher test * fix human app build, reenable governance contracts build, fix the openzeppelin contracts version, fix lint issues after upgrade
1 parent 515b5ca commit facf4ac

File tree

48 files changed

+2683
-2571
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2683
-2571
lines changed

packages/apps/fortune/exchange-oracle/server/src/common/config/database-config.service.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ export class DatabaseConfigService {
6868
* Default: 'log,info,warn,error'
6969
*/
7070
get logging(): string {
71-
return this.configService.get<string>('POSTGRES_LOGGING', 'log,info,warn,error');
71+
return this.configService.get<string>(
72+
'POSTGRES_LOGGING',
73+
'log,info,warn,error',
74+
);
7275
}
7376
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
import { MigrationInterface, QueryRunner } from "typeorm";
1+
import { MigrationInterface, QueryRunner } from 'typeorm';
22

33
export class AddManifestUrl1728552691568 implements MigrationInterface {
4-
name = 'AddManifestUrl1728552691568'
4+
name = 'AddManifestUrl1728552691568';
55

6-
public async up(queryRunner: QueryRunner): Promise<void> {
7-
await queryRunner.query(`
6+
public async up(queryRunner: QueryRunner): Promise<void> {
7+
await queryRunner.query(`
88
ALTER TABLE "hmt"."jobs"
99
ADD "manifest_url" character varying
1010
`);
11-
}
11+
}
1212

13-
public async down(queryRunner: QueryRunner): Promise<void> {
14-
await queryRunner.query(`
13+
public async down(queryRunner: QueryRunner): Promise<void> {
14+
await queryRunner.query(`
1515
ALTER TABLE "hmt"."jobs" DROP COLUMN "manifest_url"
1616
`);
17-
}
18-
17+
}
1918
}

packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.spec.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
import { createMock } from '@golevelup/ts-jest';
22
import { ConfigService } from '@nestjs/config';
33
import { Test } from '@nestjs/testing';
4-
import { MOCK_ADDRESS, MOCK_MANIFEST_URL, MOCK_PRIVATE_KEY } from '../../../test/constants';
4+
import {
5+
MOCK_ADDRESS,
6+
MOCK_MANIFEST_URL,
7+
MOCK_PRIVATE_KEY,
8+
} from '../../../test/constants';
59
import { TOKEN } from '../../common/constant';
610
import { AssignmentStatus, JobType } from '../../common/enums/job';
711
import { AssignmentRepository } from '../assignment/assignment.repository';
@@ -133,7 +137,11 @@ describe('AssignmentService', () => {
133137

134138
expect(result).toEqual(undefined);
135139
expect(assignmentRepository.createUnique).toHaveBeenCalledWith({
136-
job: { id: 1, manifestUrl: MOCK_MANIFEST_URL, reputationNetwork: reputationNetwork },
140+
job: {
141+
id: 1,
142+
manifestUrl: MOCK_MANIFEST_URL,
143+
reputationNetwork: reputationNetwork,
144+
},
137145
workerAddress: workerAddress,
138146
status: AssignmentStatus.ACTIVE,
139147
expiresAt: expect.any(Date),
@@ -142,7 +150,7 @@ describe('AssignmentService', () => {
142150
expect(jobService.getManifest).toHaveBeenCalledWith(
143151
chainId,
144152
escrowAddress,
145-
MOCK_MANIFEST_URL
153+
MOCK_MANIFEST_URL,
146154
);
147155
});
148156

@@ -174,7 +182,7 @@ describe('AssignmentService', () => {
174182
expect(jobService.getManifest).toHaveBeenCalledWith(
175183
chainId,
176184
escrowAddress,
177-
MOCK_MANIFEST_URL
185+
MOCK_MANIFEST_URL,
178186
);
179187
});
180188

@@ -312,7 +320,7 @@ describe('AssignmentService', () => {
312320
job: {
313321
chainId: 1,
314322
escrowAddress,
315-
manifestUrl: MOCK_MANIFEST_URL
323+
manifestUrl: MOCK_MANIFEST_URL,
316324
},
317325
status: AssignmentStatus.ACTIVE,
318326
createdAt: new Date(),
@@ -372,7 +380,7 @@ describe('AssignmentService', () => {
372380
expect(jobService.getManifest).toHaveBeenCalledWith(
373381
chainId,
374382
escrowAddress,
375-
MOCK_MANIFEST_URL
383+
MOCK_MANIFEST_URL,
376384
);
377385
expect(assignmentRepository.fetchFiltered).toHaveBeenCalledWith({
378386
page: 0,

packages/apps/fortune/exchange-oracle/server/src/modules/assignment/assignment.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export class AssignmentService {
7070
const manifest = await this.jobService.getManifest(
7171
data.chainId,
7272
data.escrowAddress,
73-
jobEntity.manifestUrl
73+
jobEntity.manifestUrl,
7474
);
7575

7676
// Check if all required qualifications are present

packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ describe('JobService', () => {
387387
expect(jobService.getManifest).toHaveBeenCalledWith(
388388
chainId,
389389
escrowAddress,
390-
MOCK_MANIFEST_URL
390+
MOCK_MANIFEST_URL,
391391
);
392392
});
393393

packages/apps/fortune/exchange-oracle/server/src/modules/job/job.service.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class JobService {
166166
const manifest = await this.getManifest(
167167
entity.chainId,
168168
entity.escrowAddress,
169-
entity.manifestUrl
169+
entity.manifestUrl,
170170
);
171171
if (data.fields?.includes(JobFieldName.JobDescription)) {
172172
job.jobDescription = manifest.requesterDescription;
@@ -299,7 +299,11 @@ export class JobService {
299299
throw new BadRequestException(ErrorJob.SolutionAlreadySubmitted);
300300
}
301301

302-
const manifest = await this.getManifest(chainId, escrowAddress, manifestUrl);
302+
const manifest = await this.getManifest(
303+
chainId,
304+
escrowAddress,
305+
manifestUrl,
306+
);
303307
if (
304308
existingJobSolutions.filter((solution) => !solution.error).length >=
305309
manifest.submissionsRequired

packages/apps/human-app/frontend/src/api/fetcher.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export function createFetcher(defaultFetcherConfig?: {
9999
: fetcherOptions.options;
100100
if (fetcherOptions.authenticated) {
101101
fetcherOptionsWithDefaults = appendHeader(fetcherOptionsWithDefaults, {
102-
Authorization: `Bearer ${browserAuthProvider.getAccessToken()}`,
102+
Authorization: `Bearer ${browserAuthProvider.getAccessToken() ?? ''}`,
103103
});
104104
}
105105

packages/apps/human-app/frontend/src/api/services/operator/human-token-decimals.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ export function useHMTokenDecimals() {
2020
signer: data?.signer,
2121
});
2222
},
23-
queryKey: ['decimals', chainId, data?.signer || 'signer'],
23+
queryKey: ['decimals', chainId, data?.signer ?? 'signer'],
2424
});
2525
}

packages/apps/human-app/frontend/src/api/services/worker/available-jobs-data.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const getAvailableJobsTableData = async (dto: GetJobTableDataDto) => {
4747
export function useGetAvailableJobsData() {
4848
const { filterParams } = useJobsFilterStore();
4949
const { address: oracle_address } = useParams<{ address: string }>();
50-
const dto = { ...filterParams, oracle_address: oracle_address || '' };
50+
const dto = { ...filterParams, oracle_address: oracle_address ?? '' };
5151

5252
return useQuery({
5353
queryKey: ['availableJobs', dto],
@@ -58,7 +58,7 @@ export function useGetAvailableJobsData() {
5858
export function useInfiniteGetAvailableJobsData() {
5959
const { filterParams } = useJobsFilterStore();
6060
const { address: oracle_address } = useParams<{ address: string }>();
61-
const dto = { ...filterParams, oracle_address: oracle_address || '' };
61+
const dto = { ...filterParams, oracle_address: oracle_address ?? '' };
6262

6363
return useInfiniteQuery({
6464
initialPageParam: 0,

packages/apps/human-app/frontend/src/api/services/worker/get-on-chain-registered-address.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function useGetOnChainRegisteredAddress() {
3030

3131
const registeredAddressOnChain = await ethKVStoreGetKycData({
3232
contractAddress,
33-
accountAddress: user.wallet_address || address || '',
33+
accountAddress: user.wallet_address ?? address ?? '',
3434
kycKey: `KYC-${user.reputation_network}`,
3535
});
3636

0 commit comments

Comments
 (0)