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
4 changes: 2 additions & 2 deletions .github/workflows/release-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- name: Check if release already exists
id: release_check
uses: actions/github-script@v8
uses: actions/github-script@v9
with:
github-token: ${{ secrets.RELEASE_GH_TOKEN }}
script: |
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
- name: Create GitHub release
id: release
if: ${{ steps.release_check.outputs.exists != 'true' }}
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/dashboard/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@mui/styled-engine-sc": "7.3.8",
"@mui/system": "^7.3.9",
"@mui/x-data-grid": "^8.7.0",
"@mui/x-date-pickers": "^8.26.0",
"@mui/x-date-pickers": "^9.0.4",
"@tanstack/react-query": "^5.91.3",
"@types/react-router-dom": "^5.3.3",
"@types/recharts": "^1.8.29",
Expand Down Expand Up @@ -56,7 +56,7 @@
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^16.2.0",
"prettier": "^3.8.1",
"sass": "^1.89.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/dashboard/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@golevelup/ts-jest": "^3.0.0",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/express": "^5.0.6",
"@types/jest": "30.0.0",
"@types/node": "22.10.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/apps/fortune/exchange-oracle/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"@vitejs/plugin-react": "^4.3.1",
"eslint": "^10.1.0",
"eslint-plugin-react-hooks": "^5.1.0",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^16.3.0",
"prettier": "^3.8.1",
"typescript": "^5.6.3",
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/fortune/exchange-oracle/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"minio": "8.0.6",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"pg": "8.13.1",
"pg": "8.20.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.2.0",
"typeorm": "^0.3.28",
Expand All @@ -65,14 +65,14 @@
"@golevelup/ts-jest": "^3.0.0",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/body-parser": "^1",
"@types/express": "^5.0.6",
"@types/jest": "30.0.0",
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "22.10.5",
"@types/passport": "^1",
"@types/pg": "8.11.10",
"@types/pg": "8.20.0",
"eslint": "^10.1.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-jest": "^29.15.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/fortune/recording-oracle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"class-transformer": "^0.5.1",
"class-validator": "0.14.1",
"dotenv": "^17.2.2",
"helmet": "^7.1.0",
"helmet": "^8.1.0",
"joi": "^17.13.3",
"minio": "8.0.6",
"reflect-metadata": "^0.2.2",
Expand All @@ -46,7 +46,7 @@
"@eslint/js": "^10.0.1",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/express": "^5.0.6",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.16",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/human-app/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@mui/icons-material": "^7.3.8",
"@mui/material": "^5.16.7",
"@mui/system": "^7.3.9",
"@mui/x-date-pickers": "^8.26.0",
"@mui/x-date-pickers": "^9.0.4",
"@reown/appkit": "^1.7.11",
"@reown/appkit-adapter-wagmi": "^1.7.11",
"@synaps-io/verify-sdk": "^4.0.45",
Expand Down Expand Up @@ -75,7 +75,7 @@
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-prettier": "^5.5.5",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.11",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^16.3.0",
"husky": "^9.1.6",
"jsdom": "^25.0.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum JobType {
POLYGONS = 'image_polygons',
AUDIO_TRANSCRIPTION = 'audio_transcription',
AUDIO_ATTRIBUTE_ANNOTATION = 'audio_attribute_annotation',
SOCIAL_MEDIA_PROMOTION = 'social_media_promotion',
}

