Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import {
} from '@/common/enums';

export interface BaseManifest<
TJobType extends FortuneJobType | MarketingJobType,
TRequestType extends FortuneJobType | MarketingJobType,
> {
submissionsRequired: number;
jobType: TJobType;
requestType: TRequestType;
}

export type FortuneManifest = BaseManifest<FortuneJobType>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ describe('EscrowCompletionService', () => {
);

const manifest = generateFortuneManifest();
jobRequestType = manifest.jobType;
jobRequestType = manifest.requestType;
mockedEscrowUtils.getEscrow.mockResolvedValue({
manifest: faker.internet.url(),
} as unknown as IEscrow);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

export function generateFortuneManifest(): FortuneManifest {
return {
jobType: FortuneJobType.FORTUNE,
requestType: FortuneJobType.FORTUNE,
submissionsRequired: faker.number.int({ min: 2, max: 5 }),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {

export function generateMarketingManifest(): MarketingManifest {
return {
jobType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
requestType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
submissionsRequired: faker.number.int({ min: 2, max: 5 }),
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ describe('DefaultPayoutsCalculator', () => {
rejectedResult,
]);
const manifest: BaseManifest<MarketingJobType> = {
jobType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
requestType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
submissionsRequired: faker.number.int({ min: 2, max: 5 }),
};

Expand Down Expand Up @@ -105,7 +105,7 @@ describe('DefaultPayoutsCalculator', () => {
escrowAddress: faker.finance.ethereumAddress(),
finalResultsUrl: faker.internet.url(),
manifest: {
jobType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
requestType: MarketingJobType.SOCIAL_MEDIA_PROMOTION,
submissionsRequired: faker.number.int({ min: 2, max: 5 }),
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class DefaultResultsProcessor extends BaseEscrowResultsProcessor<DefaultR
throw new Error('No final results found');
}

if (manifest.jobType !== FortuneJobType.FORTUNE) {
if (manifest.requestType !== FortuneJobType.FORTUNE) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions packages/apps/reputation-oracle/server/src/utils/manifest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ function assertValidJobRequestType(
export function getJobRequestType(manifest: JobManifest): JobRequestType {
let jobRequestType: string | undefined;

if ('jobType' in manifest) {
jobRequestType = manifest.jobType;
if ('requestType' in manifest) {
jobRequestType = manifest.requestType;
} else if ('annotation' in manifest) {
jobRequestType = manifest.annotation.type;
}
Expand Down
Loading