Skip to content

Commit 9af8495

Browse files
authored
Merge pull request #1093 from humanprotocol/develop
Release 20231019
2 parents b8c2f9f + 2f7faaa commit 9af8495

File tree

9 files changed

+39
-19
lines changed

9 files changed

+39
-19
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ updates:
2121
schedule:
2222
interval: "weekly"
2323
target-branch: "develop"
24+
25+
# Maintain dependencies for rust
26+
- package-ecosystem: "cargo"
27+
directory: "/"
28+
schedule:
29+
interval: "weekly"
30+
target-branch: "develop"

packages/apps/job-launcher/server/src/app.module.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { JobModule } from './modules/job/job.module';
1313
import { PaymentModule } from './modules/payment/payment.module';
1414
import { Web3Module } from './modules/web3/web3.module';
1515
import { envValidator } from './common/config';
16+
import { ServeStaticModule } from '@nestjs/serve-static';
17+
import { join } from 'path';
1618

1719
@Module({
1820
providers: [
@@ -40,6 +42,9 @@ import { envValidator } from './common/config';
4042
JobModule,
4143
PaymentModule,
4244
Web3Module,
45+
ServeStaticModule.forRoot({
46+
rootPath: join(__dirname, '../../../../../', 'node_modules/swagger-ui-dist'),
47+
}),
4348
],
4449
controllers: [AppController],
4550
})

