Skip to content

Commit

Permalink
User registration step in annotation tools (#2659)
Browse files Browse the repository at this point in the history
* [HUMAN App client] Add registration step (#2518)

* Add logic to register users in oracles

* Fix failing tests
---------

Co-authored-by: portuu3

* Revert "Bump solidity-coverage from 0.8.12 to 0.8.13 (#2605)" (#2655)

This reverts commit f531a68.

* [Subgraph][SDK] Add registration data to leaders entity (#2451)

* Add registration data to leaders entity

* Add registration info to getReputationNetworkOperators

---------

Co-authored-by: Francisco López <[email protected]>

* [Human App] Add registration info to oracles discovery response (#2452)

* Add registration data to leaders entity

* Add registration info to getReputationNetworkOperators

* Add wether registration is required to oracles discovery response

* update docs

* fix human app frontend and rep oracle user service for registration

* update subgraph deployment id

* remove unused imports

* convert registrationNeeded to lower case for comparison and redeploy subgraph

---------

Co-authored-by: Francisco López <[email protected]>
Co-authored-by: Francisco López <[email protected]>
  • Loading branch information
3 people authored Oct 21, 2024
1 parent 9523921 commit 61e6631
Show file tree
Hide file tree
Showing 59 changed files with 723 additions and 148 deletions.
2 changes: 2 additions & 0 deletions docs/sdk/python/human_protocol_sdk.constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Enum for KVStore keys

#### public_key *= 'public_key'*

#### registration_instructions *= 'registration_instructions'*

#### registration_needed *= 'registration_needed'*

#### role *= 'role'*
Expand Down
19 changes: 19 additions & 0 deletions docs/sdk/python/human_protocol_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@
* [Module](human_protocol_sdk.kvstore.kvstore_client.md#module)
* [`KVStoreClient`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient)
* [`KVStoreClientError`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClientError)
* [human_protocol_sdk.kvstore.kvstore_utils module](human_protocol_sdk.kvstore.kvstore_utils.md)
* [Code Example](human_protocol_sdk.kvstore.kvstore_utils.md#code-example)
* [Module](human_protocol_sdk.kvstore.kvstore_utils.md#module)
* [`KVStoreData`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData)
* [`KVStoreData.__init__()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData.__init__)
* [`KVStoreUtils`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils)
* [`KVStoreUtils.get()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get)
* [`KVStoreUtils.get_file_url_and_verify_hash()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_file_url_and_verify_hash)
* [`KVStoreUtils.get_kvstore_data()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_kvstore_data)
* [`KVStoreUtils.get_public_key()`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils.get_public_key)
* [human_protocol_sdk.operator package](human_protocol_sdk.operator.md)
* [Submodules](human_protocol_sdk.operator.md#submodules)
* [human_protocol_sdk.operator.operator_utils module](human_protocol_sdk.operator.operator_utils.md)
Expand Down Expand Up @@ -100,6 +110,14 @@
* [`StorageFileNotFoundError`](human_protocol_sdk.storage.storage_client.md#human_protocol_sdk.storage.storage_client.StorageFileNotFoundError)
* [human_protocol_sdk.storage.storage_utils module](human_protocol_sdk.storage.storage_utils.md)
* [`StorageUtils`](human_protocol_sdk.storage.storage_utils.md#human_protocol_sdk.storage.storage_utils.StorageUtils)
* [human_protocol_sdk.transaction package](human_protocol_sdk.transaction.md)
* [Submodules](human_protocol_sdk.transaction.md#submodules)
* [human_protocol_sdk.transaction.transaction_utils module](human_protocol_sdk.transaction.transaction_utils.md)
* [Code Example](human_protocol_sdk.transaction.transaction_utils.md#code-example)
* [Module](human_protocol_sdk.transaction.transaction_utils.md#module)
* [`TransactionData`](human_protocol_sdk.transaction.transaction_utils.md#human_protocol_sdk.transaction.transaction_utils.TransactionData)
* [`TransactionUtils`](human_protocol_sdk.transaction.transaction_utils.md#human_protocol_sdk.transaction.transaction_utils.TransactionUtils)
* [`TransactionUtilsError`](human_protocol_sdk.transaction.transaction_utils.md#human_protocol_sdk.transaction.transaction_utils.TransactionUtilsError)

## Submodules

Expand Down Expand Up @@ -127,6 +145,7 @@
* [`KVStoreKeys.fee`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.fee)
* [`KVStoreKeys.job_types`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.job_types)
* [`KVStoreKeys.public_key`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key)
* [`KVStoreKeys.registration_instructions`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.registration_instructions)
* [`KVStoreKeys.registration_needed`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.registration_needed)
* [`KVStoreKeys.role`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.role)
* [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url)
Expand Down
14 changes: 8 additions & 6 deletions docs/sdk/python/human_protocol_sdk.operator.operator_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ print(

## Module

### *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_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)
### *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_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None, registration_needed=None, registration_instructions=None)

Bases: `object`

#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None)
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reputation, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None, registration_needed=None, registration_instructions=None)

Initializes an LeaderData instance.

Expand All @@ -44,6 +44,8 @@ Initializes an LeaderData instance.
* **webhook_url** (`Optional`[`str`]) – Webhook url
* **url** (`Optional`[`str`]) – Url
* **job_types** (`Optional`[`List`[`str`]]) – Job types
* **registration_needed** (`Optional`[`bool`]) – True,
* **registration_instructions** (`Optional`[`str`]) – Instructions url,

### *class* human_protocol_sdk.operator.operator_utils.LeaderFilter(chain_id, role=None)

Expand All @@ -59,17 +61,19 @@ Initializes a LeaderFilter instance.
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Chain Id to request data
* **role** (`Optional`[`str`]) – Leader role

### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role, url='', job_types=[])
### *class* human_protocol_sdk.operator.operator_utils.Operator(address, role, url='', job_types=[], registration_needed=None, registration_instructions=None)

Bases: `object`

#### \_\_init_\_(address, role, url='', job_types=[])
#### \_\_init_\_(address, role, url='', job_types=[], registration_needed=None, registration_instructions=None)

Initializes an Operator instance.

* **Parameters:**
* **address** (`str`) – Operator address
* **role** (`str`) – Role of the operator
* **registration_needed** (`Optional`[`bool`]) – True,
* **registration_instructions** (`Optional`[`str`]) – Instructions url,

### *class* human_protocol_sdk.operator.operator_utils.OperatorUtils

Expand Down Expand Up @@ -129,8 +133,6 @@ Get the reputation network operators of the specified address.
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network in which the reputation network exists
* **address** (`str`) – Address of the reputation oracle
* **role** (`Optional`[`str`]) – (Optional) Role of the operator
* **Parem job_types:**
(Optional) Job types of the operator
* **Return type:**
`List`[[`Operator`](#human_protocol_sdk.operator.operator_utils.Operator)]
* **Returns:**
Expand Down
7 changes: 7 additions & 0 deletions docs/sdk/python/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ pip install human-protocol-sdk[agreement]
* [Submodules](human_protocol_sdk.escrow.md#submodules)
* [human_protocol_sdk.kvstore package](human_protocol_sdk.kvstore.md)
* [Submodules](human_protocol_sdk.kvstore.md#submodules)
* [human_protocol_sdk.kvstore.kvstore_utils module](human_protocol_sdk.kvstore.kvstore_utils.md)
* [Code Example](human_protocol_sdk.kvstore.kvstore_utils.md#code-example)
* [Module](human_protocol_sdk.kvstore.kvstore_utils.md#module)
* [`KVStoreData`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreData)
* [`KVStoreUtils`](human_protocol_sdk.kvstore.kvstore_utils.md#human_protocol_sdk.kvstore.kvstore_utils.KVStoreUtils)
* [human_protocol_sdk.operator package](human_protocol_sdk.operator.md)
* [Submodules](human_protocol_sdk.operator.md#submodules)
* [human_protocol_sdk.staking package](human_protocol_sdk.staking.md)
Expand All @@ -40,6 +45,8 @@ pip install human-protocol-sdk[agreement]
* [Submodules](human_protocol_sdk.statistics.md#submodules)
* [human_protocol_sdk.storage package](human_protocol_sdk.storage.md)
* [Submodules](human_protocol_sdk.storage.md#submodules)
* [human_protocol_sdk.transaction package](human_protocol_sdk.transaction.md)
* [Submodules](human_protocol_sdk.transaction.md#submodules)
* [Submodules](human_protocol_sdk.md#submodules)
* [human_protocol_sdk.constants module](human_protocol_sdk.constants.md)
* [`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/typescript/base/classes/BaseEthersClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The network information required to connect to the contracts

#### Defined in

[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)

## Properties

Expand All @@ -50,7 +50,7 @@ The network information required to connect to the contracts
#### Defined in

[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)

***

Expand All @@ -60,4 +60,4 @@ The network information required to connect to the contracts
#### Defined in

[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
10 changes: 5 additions & 5 deletions docs/sdk/typescript/encryption/classes/Encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ The private key.

#### Defined in

[encryption.ts:52](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L52)
[encryption.ts:52](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L52)

## Methods

Expand Down Expand Up @@ -117,7 +117,7 @@ const resultMessage = await encription.decrypt('message');

#### Defined in

[encryption.ts:179](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L179)
[encryption.ts:179](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L179)

***

Expand Down Expand Up @@ -153,7 +153,7 @@ const resultMessage = await encription.sign('message');

#### Defined in

[encryption.ts:216](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L216)
[encryption.ts:216](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L216)

***

Expand Down Expand Up @@ -218,7 +218,7 @@ const resultMessage = await encription.signAndEncrypt('message', publicKeys);

#### Defined in

[encryption.ts:128](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L128)
[encryption.ts:128](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L128)

***

Expand Down Expand Up @@ -246,4 +246,4 @@ Optional: The passphrase for the private key.

#### Defined in

[encryption.ts:63](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L63)
[encryption.ts:63](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L63)
10 changes: 5 additions & 5 deletions docs/sdk/typescript/encryption/classes/EncryptionUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ const result = await EncriptionUtils.encrypt('message', publicKeys);

#### Defined in

[encryption.ts:421](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L421)
[encryption.ts:421](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L421)

***

Expand Down Expand Up @@ -152,7 +152,7 @@ const result = await EncriptionUtils.generateKeyPair(name, email, passphrase);

#### Defined in

[encryption.ts:359](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L359)
[encryption.ts:359](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L359)

***

Expand Down Expand Up @@ -184,7 +184,7 @@ const signedData = await EncriptionUtils.getSignedData('message');

#### Defined in

[encryption.ts:316](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L316)
[encryption.ts:316](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L316)

***

Expand Down Expand Up @@ -232,7 +232,7 @@ if (isEncrypted) {

#### Defined in

[encryption.ts:470](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L470)
[encryption.ts:470](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L470)

***

Expand Down Expand Up @@ -280,4 +280,4 @@ const result = await EncriptionUtils.verify('message', publicKey);

#### Defined in

[encryption.ts:283](https://github.com/humanprotocol/human-protocol/blob/11c280a968c4e19e21e43f468baa71bfd0766e56/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L283)
[encryption.ts:283](https://github.com/humanprotocol/human-protocol/blob/95ed623c67878973c127c8529a78774329277e86/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L283)
Loading

0 comments on commit 61e6631

Please sign in to comment.