Skip to content

Commit

Permalink
Data providers tests for Achainable, Nodereal, Discord, Litentry, and…
Browse files Browse the repository at this point in the history
… Twitter (#2434)

* revert data-provider-tests

* fix CorePrimitivesIdentity imports

* Restore the data-provider test.

* remove vipp3 test file

* debug vcPayloadJson

* refactor credential definitions

* format

* add event listening

* complete vip3 tests

* fix vip3MembershipCardSliver

* add to ci.yml

* fix ci

* extract and reuse  function

* test cli

* format

* remove client config

* format

* random substrate wallet

* test client

* fix cli issue

* fix cli path

* env example

* debug local

* format

* fix cli path

* test mock address

* withdraw account test.

* modefy into json file

* delete ts file

* format

* add achainable json

* improve logic

* fix comments

* complete achainable test

* step description

* test token-holding-amount-amp

* add litentry spaceId discord

* add twitter

* f ix ndoereal tests

* add matic

* Json data Integration Testing

* assert desc

* add yml

* add GHA for data-provider-tests

* add shell

* chmod shell

* add agrument

* fix shell

* rename

* add dc account

* fix bab

* fix yml

* format

* remove Mirror

* fix typo

* order of json

* remove A20 from ci.yml

* rebase A20 test

---------

Co-authored-by: Kasper Ziemianek <kasper.ziemianek@gmail.com>
  • Loading branch information
0xverin and kziemianek committed Feb 6, 2024
1 parent 4d7fdcb commit 01d88ed
Show file tree
Hide file tree
Showing 13 changed files with 865 additions and 39 deletions.
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
- name: bitacross-worker enclave-runtime fmt check
working-directory: ./bitacross-worker/enclave-runtime
run: |
cargo fmt --all -- --check
cargo fmt --all -- --check
- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm
Expand Down Expand Up @@ -311,7 +311,7 @@ jobs:
- set-condition
- sequentialise
if: needs.set-condition.outputs.rebuild_bitacross == 'true'
# todo: we might want to change this image in the future
# todo: we might want to change this image in the future
container: "litentry/litentry-tee-dev:latest"
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -705,7 +705,6 @@ jobs:
- test_name: lit-parentchain-nonce
- test_name: lit-ii-batch-test
- test_name: lit-test-stress-script
- test_name: lit-data-providers-test
steps:
- uses: actions/checkout@v4

Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/verify-correctness-of-vc-content-.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Verify the correctness of VC content

on:
workflow_dispatch:
inputs:
docker-tag:
description: "client tag(e.g. p1.2.0-9701-w0.0.1-101)"
required: true
default: "latest"
jobs:
test-data-provider:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set ENV
run: |
# extracting parachain version and worker version from release tag
echo "PARACHAIN_TAG=$(echo ${{inputs.docker-tag}} | sed 's/p/v/;s/\(.*\)-w.*/\1/')" >> $GITHUB_ENV
echo "WORKER_TAG=$(echo ${{inputs.docker-tag}} | sed 's/.*\(w.*\)/\1/;s/w/v/')" >> $GITHUB_ENV
- name: Pull litentry image optionally
run: |
docker pull parity/polkadot
docker pull litentry/litentry-worker:$WORKER_TAG
docker pull litentry/litentry-cli:$WORKER_TAG
docker pull litentry/litentry-parachain:$PARACHAIN_TAG
- name: Re-tag docker image
run: |
docker tag litentry/litentry-worker:$WORKER_TAG litentry/litentry-worker:latest
docker tag litentry/litentry-cli:$WORKER_TAG litentry/litentry-cli:latest
docker tag litentry/litentry-parachain:$PARACHAIN_TAG litentry/litentry-parachain:latest
- run: docker images --all

- name: Enable corepack and pnpm
run: corepack enable && corepack enable pnpm

- name: Generate parachain artefacts
run: |
./tee-worker/scripts/litentry/generate_parachain_artefacts.sh
- name: Build litentry parachain docker images
run: |
cd tee-worker/docker
docker compose -f litentry-parachain.build.yml build
- name: Run data-provider-test
run: |
cd tee-worker/docker
docker compose -f docker-compose.yml -f lit-data-provider-test.yml up --no-build --exit-code-from lit-data-provider-test lit-data-provider-test
- name: Stop docker containers
run: |
cd tee-worker/docker
docker compose -f docker-compose.yml -f lit-data-provider-test.yml stop
- name: Collect Docker Logs
continue-on-error: true
if: always()
uses: jwalton/gh-docker-logs@v2
with:
tail: all
dest: logs

- name: Upload logs
if: always()
uses: actions/upload-artifact@v4
with:
name: logs-lit-data-provider-test
path: logs
if-no-files-found: ignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
services:
lit-data-providers-test:
lit-data-provider-test:
image: litentry/litentry-cli:latest
container_name: litentry-data-providers-test
container_name: litentry-data-provider-test
volumes:
- ../ts-tests:/ts-tests
- ../client-api:/client-api
Expand All @@ -17,7 +17,7 @@ services:
condition: service_healthy
networks:
- litentry-test-network
entrypoint: "bash -c '/usr/local/worker-cli/lit_ts_integration_test.sh test-data-providers 2>&1' "
entrypoint: "bash -c '/usr/local/worker-cli/lit_ts_integration_test.sh test-data-provider 2>&1' "
restart: "no"
networks:
litentry-test-network:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,251 @@
[
{
"id": "bab-holder",
"name": "Trustworthy Binance user",
"description": "You are holding a Binance Account Bound(BAB) token",
"assertion": {
"id": "Achainable",
"payload": {
"Basic": {
"name": "BAB token holder",
"chain": "Bsc"
}
}
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0xdB01C6a38E780a2644b3B26961b14313b019714a",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "uniswap-v2-v3-user",
"name": "Uniswap V2/V3 User",
"description": "You are a trader or liquidity provider of Uniswap V2 or V3\nUniswap V2 Factory Contract: 0x5c69bee701ef814a2b6a3edd4b1652cb9cc5aa6f\nUniswap V3 Factory Contract: 0x1f98431c8ad98523631ae4a59f267346ea31f984",
"assertion": {
"id": "Achainable",
"payload": {
"Basic": {
"name": "Uniswap V2/V3 user",
"chain": "Ethereum"
}
}
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0x7031a420603a83EFBE85503e5A4BF562121A85ab",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "dot-holder",
"name": "DOT Holding Time",
"description": "The length of time a user continues to hold DOT token (threshold DOT > 5)",
"assertion": {
"id": "A7",
"payload": "5"
},
"dataProvider": "achainable",
"network": "polkadot",
"mockDid": "litentry:substrate:0xbf6e312fd006908b0152da113ec73b9ffc9983f9b848698180b9b43c5ad44681",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "eth-holder",
"name": "ETH Holding Time",
"description": "The length of time a user continues to hold ETH token (threshold ETH > 0.01)",
"assertion": {
"id": "A11",
"payload": "0.01"
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0x6887246668a3b87F54DeB3b94Ba47a6f63F32985",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": false
},
{
"id": "wbtc-holder",
"name": "WBTC Holding Time",
"description": "The length of time a user continues to hold WBTC token (threshold WBTC > 0.001)",
"assertion": {
"id": "A10",
"payload": 0.001
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0x5680b3FcBB64FB161adbD347BC92e8DDEDA97008",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "lit-holder",
"name": "LIT Holding Time",
"description": "The length of time a user continues to hold LIT token (threshold LIT > 10)",
"assertion": {
"id": "A4",
"payload": "10"
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:substrate:0x6c7fdb8b8eaad1af9faaf918493606e1a3e8c20f9d852773ab5ebfbb93bd1948",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "ethereum-account-class-of-year",
"name": "Ethereum Account Class of Year",
"description": "The class of year that your Ethereum account was created (must have on-chain records)",
"assertion": {
"id": "achainable",
"payload": {
"ClassOfYear": {
"name": "Account created between {dates}",
"chain": "Ethereum"
}
}
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0x3D66aF7cBeb2d9c6b4497a2269F7e3fcd9996524",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "evm-transaction-count",
"name": "ETH Transaction Count",
"description": "Your total transaction amount on these EVM networks: Ethereum",
"assertion": {
"id": "A8",
"payload": ["Ethereum"]
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0xb144EeFd29B2E448419fd8dD6Cd6c7EB258D4715",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": false
},
{
"id": "litentry-transaction-count",
"name": "LIT Transaction Count",
"description": "Your total transaction amount on these Substrate networks: Litentry, Litmus, Ethereum.",
"assertion": {
"id": "A8",
"payload": ["Litentry", "Litmus", "Ethereum"]
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:substrate:0xcacb83fc3d36caa4d03a80c0669aa19b38ffd1a9bb54d78b719fac1942816b40",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "polkadot-governance-participation",
"name": "Polkadot Governance Participation Proof",
"description": "You have ever participated in any Polkadot on-chain governance events. This credential is counting: Technical Committee Proposals, Democracy Proposals, Council Proposals, Proposal Seconds, Proposal Votes, Democracy Votes, Council Votes, Treasury Spend Proposals.",
"assertion": {
"id": "A14",
"payload": []
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:substrate:0x5FeEE1E799015A22EbD216d43484FCB3BA88de20",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "contract-creator",
"name": "Ethereum Contract Creator",
"description": "You are a deployer of a smart contract on these networks: Ethereum",
"assertion": {
"id": "Achainable",
"payload": {
"Amount": {
"name": "Created over {amount} contracts",
"chain": "Ethereum",
"amount": "0"
}
}
},
"dataProvider": "achainable",
"network": "ethereum",
"mockDid": "litentry:evm:0x11fBffc1F3dF23E7219e2B3036fe2A12C10cD3AD",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "token-holder-dot",
"name": "DOT Holder",
"description": "The number of DOT tokens you hold > 0",
"assertion": {
"id": "Achainable",
"payload": {
"Amount": {
"name": "Balance over {amount}",
"chain": "Polkadot",
"amount": "0"
}
}
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:substrate:0x0d584a4cbbfd9a4878d816512894e65918e54fae13df39a6f520fc90caea2fb0",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "token-holder-eth",
"name": "ETH Holder",
"description": "The number of ETH tokens you hold > 0",
"assertion": {
"id": "Achainable",
"payload": {
"Amount": {
"name": "Balance over {amount}",
"chain": "Ethereum",
"amount": "0"
}
}
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:evm:0x66485bB62896Bd7bE54dE8E2050cc8746a50E0b2",
"mockWeb3Network": "bsc,ethereum",
"expectedCredentialValue": true
},
{
"id": "token-holder-lit",
"name": "LIT Holder",
"description": "The number of LIT tokens you hold > 0",
"assertion": {
"id": "Achainable",
"payload": {
"Amount": {
"name": "Balance over {amount}",
"chain": "Litentry",
"amount": "0"
}
}
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:substrate:0xc0103c4b56ce752d05b16a88260e3a9e2c44306602a74c5edd1cd4ff56356f7c",
"mockWeb3Network": "litentry,polkadot",
"expectedCredentialValue": true
},
{
"id": "token-holding-amount-btcs",
"name": "BTCS Holding Time",
"description": "The number of BTCS tokens you hold > 0",
"assertion": {
"id": "Brc20AmountHolder",
"payload": []
},
"dataProvider": "achainable",
"network": "litentry",
"mockDid": "litentry:bitcoin:0x030b0998ea7d5052e3016bd8c83f920f452f6102c06e91a2880556b91db68bce90",
"mockWeb3Network": "BitcoinP2tr",
"expectedCredentialValue": null
}
]
Loading

0 comments on commit 01d88ed

Please sign in to comment.