Skip to content

Commit e7325db

Browse files
authored
Merge pull request #1868 from humanprotocol/develop
Release Sprint 8 W2 2024
2 parents 62ecbc2 + 350fca5 commit e7325db

File tree

96 files changed

+3943
-387
lines changed

Some content is hidden

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

96 files changed

+3943
-387
lines changed

.github/workflows/cd-deploy-contracts.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
env:
2525
ETH_GOERLI_TESTNET_URL: ${{ secrets.ETH_GOERLI_TESTNET_URL }}
2626
ETH_POLYGON_URL: ${{ secrets.ETH_POLYGON_URL }}
27-
ETH_POLYGON_MUMBAI_URL: ${{ secrets.ETH_POLYGON_MUMBAI_URL }}
27+
ETH_POLYGON_AMOY_URL: ${{ secrets.ETH_POLYGON_AMOY_URL }}
2828
ETH_BSC_URL: ${{ secrets.ETH_BSC_URL }}
2929
ETH_BSC_TESTNET_URL: ${{ secrets.ETH_BSC_TESTNET_URL }}
3030
ETH_MOONBEAM_URL: ${{ secrets.ETH_MOONBEAM_URL }}
@@ -62,10 +62,10 @@ jobs:
6262
echo "reward_pool=0x1371057BAec59944B924A7963F2EeCF43ff94CE4" >> $GITHUB_OUTPUT
6363
echo "private_key=MAINNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
6464
;;
65-
"polygonMumbai")
66-
echo "escrow_factory=0xA8D927C4DA17A6b71675d2D49dFda4E9eBE58f2d" >> $GITHUB_OUTPUT
67-
echo "staking=0x7Fd3dF914E7b6Bd96B4c744Df32183b51368Bfac" >> $GITHUB_OUTPUT
68-
echo "reward_pool=0xf0145eD99AC3c4f877aDa7dA4D1E059ec9116BAE" >> $GITHUB_OUTPUT
65+
"polygonAmoy")
66+
echo "escrow_factory=0xAFf5a986A530ff839d49325A5dF69F96627E8D29" >> $GITHUB_OUTPUT
67+
echo "staking=0xCc0AF0635aa19fE799B6aFDBe28fcFAeA7f00a60" >> $GITHUB_OUTPUT
68+
echo "reward_pool=0xd866bCEFf6D0F77E1c3EAE28230AE6C79b03fDa7" >> $GITHUB_OUTPUT
6969
echo "private_key=TESTNET_PRIVATE_KEY" >> $GITHUB_OUTPUT
7070
;;
7171
"bsc")

docs/sdk/python/human_protocol_sdk.constants.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Enum for chain IDs.
3030

3131
#### POLYGON *= 137*
3232

33+
#### POLYGON_AMOY *= 80002*
34+
3335
#### POLYGON_MUMBAI *= 80001*
3436

3537
#### RINKEBY *= 4*
@@ -44,6 +46,8 @@ Enum for KVStore keys
4446

4547
#### fee *= 'fee'*
4648

49+
#### job_types *= 'job_types'*
50+
4751
#### public_key *= 'public_key'*
4852

4953
#### role *= 'role'*

docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ from human_protocol_sdk.escrow import EscrowUtils, EscorwFilter, Status
1111
print(
1212
EscrowUtils.get_escrows(
1313
EscrowFilter(
14-
networks=[ChainId.POLYGON_MUMBAI],
14+
networks=[ChainId.POLYGON_AMOY],
1515
status=Status.Pending,
1616
date_from=datetime.datetime(2023, 5, 8),
1717
date_to=datetime.datetime(2023, 6, 8),
@@ -78,7 +78,7 @@ Returns the escrow for a given address.
7878

7979
print(
8080
EscrowUtils.get_escrow(
81-
ChainId.POLYGON_MUMBAI,
81+
ChainId.POLYGON_AMOY,
8282
"0x1234567890123456789012345678901234567890"
8383
)
8484
)
@@ -102,7 +102,7 @@ Get an array of escrow addresses based on the specified filter parameters.
102102
print(
103103
EscrowUtils.get_escrows(
104104
EscrowFilter(
105-
networks=[ChainId.POLYGON_MUMBAI],
105+
networks=[ChainId.POLYGON_AMOY],
106106
status=Status.Pending,
107107
date_from=datetime.datetime(2023, 5, 8),
108108
date_to=datetime.datetime(2023, 6, 8),

docs/sdk/python/human_protocol_sdk.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,11 +105,13 @@
105105
* [`ChainId.MOONBASE_ALPHA`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBASE_ALPHA)
106106
* [`ChainId.MOONBEAM`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.MOONBEAM)
107107
* [`ChainId.POLYGON`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON)
108+
* [`ChainId.POLYGON_AMOY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_AMOY)
108109
* [`ChainId.POLYGON_MUMBAI`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.POLYGON_MUMBAI)
109110
* [`ChainId.RINKEBY`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.RINKEBY)
110111
* [`ChainId.SKALE`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId.SKALE)
111112
* [`KVStoreKeys`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys)
112113
* [`KVStoreKeys.fee`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.fee)
114+
* [`KVStoreKeys.job_types`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.job_types)
113115
* [`KVStoreKeys.public_key`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key)
114116
* [`KVStoreKeys.role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.role)
115117
* [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url)

docs/sdk/python/human_protocol_sdk.operator.operator_utils.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ from human_protocol_sdk.operator import OperatorUtils, LeaderFilter
1010

1111
print(
1212
OperatorUtils.get_leaders(
13-
LeaderFilter(networks=[ChainId.POLYGON_MUMBAI], role="Job Launcher")
13+
LeaderFilter(networks=[ChainId.POLYGON_AMOY], role="Job Launcher")
1414
)
1515
)
1616
```
1717

1818
## Module
1919

20-
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None)
20+
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)
2121

2222
Bases: `object`
2323

24-
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None)
24+
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_launched, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)
2525

2626
Initializes an LeaderData instance.
2727

@@ -43,6 +43,7 @@ Initializes an LeaderData instance.
4343
* **public_key** (`Optional`[`str`]) – Public key
4444
* **webhook_url** (`Optional`[`str`]) – Webhook url
4545
* **url** (`Optional`[`str`]) – Url
46+
* **job_types** (`Optional`[`str`]) – Job types
4647

4748
### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(networks, role=None)
4849

@@ -58,11 +59,11 @@ Initializes a LeaderFilter instance.
5859
* **networks** (`List`[[`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)]) – Networks to request data
5960
* **role** (`Optional`[`str`]) – Leader role
6061

61-
### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role)
62+
### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role, url='', job_types='')
6263

6364
Bases: `object`
6465

65-
#### \_\_init_\_(address, role)
66+
#### \_\_init_\_(address, role, url='', job_types='')
6667

6768
Initializes an Operator instance.
6869

@@ -93,7 +94,7 @@ Get the leader details.
9394
from human_protocol_sdk.operator import OperatorUtils
9495

9596
leader = OperatorUtils.get_leader(
96-
ChainId.POLYGON_MUMBAI,
97+
ChainId.POLYGON_AMOY,
9798
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
9899
)
99100
```
@@ -115,7 +116,7 @@ Get leaders data of the protocol
115116

116117
print(
117118
OperatorUtils.get_leaders(
118-
LeaderFilter(networks=[ChainId.POLYGON_MUMBAI])
119+
LeaderFilter(networks=[ChainId.POLYGON_AMOY])
119120
)
120121
)
121122
```
@@ -128,6 +129,8 @@ Get the reputation network operators of the specified address.
128129
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the reputation network exists
129130
* **address** (`str`) – Address of the reputation oracle
130131
* **role** (`Optional`[`str`]) – (Optional) Role of the operator
132+
* **Parem job_types:**
133+
(Optional) Job types of the operator
131134
* **Return type:**
132135
`List`[[`Operator`](#human_protocol_sdk.operator.operator_utils.Operator)]
133136
* **Returns:**
@@ -138,7 +141,7 @@ Get the reputation network operators of the specified address.
138141
from human_protocol_sdk.operator import OperatorUtils
139142

140143
leader = OperatorUtils.get_reputation_network_operators(
141-
ChainId.POLYGON_MUMBAI,
144+
ChainId.POLYGON_AMOY,
142145
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
143146
)
144147
```
@@ -160,7 +163,7 @@ Get rewards of the given slasher
160163
from human_protocol_sdk.operator import OperatorUtils
161164

162165
rewards_info = OperatorUtils.get_rewards_info(
163-
ChainId.POLYGON_MUMBAI,
166+
ChainId.POLYGON_AMOY,
164167
'0x62dD51230A30401C455c8398d06F85e4EaB6309f'
165168
)
166169
```

docs/sdk/python/human_protocol_sdk.statistics.statistics_client.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This client enables to obtain statistical information from the subgraph.
88
from human_protocol_sdk.constants import ChainId
99
from human_protocol_sdk.statistics import StatisticsClient
1010

11-
statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
11+
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
1212
```
1313

1414
## Module
@@ -134,13 +134,13 @@ Initializes a PaymentStatistics instance.
134134
* **Parameters:**
135135
**daily_payments_data** (`List`[[`DailyPaymentData`](#human_protocol_sdk.statistics.statistics_client.DailyPaymentData)]) – Daily payments data
136136

137-
### *class* human_protocol_sdk.statistics.statistics_client.StatisticsClient(chain_id=ChainId.POLYGON_MUMBAI)
137+
### *class* human_protocol_sdk.statistics.statistics_client.StatisticsClient(chain_id=ChainId.POLYGON_AMOY)
138138

139139
Bases: `object`
140140

141141
A client used to get statistical data.
142142

143-
#### \_\_init_\_(chain_id=ChainId.POLYGON_MUMBAI)
143+
#### \_\_init_\_(chain_id=ChainId.POLYGON_AMOY)
144144

145145
Initializes a Statistics instance
146146

@@ -162,7 +162,7 @@ Get escrow statistics data for the given date range.
162162
from human_protocol_sdk.contants import ChainId
163163
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam
164164

165-
statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
165+
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
166166

167167
print(statistics_client.get_escrow_statistics())
168168
print(
@@ -190,7 +190,7 @@ Get HMT statistics data for the given date range.
190190
from human_protocol_sdk.contants import ChainId
191191
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam
192192

193-
statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
193+
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
194194

195195
print(statistics_client.get_hmt_statistics())
196196
print(
@@ -218,7 +218,7 @@ Get payment statistics data for the given date range.
218218
from human_protocol_sdk.contants import ChainId
219219
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam
220220

221-
statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
221+
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
222222

223223
print(statistics_client.get_payment_statistics())
224224
print(
@@ -246,7 +246,7 @@ Get worker statistics data for the given date range.
246246
from human_protocol_sdk.contants import ChainId
247247
from human_protocol_sdk.statistics import StatisticsClient, StatisticsParam
248248

249-
statistics_client = StatisticsClient(ChainId.POLYGON_MUMBAI)
249+
statistics_client = StatisticsClient(ChainId.POLYGON_AMOY)
250250

251251
print(statistics_client.get_worker_statistics())
252252
print(

docs/sdk/typescript/classes/base.BaseEthersClient.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ This class is used as a base class for other clients making on-chain calls.
5050

5151
#### Defined in
5252

53-
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
53+
<<<<<<< HEAD
54+
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
55+
=======
56+
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
57+
>>>>>>> develop
5458
5559
## Properties
5660

@@ -60,7 +64,11 @@ This class is used as a base class for other clients making on-chain calls.
6064

6165
#### Defined in
6266

63-
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
67+
<<<<<<< HEAD
68+
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
69+
=======
70+
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
71+
>>>>>>> develop
6472
6573
___
6674

@@ -70,4 +78,8 @@ ___
7078

7179
#### Defined in
7280

73-
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
81+
<<<<<<< HEAD
82+
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
83+
=======
84+
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
85+
>>>>>>> develop

docs/sdk/typescript/classes/encryption.Encryption.md

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ Constructor for the Encryption class.
8181

8282
#### Defined in
8383

84-
[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
84+
<<<<<<< HEAD
85+
[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
86+
=======
87+
[encryption.ts:53](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L53)
88+
>>>>>>> develop
8589
8690
## Properties
8791

@@ -91,7 +95,11 @@ Constructor for the Encryption class.
9195

9296
#### Defined in
9397

94-
[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
98+
<<<<<<< HEAD
99+
[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
100+
=======
101+
[encryption.ts:46](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L46)
102+
>>>>>>> develop
95103
96104
## Methods
97105

@@ -140,7 +148,11 @@ const resultMessage = await encription.decrypt('message');
140148

141149
#### Defined in
142150

143-
[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
151+
<<<<<<< HEAD
152+
[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
153+
=======
154+
[encryption.ts:180](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L180)
155+
>>>>>>> develop
144156
145157
___
146158

@@ -176,7 +188,11 @@ const resultMessage = await encription.sign('message');
176188

177189
#### Defined in
178190

179-
[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
191+
<<<<<<< HEAD
192+
[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
193+
=======
194+
[encryption.ts:217](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L217)
195+
>>>>>>> develop
180196
181197
___
182198

@@ -238,7 +254,11 @@ const resultMessage = await encription.signAndEncrypt('message', publicKeys);
238254

239255
#### Defined in
240256

241-
[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
257+
<<<<<<< HEAD
258+
[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
259+
=======
260+
[encryption.ts:129](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L129)
261+
>>>>>>> develop
242262
243263
___
244264

@@ -263,4 +283,8 @@ Builds an Encryption instance by decrypting the private key from an encrypted pr
263283

264284
#### Defined in
265285

266-
[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/48066071/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
286+
<<<<<<< HEAD
287+
[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/4a01940c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
288+
=======
289+
[encryption.ts:64](https://github.com/humanprotocol/human-protocol/blob/e4b60ab1/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L64)
290+
>>>>>>> develop

0 commit comments

Comments
 (0)