export const EthKVStoreKeys = {
Expand Down
3 changes: 2 additions & 1 deletion packages/apps/human-app/frontend/src/shared/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,7 @@
"image_skeletons_from_boxes": "Skeletons from Bounding Boxes",
"image_polygons": "Polygons",
"audio_transcription": "Audio Transcription",
"audio_attribute_annotation": "Audio Attribute Annotation"
"audio_attribute_annotation": "Audio Attribute Annotation",
"social_media_promotion": "Social Media Promotion"
}
}
2 changes: 1 addition & 1 deletion packages/apps/human-app/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"@eslint/js": "^10.0.1",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/express": "^5.0.6",
"@types/jest": "30.0.0",
"@types/jsonwebtoken": "^9.0.7",
Expand Down
4 changes: 2 additions & 2 deletions packages/apps/job-launcher/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
"@mui/lab": "^7.0.0-beta.17",
"@mui/material": "^5.16.7",
"@mui/system": "^7.3.9",
"@mui/x-date-pickers": "^8.26.0",
"@mui/x-date-pickers": "^9.0.4",
"@reduxjs/toolkit": "^2.5.0",
"@stripe/react-stripe-js": "^3.0.0",
"@stripe/stripe-js": "^4.2.0",
"@tanstack/query-sync-storage-persister": "^5.68.0",
"@tanstack/react-query": "^5.91.3",
"@tanstack/react-query-persist-client": "^5.80.7",
"axios": "^1.1.3",
"copy-to-clipboard": "^3.3.3",
"copy-to-clipboard": "^4.0.2",
"dayjs": "^1.11.12",
"decimal.js": "^10.6.0",
"ethers": "^6.16.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/job-launcher/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@
"class-validator": "0.14.1",
"decimal.js": "^10.6.0",
"dotenv": "^17.2.2",
"helmet": "^7.1.0",
"helmet": "^8.1.0",
"joi": "^17.13.3",
"json-stable-stringify": "^1.2.1",
"minio": "8.0.6",
"nestjs-minio-client": "^2.2.0",
"node-cache": "^5.1.2",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"pg": "8.13.1",
"pg": "8.20.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.2.0",
"stripe": "^17.7.0",
Expand All @@ -80,7 +80,7 @@
"@golevelup/ts-jest": "^3.0.0",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/bcrypt": "^6.0.0",
"@types/express": "^5.0.6",
"@types/jest": "30.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/apps/reputation-oracle/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
"class-validator": "^0.14.1",
"dotenv": "^17.2.2",
"ethers": "~6.16.0",
"helmet": "^7.1.0",
"helmet": "^8.1.0",
"joi": "^17.13.3",
"json-stable-stringify": "^1.2.1",
"lodash": "^4.17.21",
"minio": "8.0.6",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"pg": "8.13.1",
"pg": "8.20.0",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.2.0",
"typeorm": "^0.3.28",
Expand All @@ -78,7 +78,7 @@
"@golevelup/ts-jest": "^3.0.0",
"@nestjs/cli": "^11.0.16",
"@nestjs/schematics": "^11.0.9",
"@nestjs/testing": "^11.1.14",
"@nestjs/testing": "^11.1.19",
"@types/bcrypt": "^6.0.0",
"@types/express": "^5.0.6",
"@types/jest": "30.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const RPC_URL = isLocalEnv
: process.env.RPC_URL_POLYGON_AMOY;

const DEFAULT_SUPPORTED_JOB_TYPES =
'fortune,image_boxes,image_boxes_from_points,image_points,image_polygons,image_skeletons_from_boxes';
'fortune,social_media_promotion,image_boxes,image_boxes_from_points,image_points,image_polygons,image_skeletons_from_boxes';
const ROLE = Role.ReputationOracle;

async function setupCommonValues(kvStoreClient: KVStoreClient): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ export enum FortuneJobType {
FORTUNE = 'fortune',
}

export enum MarketingJobType {
SOCIAL_MEDIA_PROMOTION = 'social_media_promotion',
}

