Skip to content

Commit

Permalink
Merge pull request #2161 from humanprotocol/develop
Browse files Browse the repository at this point in the history
Release 20240619
  • Loading branch information
portuu3 committed Jul 30, 2024
2 parents 53c485d + 47174ae commit d55c909
Show file tree
Hide file tree
Showing 830 changed files with 46,940 additions and 9,069 deletions.
60 changes: 22 additions & 38 deletions .github/workflows/cd-subgraph.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
name: Subgraph deployment

on:
push:
branches:
- main
paths:
- packages/sdk/typescript/subgraph/**
- .github/workflows/cd-subgraph.yaml
workflow_dispatch:
inputs:
label:
description: 'New version label'
required: true

jobs:
subgraph:
Expand All @@ -16,56 +14,42 @@ jobs:
strategy:
matrix:
network:
- name: matic
graph: polygon-v2
- name: goerli
graph: goerli-v2
- name: moonbeam
graph: moonbeam-v2
- name: bsc
graph: bsc-v2
- name: chapel
graph: bsctest-v2
- name: mumbai
graph: mumbai-v2
- name: mbase
graph: moonbase-alpha-v2
- name: mainnet
graph: mainnet-v2
- name: fuji
graph: fuji-v2
- name: amoy
- name: avalanche
graph: avalanche-v2
- name: celo
graph: celo
- name: bsc-testnet
- name: bsc
- name: celo-alfajores
graph: celo-alfajores
- name : xlayer-testnet
graph: xlayer-testnet
- name: celo
- name: ethereum
- name: fuji
- name: moonbase-alpha
- name: moonbeam
- name: polygon
- name: sepolia
- name: xlayer-testnet
- name: xlayer
graph: xlayer
fail-fast: true
max-parallel: 3
steps:
- uses: actions/checkout@v4
- run: yarn --ignore-scripts
- run: npm install --global yarn && yarn --ignore-scripts
name: Install dependencies
- run: yarn build
name: Build core package
working-directory: ./packages/core
- run: yarn global add @graphprotocol/graph-cli
name: Install Graph CLI
- run: graph auth --product hosted-service ${API_KEY}
- run: graph auth --studio ${API_KEY}
name: Authenticate Graph CLI
env:
API_KEY: ${{ secrets.HP_GRAPH_API_KEY }}
- run: yarn generate
name: Generate Subgraph
- run: yarn generate && yarn build
name: Generate and build Subgraph
working-directory: ./packages/sdk/typescript/subgraph
env:
NETWORK: ${{ matrix.network.graph }}
- run: graph deploy --product hosted-service humanprotocol/${NETWORK}
NETWORK: ${{ matrix.network.name }}
- run: graph deploy --studio ${NETWORK} -l ${{ github.event.inputs.label }}
name: Deploy Subgraph
working-directory: ./packages/sdk/typescript/subgraph
env:
NETWORK: ${{ matrix.network.graph }}
NETWORK: ${{ matrix.network.name }}
2 changes: 1 addition & 1 deletion .github/workflows/ci-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ jobs:
- name: "Checkout Repository"
uses: actions/checkout@v4.1.1
- name: "Dependency Review"
uses: actions/dependency-review-action@v4.3.2
uses: actions/dependency-review-action@v4.3.4
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn --ignore-scripts
name: Install dependencies
- run: yarn core:test
- run: yarn workspace @human-protocol/core test
name: Run protocol test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-dashboard-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn dashboard-ui:test
- run: yarn workspace @human-protocol/dashboard-ui test
name: Run dashboard-ui test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-faucet-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ jobs:
- run: cp .env.example .env
name: Create .env file
working-directory: packages/apps/faucet-server
- run: yarn faucet-server:test
- run: yarn workspace @human-protocol/faucet-server test
name: Run faucet-server test
23 changes: 0 additions & 23 deletions .github/workflows/ci-test-fortune-v3.yaml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/ci-test-fortune.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Fortune check

on:
push:
branches:
- 'main'
pull_request:
paths:
- 'packages/core/**'
- 'packages/sdk/typescript/human-protocol-sdk/**'
- 'packages/apps/fortune/**'
workflow_dispatch:

jobs:
fortune-exchange-oracle-test:
name: Fortune Exchange Oracle Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn workspace @human-protocol/fortune-exchange-oracle-server test
name: Run Exchange Oracle tests
fortune-recording-oracle-test:
name: Fortune Recording Oracle Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn workspace @human-protocol/fortune-recording-oracle test
name: Run Recording Oracle tests
10 changes: 5 additions & 5 deletions .github/workflows/ci-test-human-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Human App Check
on:
push:
branches:
- "main"
- 'main'
pull_request:
paths:
- "packages/core/**"
- "packages/sdk/typescript/human-protocol-sdk/**"
- "packages/apps/human-app/**"
- 'packages/core/**'
- 'packages/sdk/typescript/human-protocol-sdk/**'
- 'packages/apps/human-app/**'
workflow_dispatch:

jobs:
Expand All @@ -19,5 +19,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn human-app-server:test
- run: yarn workspace @human-protocol/human-app-server test
name: Run Job Human App unit tests
12 changes: 6 additions & 6 deletions .github/workflows/ci-test-job-launcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Job Launcher Check
on:
push:
branches:
- "main"
- 'main'
pull_request:
paths:
- "packages/core/**"
- "packages/sdk/typescript/human-protocol-sdk/**"
- "packages/apps/job-launcher/**"
- 'packages/core/**'
- 'packages/sdk/typescript/human-protocol-sdk/**'
- 'packages/apps/job-launcher/**'
workflow_dispatch:

jobs:
Expand All @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn job-launcher-client:test
- run: yarn workspace @human-protocol/job-launcher-client test
name: Run Job Launcher Client test
job-launcher-server-test:
name: Job Launcher Server Test
Expand All @@ -28,5 +28,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn job-launcher-server:test
- run: yarn workspace @human-protocol/job-launcher-server test
name: Run Job Launcher Server test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-node-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ jobs:
- run: yarn build
name: Build core package
working-directory: ./packages/core
- run: yarn sdk:test
- run: yarn workspace @human-protocol/sdk test
name: Run Node.js SDK test
10 changes: 5 additions & 5 deletions .github/workflows/ci-test-reputation-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Reputation Oracle Check
on:
push:
branches:
- "main"
- 'main'
pull_request:
paths:
- "packages/core/**"
- "packages/sdk/typescript/human-protocol-sdk/**"
- "packages/apps/reputation-oracle/**"
- 'packages/core/**'
- 'packages/sdk/typescript/human-protocol-sdk/**'
- 'packages/apps/reputation-oracle/**'
workflow_dispatch:

jobs:
Expand All @@ -19,5 +19,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn reputation-oracle:test
- run: yarn workspace @human-protocol/reputation-oracle test
name: Run reputation oracle test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ jobs:
- uses: actions/checkout@v4
- run: npm install --global yarn && yarn
name: Install dependencies
- run: yarn subgraph:test
- run: yarn workspace @human-protocol/subgraph test
name: Run subgraph test
6 changes: 4 additions & 2 deletions docs/sdk/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Table of contents

## Typescript SDK
## Typescript SDK

- [Encryption](typescript/encryption/README.md)
- [Encryption](typescript/encryption/classes/Encryption.md)
Expand All @@ -10,6 +10,7 @@
- [EscrowUtils](typescript/escrow/classes/EscrowUtils.md)
- [KVStore](typescript/kvstore/README.md)
- [KVStoreClient](typescript/kvstore/classes/KVStoreClient.md)
- [KVStoreUtils](typescript/kvstore/classes/KVStoreUtils.md)
- [Staking](typescript/staking/README.md)
- [StakingClient](typescript/staking/classes/StakingClient.md)
- [Operator](typescript/operator/README.md)
Expand All @@ -36,6 +37,7 @@
- [escrow_utils](python/human_protocol_sdk.escrow.escrow_utils.md)
- [kvstore](python/human_protocol_sdk.kvstore.md)
- [kvstore_client](python/human_protocol_sdk.kvstore.kvstore_client.md)
- [kvstore_utils](python/human_protocol_sdk.kvstore.kvstore_utils.md)
- [staking](python/human_protocol_sdk.staking.md)
- [staking_client](python/human_protocol_sdk.staking.staking_client.md)
- [staking_utils](python/human_protocol_sdk.staking.staking_utils.md)
Expand All @@ -54,4 +56,4 @@

---

- [CHANGELOG](./changelog.md)
- [CHANGELOG](changelog.md)
10 changes: 10 additions & 0 deletions docs/sdk/python/human_protocol_sdk.constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ Enum for KVStore keys

#### webhook_url *= 'webhook_url'*

### *class* human_protocol_sdk.constants.OrderDirection(value)

Bases: `Enum`

Enum for chain IDs.

#### ASC *= 'asc'*

#### DESC *= 'desc'*

### *class* human_protocol_sdk.constants.Role(value)

Bases: `Enum`
Expand Down
55 changes: 54 additions & 1 deletion docs/sdk/python/human_protocol_sdk.escrow.escrow_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ Returns the escrow for a given address.
)
```

#### *static* get_escrows(filter=<human_protocol_sdk.filter.EscrowFilter object>)
#### *static* get_escrows(filter)

Get an array of escrow addresses based on the specified filter parameters.

Expand All @@ -110,3 +110,56 @@ Get an array of escrow addresses based on the specified filter parameters.
)
)
```

#### *static* get_status_events(chain_id, statuses=None, date_from=None, date_to=None, launcher=None, first=10, skip=0, order_direction=OrderDirection.DESC)

Retrieve status events for specified networks and statuses within a date range.

* **Parameters:**
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – Network to request data.
* **(****Optional****[****List****[****Status****]****]****)** (*statuses*) – List of statuses to filter by.
* **(****Optional****[****datetime****]****)** (*date_to*) – Start date for the query range.
* **(****Optional****[****datetime****]****)** – End date for the query range.
* **(****Optional****[****str****]****)** (*launcher*) – Address of the launcher to filter by.
* **(****int****)** (*skip*) – Number of items per page.
* **(****int****)** – Page number to retrieve.
* **(****OrderDirection****)** (*order_direction*) – Order of results, “asc” or “desc”.
* **Return List[StatusEvent]:**
List of status events matching the query parameters.
* **Raises:**
[**EscrowClientError**](human_protocol_sdk.escrow.escrow_client.md#human_protocol_sdk.escrow.escrow_client.EscrowClientError) – If an unsupported chain ID or invalid launcher address is provided.
* **Example:**
```python
from datetime import datetime
from human_protocol_sdk.constants import ChainId, Status
from human_protocol_sdk.escrow import EscrowUtils

print(
EscrowUtils.get_status_events(
networks=[ChainId.POLYGON_AMOY, ChainId.ETHEREUM],
statuses=[Status.Pending, Status.Paid],
date_from=datetime(2023, 1, 1),
date_to=datetime(2023, 12, 31),
launcher="0x1234567890abcdef1234567890abcdef12345678",
first=20,
skip=0,
order_direction=OrderDirection.DESC
)
)
```
* **Return type:**
`List`[[`StatusEvent`](#human_protocol_sdk.escrow.escrow_utils.StatusEvent)]

### *class* human_protocol_sdk.escrow.escrow_utils.StatusEvent(timestamp, status, chain_id, escrow_address)

Bases: `object`

Initializes a StatusEvent instance.

* **Parameters:**
* **timestamp** (`int`) – The timestamp of the event.
* **status** (`str`) – The status of the escrow.
* **chain_id** ([`ChainId`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.ChainId)) – The chain identifier where the event occurred.
* **escrow_address** (`str`) – The address of the escrow.

#### \_\_init_\_(timestamp, status, chain_id, escrow_address)
3 changes: 3 additions & 0 deletions docs/sdk/python/human_protocol_sdk.escrow.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,6 @@ obtain information from both the contracts and subgraph.
* [`EscrowUtils`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils)
* [`EscrowUtils.get_escrow()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_escrow)
* [`EscrowUtils.get_escrows()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_escrows)
* [`EscrowUtils.get_status_events()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.EscrowUtils.get_status_events)
* [`StatusEvent`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.StatusEvent)
* [`StatusEvent.__init__()`](human_protocol_sdk.escrow.escrow_utils.md#human_protocol_sdk.escrow.escrow_utils.StatusEvent.__init__)
Loading

0 comments on commit d55c909

Please sign in to comment.