Skip to content

Commit

Permalink
Merge pull request #87 from humanprotocol/feat/staking-slashing
Browse files Browse the repository at this point in the history
Staking/Slashing on Abuse
  • Loading branch information
portuu3 authored Feb 9, 2023
2 parents bfdf99f + 1fa299c commit c460cc1
Show file tree
Hide file tree
Showing 335 changed files with 20,440 additions and 46,061 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cd-node-basemodels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Node.js Base Models NPM publish

on:
release:
types: [published]

jobs:
node-sdk-publish:
name: Node.js Base Models NPM Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: yarn --ignore-scripts
name: Install dependencies
- name: Change Package version
uses: jossef/action-set-json-field@v2
with:
file: ./packages/sdk/typescript/human-protocol-basemodels/package.json
field: version
value: ${{ github.event.release.tag_name }}
- uses: JS-DevTools/npm-publish@v1
name: Publish
with:
package: ./packages/sdk/typescript/human-protocol-basemodels/package.json
access: public
token: ${{ secrets.NPM_TOKEN }}
38 changes: 38 additions & 0 deletions .github/workflows/cd-python-basemodels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python Base Models publish

on:
release:
types: [published]

jobs:
publish-python-basemodels:
name: Publish Python Base Models
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Node
run: yarn --ignore-scripts
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
working-directory: ./packages/sdk/python/human-protocol-basemodels
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Set the relase version
uses: "DamianReeves/write-file-action@master"
with:
path: ./packages/sdk/python/human-protocol-basemodels/basemodels/__init__.py
write-mode: overwrite
contents: |
__version__ = "${{ github.event.release.tag_name }}"
- name: Build and publish
working-directory: ./packages/sdk/python/human-protocol-basemodels
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
make build-package
twine upload dist/* --skip-existing
10 changes: 5 additions & 5 deletions .github/workflows/cd-python-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,24 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: "3.x"
- name: Install dependencies
working-directory: ./packages/sdk/python
working-directory: ./packages/sdk/python/human-protocol-sdk
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Set the relase version
uses: "DamianReeves/write-file-action@master"
with:
path: ./packages/sdk/python/human_protocol_sdk/__init__.py
path: ./packages/sdk/python/human-protocol-sdk/human_protocol_sdk/__init__.py
write-mode: overwrite
contents: |
__version__ = "${{ github.event.release.tag_name }}"
- name: Build and publish
working-directory: ./packages/sdk/python
working-directory: ./packages/sdk/python/human-protocol-sdk
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
make build-package
twine upload dist/*
twine upload dist/* --skip-existing
22 changes: 12 additions & 10 deletions .github/workflows/cd-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,23 @@ jobs:
matrix:
network:
- name: matic
graph: polygon
graph: polygon-v1
- name: goerli
graph: goerli
graph: goerli-v1
- name: moonbeam
graph: moonbeam
graph: moonbeam-v1
- name: bsc
graph: bsc
graph: bsc-v1
- name: chapel
graph: bsctest
graph: bsctest-v1
- name: mumbai
graph: mumbai
- name: avalanche
graph: avalanche
- name: fuji
graph: fuji
graph: mumbai-v1
- name: mbase
graph: moonbase-alpha-v1
# - name: avalanche
# graph: avalanche
# - name: fuji
# graph: fuji
fail-fast: true
max-parallel: 3
steps:
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci-test-fortune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,5 @@ jobs:
node-version: 18
- run: npm install --global yarn && yarn --ignore-scripts
name: npm Install dependencies
- run: yarn && yarn install:all
working-directory: ./packages/examples/fortune
name: npm Install Fortune dependencies
- run: yarn fortune:test
name: Run fortune test
19 changes: 19 additions & 0 deletions .github/workflows/ci-test-node-basemodels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Node.js Base Models check

on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:

jobs:
node-basemodels-test:
name: Node.js Base Models Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: npm install --global yarn && yarn --ignore-scripts
name: Install dependencies
- run: yarn basemodels:test
name: Run Node.js Base Models Test
26 changes: 26 additions & 0 deletions .github/workflows/ci-test-python-basemodels.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Python Base Models Check

on:
push:
branches:
- "main"
pull_request:
workflow_dispatch:

jobs:
python-test:
name: Python Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: "3.10"
- name: Install pipenv
run: pip install pipenv
- name: Python test
working-directory: ./packages/sdk/python/human-protocol-basemodels
run: |
pipenv install --dev
make run-test
4 changes: 2 additions & 2 deletions .github/workflows/ci-test-python-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:
- name: Set up Python 3.10
uses: actions/setup-python@v1
with:
python-version: '3.10'
python-version: "3.10"
- name: Install pipenv
run: pip install pipenv
- name: Python test
working-directory: ./packages/sdk/python
working-directory: ./packages/sdk/python/human-protocol-sdk
env:
ESCROW_AWS_ACCESS_KEY_ID: ${{ secrets.ESCROW_AWS_ACCESS_KEY_ID }}
ESCROW_AWS_SECRET_ACCESS_KEY: ${{ secrets.ESCROW_AWS_SECRET_ACCESS_KEY }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,3 @@ build

#cache
cache

#test data
data
8 changes: 6 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,9 @@

npx lint-staged

cd packages/sdk/python && make format
git add -u
cd packages/sdk/python
cd human-protocol-basemodels && make format && git add . -u
cd ..
cd human-protocol-sdk && make format && git add . -u
cd ../../../

Loading

2 comments on commit c460cc1

@vercel
Copy link

@vercel vercel bot commented on c460cc1 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

human-protocol-escrow-dashboard – ./packages/apps/escrow-dashboard

human-protocol-escrow-dashboard-humanprotocol.vercel.app
human-protocol-escrow-dashboard-git-main-humanprotocol.vercel.app
dashboard.humanprotocol.org

@vercel
Copy link

@vercel vercel bot commented on c460cc1 Feb 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.