export enum CvatJobType {
IMAGE_BOXES = 'image_boxes',
IMAGE_POINTS = 'image_points',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ export type FortuneFinalResult = {
error?: 'duplicated' | 'curse_word';
};

export enum VerificationResult {
Accepted = 'accepted',
Rejected = 'rejected',
}

export type MarketingFinalResult = {
workerAddress: string;
postUrl: string;
verificationResult: VerificationResult;
rejectionReason?: string;
};

type CvatAnnotationMetaJob = {
job_id: number;
final_result_id: number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { CvatJobType, FortuneJobType } from '@/common/enums';
import { CvatJobType, FortuneJobType, MarketingJobType } from '@/common/enums';

export type FortuneManifest = {
submissionsRequired: number;
fundAmount: number;
requestType: FortuneJobType;
};

export type MarketingManifest = {
job_type: MarketingJobType;
submissions_required: number;
end_date?: string;
};

export type CvatManifest = {
annotation: {
type: CvatJobType;
Expand All @@ -16,6 +22,6 @@ export type CvatManifest = {
job_bounty: string;
};

export type JobManifest = FortuneManifest | CvatManifest;
export type JobManifest = FortuneManifest | MarketingManifest | CvatManifest;

export type JobRequestType = FortuneJobType | CvatJobType;
export type JobRequestType = FortuneJobType | MarketingJobType | CvatJobType;
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Test } from '@nestjs/testing';
import stringify from 'json-stable-stringify';
import _ from 'lodash';

import { CvatJobType, FortuneJobType } from '@/common/enums';
import { CvatJobType, FortuneJobType, MarketingJobType } from '@/common/enums';
import { ServerConfigService, Web3ConfigService } from '@/config';
import { ReputationService } from '@/modules/reputation';
import { StorageService } from '@/modules/storage';
Expand All @@ -49,10 +49,12 @@ import {
import {
CvatPayoutsCalculator,
FortunePayoutsCalculator,
MarketingPayoutsCalculator,
} from './payouts-calculation';
import {
CvatResultsProcessor,
FortuneResultsProcessor,
MarketingResultsProcessor,
} from './results-processing';

const mockServerConfigService = {
Expand All @@ -68,8 +70,10 @@ const mockOutgoingWebhookService = createMock<OutgoingWebhookService>();
const mockReputationService = createMock<ReputationService>();
const mockFortuneResultsProcessor = createMock<FortuneResultsProcessor>();
const mockCvatResultsProcessor = createMock<CvatResultsProcessor>();
const mockMarketingResultsProcessor = createMock<MarketingResultsProcessor>();
const mockFortunePayoutsCalculator = createMock<FortunePayoutsCalculator>();
const mockCvatPayoutsCalculator = createMock<CvatPayoutsCalculator>();
const mockMarketingPayoutsCalculator = createMock<MarketingPayoutsCalculator>();

const mockedEscrowClient = jest.mocked(EscrowClient);
const mockedEscrowUtils = jest.mocked(EscrowUtils);
Expand Down Expand Up @@ -122,6 +126,10 @@ describe('EscrowCompletionService', () => {
provide: CvatResultsProcessor,
useValue: mockCvatResultsProcessor,
},
{
provide: MarketingResultsProcessor,
useValue: mockMarketingResultsProcessor,
},
{
provide: FortunePayoutsCalculator,
useValue: mockFortunePayoutsCalculator,
Expand All @@ -130,6 +138,10 @@ describe('EscrowCompletionService', () => {
provide: CvatPayoutsCalculator,
useValue: mockCvatPayoutsCalculator,
},
{
provide: MarketingPayoutsCalculator,
useValue: mockMarketingPayoutsCalculator,
},
],
}).compile();

Expand Down Expand Up @@ -958,8 +970,7 @@ describe('EscrowCompletionService', () => {
);
expect(mockEscrowCompletionRepository.updateOne).toHaveBeenCalledWith({
...paidPayoutsRecord,
failureDetail: 'Error message: Webhook url is no set for oracle',
status: 'failed',
status: 'completed',
});
});

Expand Down Expand Up @@ -1200,6 +1211,14 @@ describe('EscrowCompletionService', () => {
);
},
);
it.each(Object.values(MarketingJobType))(
'should return marketing processor for "%s" job type',
(jobRequestType) => {
expect(service['getEscrowResultsProcessor'](jobRequestType)).toBe(
mockMarketingResultsProcessor,
);
},
);
});

describe('getEscrowPayoutsCalculator', () => {
Expand All @@ -1219,5 +1238,13 @@ describe('EscrowCompletionService', () => {
);
},
);
it.each(Object.values(MarketingJobType))(
'should return marketing calculator for "%s" job type',
(jobRequestType) => {
expect(service['getEscrowPayoutsCalculator'](jobRequestType)).toBe(
mockMarketingPayoutsCalculator,
);
},
);
});
});
Loading
Loading