packages/apps/job-launcher/server/src/main.ts

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,7 @@ async function bootstrap() {
6464
.setVersion('1.0')
6565
.build();
6666
const document = SwaggerModule.createDocument(app, config);
67-
SwaggerModule.setup('swagger', app, document, {
68-
customJs: [
69-
'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.7.2/swagger-ui-bundle.min.js',
70-
'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.7.2/swagger-ui-standalone-preset.min.js',
71-
],
72-
customCssUrl: [
73-
'https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/5.7.2/swagger-ui.min.css',
74-
],
75-
});
67+
SwaggerModule.setup('swagger', app, document);
7668

7769
const host = configService.get<string>(ConfigNames.HOST, 'localhost');
7870
const port = +configService.get<string>(ConfigNames.PORT, '5000');

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/escrow.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ def __init__(
109109
reputation_oracle: Optional[str] = None,
110110
recording_oracle: Optional[str] = None,
111111
exchange_oracle: Optional[str] = None,
112+
job_requester_id: Optional[str] = None,
112113
status: Optional[Status] = None,
113114
date_from: Optional[datetime] = None,
114115
date_to: Optional[datetime] = None,
@@ -154,6 +155,7 @@ def __init__(
154155
self.reputation_oracle = reputation_oracle
155156
self.recording_oracle = recording_oracle
156157
self.exchange_oracle = exchange_oracle
158+
self.job_requester_id = job_requester_id
157159
self.status = status
158160
self.date_from = date_from
159161
self.date_to = date_to
@@ -888,10 +890,16 @@ def get_escrows(
888890
network["subgraph_url"],
889891
query=get_escrows_query(filter),
890892
params={
891-
"launcher": filter.launcher,
892-
"reputationOracle": filter.reputation_oracle,
893-
"recordingOracle": filter.recording_oracle,
894-
"exchangeOracle": filter.exchange_oracle,
893+
"launcher": filter.launcher.lower() if filter.launcher else None,
894+
"reputationOracle": filter.reputation_oracle.lower()
895+
if filter.reputation_oracle
896+
else None,
897+
"recordingOracle": filter.recording_oracle.lower()
898+
if filter.recording_oracle
899+
else None,
900+
"exchangeOracle": filter.exchange_oracle.lower()
901+
if filter.exchange_oracle
902+
else None,
895903
"jobRequesterId": filter.job_requester_id,
896904
"status": filter.status.name if filter.status else None,
897905
"from": int(filter.date_from.timestamp())
@@ -964,7 +972,7 @@ def get_escrow(
964972
network["subgraph_url"],
965973
query=get_escrow_query(),
966974
params={
967-
"escrowAddress": escrow_address,
975+
"escrowAddress": escrow_address.lower(),
968976
},
969977
)
970978

packages/sdk/python/human-protocol-sdk/human_protocol_sdk/staking.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ def get_rewards_info(self, slasher: str) -> List[dict]:
430430
reward_added_events_data = get_data_from_subgraph(
431431
self.network["subgraph_url"],
432432
query=get_reward_added_events_query,
433-
params={"slasherAddress": slasher},
433+
params={"slasherAddress": slasher.lower()},
434434
)
435435
reward_added_events = reward_added_events_data["data"]["rewardAddedEvents"]
436436

packages/sdk/typescript/human-protocol-sdk/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@human-protocol/sdk",
33
"description": "Human Protocol SDK",
4-
"version": "1.0.9",
4+
"version": "1.1.16",
55
"files": [
66
"src",
77
"dist"
@@ -48,6 +48,7 @@
4848
"graphql-request": "^6.1.0",
4949
"graphql-tag": "^2.12.6",
5050
"minio": "^7.0.32",
51+
"openpgp": "^5.10.2",
5152
"secp256k1": "^4.0.3",
5253
"vitest": "^0.30.1",
5354
"winston": "^3.8.2"

packages/sdk/typescript/human-protocol-sdk/src/escrow.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1543,6 +1543,10 @@ export class EscrowUtils {
15431543
GET_ESCROWS_QUERY(filter),
15441544
{
15451545
...filter,
1546+
launcher: filter.launcher?.toLowerCase(),
1547+
reputationOracle: filter.reputationOracle?.toLowerCase(),
1548+
recordingOracle: filter.recordingOracle?.toLowerCase(),
1549+
exchangeOracle: filter.exchangeOracle?.toLowerCase(),
15461550
status: filter.status
15471551
? Object.entries(EscrowStatus).find(
15481552
([, value]) => value === filter.status
@@ -1646,7 +1650,7 @@ export class EscrowUtils {
16461650
const { escrow } = await gqlFetch<{ escrow: EscrowData }>(
16471651
networkData.subgraphUrl,
16481652
GET_ESCROW_BY_ADDRESS_QUERY(),
1649-
{ escrowAddress }
1653+
{ escrowAddress: escrowAddress.toLowerCase() }
16501654
);
16511655

16521656
return escrow || null;

packages/sdk/typescript/human-protocol-sdk/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { StorageClient } from './storage';
33
import { KVStoreClient } from './kvstore';
44
import { EscrowClient, EscrowUtils } from './escrow';
55
import { StatisticsClient } from './statistics';
6+
import { Encryption, EncryptionUtils } from './encryption';
67

78
export * from './constants';
89
export * from './types';
@@ -16,4 +17,6 @@ export {
1617
EscrowClient,
1718
EscrowUtils,
1819
StatisticsClient,
20+
Encryption,
21+
EncryptionUtils,
1922
};

packages/sdk/typescript/human-protocol-sdk/src/staking.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -575,7 +575,7 @@ export class StakingClient {
575575
const { leader } = await gqlFetch<{
576576
leader: ILeader;
577577
}>(this.network.subgraphUrl, GET_LEADER_QUERY, {
578-
address,
578+
address: address.toLowerCase(),
579579
});
580580

581581
return leader;
@@ -687,7 +687,7 @@ export class StakingClient {
687687
const { rewardAddedEvents } = await gqlFetch<{
688688
rewardAddedEvents: RewardAddedEventData[];
689689
}>(this.network.subgraphUrl, GET_REWARD_ADDED_EVENTS_QUERY, {
690-
slasherAddress,
690+
slasherAddress: slasherAddress.toLowerCase(),
691691
});
692692

693693
return rewardAddedEvents.map((reward: any) => {

0 commit comments

Comments
 (0)