Compare commits
269
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cde6577356 | ||
|
|
b41de05cfc | ||
|
|
00679c75f2 | ||
|
|
7fe722dad0 | ||
|
|
0d8a74dfd0 | ||
|
|
928b899c46 | ||
|
|
72d93bb568 | ||
|
|
db75261cd5 | ||
|
|
66fbe28cf0 | ||
|
|
9f3b8ecade | ||
|
|
cd13c61e90 | ||
|
|
246577f401 | ||
|
|
503ca26f68 | ||
|
|
13e374a6bb | ||
|
|
bed411040c | ||
|
|
d0173f15b2 | ||
|
|
106b040977 | ||
|
|
bf84b04a30 | ||
|
|
9f442698a4 | ||
|
|
d1265a6af7 | ||
|
|
313eff1c95 | ||
|
|
7f949a276c | ||
|
|
76a53dc7e3 | ||
|
|
72821dd183 | ||
|
|
40d2e033e0 | ||
|
|
e6d0b6ac1f | ||
|
|
99161497fe | ||
|
|
bf6ab32230 | ||
|
|
28bcb4ada1 | ||
|
|
5812c8858d | ||
|
|
abf146895d | ||
|
|
4476e6c6d1 | ||
|
|
d967000e8f | ||
|
|
91d3d97399 | ||
|
|
ca700aa103 | ||
|
|
265bf7fb35 | ||
|
|
7a5c6f3a25 | ||
|
|
91e3460e9d | ||
|
|
cf0c45aaa5 | ||
|
|
bf63f9d46d | ||
|
|
023a83e0f7 | ||
|
|
4f6ed1eadf | ||
|
|
85e293f3ec | ||
|
|
7b15d2db10 | ||
|
|
b1b9695998 | ||
|
|
6b8b33a78b | ||
|
|
4fd0f6819a | ||
|
|
5032d87f98 | ||
|
|
b15d9cb7dc | ||
|
|
6aa7cc5bab | ||
|
|
c37f9ebe66 | ||
|
|
768b3b29f0 | ||
|
|
378946f22b | ||
|
|
523598645a | ||
|
|
a9267de653 | ||
|
|
ce22da1c9a | ||
|
|
2460a62a3e | ||
|
|
f37a8720a2 | ||
|
|
f5fe3cc18d | ||
|
|
288f075cac | ||
|
|
ca46861fd8 | ||
|
|
2cb6ede492 | ||
|
|
eefcc96149 | ||
|
|
7a99ded8e9 | ||
|
|
4a4cdaa2b8 | ||
|
|
cd969549ab | ||
|
|
5a73b7e769 | ||
|
|
a4f41eabb6 | ||
|
|
351a20abad | ||
|
|
8d42481130 | ||
|
|
8a59722f09 | ||
|
|
de48ffa563 | ||
|
|
00c5252aea | ||
|
|
9acc083c11 | ||
|
|
77264e80f1 | ||
|
|
50378bc8d2 | ||
|
|
b88da51c68 | ||
|
|
2ae56bb113 | ||
|
|
752af9a983 | ||
|
|
a01df081eb | ||
|
|
c2d14d1abe | ||
|
|
a76ff44ffd | ||
|
|
ac2e262bf3 | ||
|
|
ab180875b1 | ||
|
|
66d3e89b9e | ||
|
|
c9cce87606 | ||
|
|
50232ab089 | ||
|
|
e86fb6d0b4 | ||
|
|
473ef3ae83 | ||
|
|
77ab719b37 | ||
|
|
a10f67d7ab | ||
|
|
66d2b83513 | ||
|
|
e4fd040933 | ||
|
|
30c1dbd019 | ||
|
|
5e558c4cd3 | ||
|
|
85060a0421 | ||
|
|
b336291b49 | ||
|
|
0f7bffd38b | ||
|
|
3665375b75 | ||
|
|
8572c0a570 | ||
|
|
6a29dc82ef | ||
|
|
c19bcc5e0c | ||
|
|
6593bbf37b | ||
|
|
1e5e57b978 | ||
|
|
5394b00349 | ||
|
|
32f5eaade5 | ||
|
|
b7a440132d | ||
|
|
d6ecdf80fa | ||
|
|
21e545d941 | ||
|
|
ef5fa7cba6 | ||
|
|
d1f465e2af | ||
|
|
2740df48a3 | ||
|
|
cf1f10e324 | ||
|
|
f09a1abcfa | ||
|
|
3de83c6eb8 | ||
|
|
e6545c13af | ||
|
|
613582ee00 | ||
|
|
77582a62a8 | ||
|
|
384c96376a | ||
|
|
0a92f62a66 | ||
|
|
f589f4a9fa | ||
|
|
b9869da492 | ||
|
|
653fec7025 | ||
|
|
8bf948578c | ||
|
|
11b08d16e4 | ||
|
|
5081b11c93 | ||
|
|
a1366e59ec | ||
|
|
0b035d5064 | ||
|
|
e1a38f2197 | ||
|
|
8201e87050 | ||
|
|
3aaf4e724d | ||
|
|
6fe06e9f62 | ||
|
|
cd8b0e7caf | ||
|
|
4282faa9d9 | ||
|
|
a24846fd06 | ||
|
|
72de53cf10 | ||
|
|
f3c0313a59 | ||
|
|
4c0de8f22b | ||
|
|
254fb57af0 | ||
|
|
6371199537 | ||
|
|
75cb48a4b9 | ||
|
|
933878acf5 | ||
|
|
5995df8e68 | ||
|
|
4d5b7cf5e7 | ||
|
|
e1f60446f0 | ||
|
|
7f271069ab | ||
|
|
1ae7af5d59 | ||
|
|
b9c5d9ee96 | ||
|
|
ae1768a669 | ||
|
|
a1bfe7f1a7 | ||
|
|
b0f1aeedae | ||
|
|
da59e83b19 | ||
|
|
360624282d | ||
|
|
9e054c7c85 | ||
|
|
911e927ab0 | ||
|
|
e4a51061a3 | ||
|
|
c15051d457 | ||
|
|
460ccdb3a2 | ||
|
|
959fb9cf62 | ||
|
|
2c7170d0e9 | ||
|
|
8a28a4afd4 | ||
|
|
48072eb4c3 | ||
|
|
ae92ff2580 | ||
|
|
c99b7fbb02 | ||
|
|
a9b1767a42 | ||
|
|
3cd60ad3e6 | ||
|
|
2f4bc9484b | ||
|
|
d4f5643799 | ||
|
|
72c49e62a8 | ||
|
|
0988edc129 | ||
|
|
4d266963ae | ||
|
|
ec12c7ecfd | ||
|
|
045dace274 | ||
|
|
2346b2f1a0 | ||
|
|
31859cb779 | ||
|
|
20507ecdd1 | ||
|
|
13ba661ea0 | ||
|
|
03f5b9fc7b | ||
|
|
b9fed65615 | ||
|
|
d671e51edf | ||
|
|
4f3295d3fc | ||
|
|
7be7bab1ca | ||
|
|
61380f06b9 | ||
|
|
c113856d63 | ||
|
|
90884beee8 | ||
|
|
d9d2e428f4 | ||
|
|
ba8d54b761 | ||
|
|
dce4edb943 | ||
|
|
b468a0fd84 | ||
|
|
c98fbe7453 | ||
|
|
d20928ec06 | ||
|
|
289559fe4f | ||
|
|
071fd6128c | ||
|
|
554d07a31b | ||
|
|
48b62380b0 | ||
|
|
a9f4604bad | ||
|
|
54f2519a62 | ||
|
|
260e7bf9cf | ||
|
|
83db796cdb | ||
|
|
2f6800212e | ||
|
|
77e16ad1b7 | ||
|
|
dcce983842 | ||
|
|
53ce9bfaa2 | ||
|
|
6ae34d296f | ||
|
|
ee2aafb99c | ||
|
|
e8fdb63323 | ||
|
|
3df9270b57 | ||
|
|
ab26667265 | ||
|
|
9fc6b255c8 | ||
|
|
91f61d8bb5 | ||
|
|
bbfda65bcc | ||
|
|
45f2e926c3 | ||
|
|
ccadbc2cb6 | ||
|
|
7128acb7b8 | ||
|
|
357bdaa4f3 | ||
|
|
f3fe43724e | ||
|
|
03f5ca3096 | ||
|
|
03d19349af | ||
|
|
1f53b2cbb5 | ||
|
|
b010c98346 | ||
|
|
29d57af2ba | ||
|
|
fd7940c4cf | ||
|
|
8ab7ac8414 | ||
|
|
ce7cd03c3e | ||
|
|
dfa3355a68 | ||
|
|
8553904d81 | ||
|
|
10afa3c1d4 | ||
|
|
ecd362615e | ||
|
|
0d9bd67465 | ||
|
|
b5aa92f007 | ||
|
|
2955790be1 | ||
|
|
89ff9309e9 | ||
|
|
e1df3489f6 | ||
|
|
f0fa9ca5e1 | ||
|
|
9d92477c2a | ||
|
|
b1a198be85 | ||
|
|
5fb385d43c | ||
|
|
8014b279fe | ||
|
|
f4bde57294 | ||
|
|
2e5ff07824 | ||
|
|
7accb42793 | ||
|
|
9229e7f686 | ||
|
|
b570b9c4c1 | ||
|
|
ed78261aad | ||
|
|
363ca9c6e1 | ||
|
|
bafd3c384c | ||
|
|
3b830abe07 | ||
|
|
1787e22b69 | ||
|
|
f105133959 | ||
|
|
aff0e46d23 | ||
|
|
7e4aafcb77 | ||
|
|
643d5408cd | ||
|
|
2a2af3ba9c | ||
|
|
8d4e4a1228 | ||
|
|
84068c8081 | ||
|
|
e1185b9a96 | ||
|
|
f390448c24 | ||
|
|
70943c523c | ||
|
|
dcb79e70d3 | ||
|
|
cc72cdbe16 | ||
|
|
3fd1817e1e | ||
|
|
b483c13f81 | ||
|
|
bde7a9fbf9 | ||
|
|
5fd93ee9c8 | ||
|
|
9ac07fd98a | ||
|
|
9c975ed822 | ||
|
|
138bf7da00 | ||
|
|
3e7fe517f3 | ||
|
|
4f960d09b3 |
@@ -0,0 +1,16 @@
|
|||||||
|
name: 'Check if branch is shorter than 52 chars'
|
||||||
|
on: pull_request
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
branch-naming-rules:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
# echo "branches that are longer than 51 chars can't be parsed by kubernetes to create previews. Each app has prefix of it's name like: 'governance-' (12 chars), what leaves 51 max branch length"
|
||||||
|
# current parsable length: $( git rev-parse --abbrev-ref HEAD | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | wc -c)
|
||||||
|
- uses: deepakputhraya/action-branch-name@master
|
||||||
|
with:
|
||||||
|
# regex: '([a-z])+\/([a-z])+' # Regex the branch should match. This example enforces grouping
|
||||||
|
# allowed_prefixes: 'feature,stable,fix' # All branches should start with the given prefix
|
||||||
|
# ignore: master,develop # Ignore exactly matching branch names from convention
|
||||||
|
min_length: 1 # Min length of the branch name
|
||||||
|
max_length: 51 # Max length of the branch name
|
||||||
@@ -4,14 +4,54 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release/*
|
- release/*
|
||||||
|
- develop
|
||||||
pull_request:
|
pull_request:
|
||||||
types:
|
types:
|
||||||
- opened
|
- opened
|
||||||
- reopened
|
|
||||||
- synchronize
|
|
||||||
- ready_for_review
|
- ready_for_review
|
||||||
|
- reopened
|
||||||
|
- edited
|
||||||
|
- synchronize
|
||||||
jobs:
|
jobs:
|
||||||
|
node-modules:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
name: 'Cache yarn modules'
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
id: cache
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||||
|
# comment out "restore-keys" if you need to rebuild yarn from 0
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.os }}-cache-node-modules-
|
||||||
|
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||||
|
cache: yarn
|
||||||
|
|
||||||
|
- name: yarn install
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
run: yarn install --pure-lockfile
|
||||||
|
|
||||||
|
lint-pr-title:
|
||||||
|
needs: node-modules
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
name: Verify PR title
|
||||||
|
uses: ./.github/workflows/lint-pr.yml
|
||||||
|
secrets: inherit
|
||||||
|
|
||||||
lint-test-build:
|
lint-test-build:
|
||||||
|
timeout-minutes: 60
|
||||||
|
needs: node-modules
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
name: '(CI) lint + unit test + build'
|
name: '(CI) lint + unit test + build'
|
||||||
steps:
|
steps:
|
||||||
@@ -27,8 +67,11 @@ jobs:
|
|||||||
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|
||||||
- name: Install root dependencies
|
- name: Cache node modules
|
||||||
run: yarn install --frozen-lockfile
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||||
|
|
||||||
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
- name: Derive appropriate SHAs for base and head for `nx affected` commands
|
||||||
uses: nrwl/nx-set-shas@v3
|
uses: nrwl/nx-set-shas@v3
|
||||||
@@ -48,7 +91,7 @@ jobs:
|
|||||||
run: yarn nx affected:test
|
run: yarn nx affected:test
|
||||||
|
|
||||||
- name: Build affected
|
- name: Build affected
|
||||||
run: yarn nx affected:build
|
run: yarn nx affected:build || (yarn install && yarn nx affected:build)
|
||||||
|
|
||||||
# See affected apps
|
# See affected apps
|
||||||
- name: See affected apps
|
- name: See affected apps
|
||||||
@@ -62,19 +105,44 @@ jobs:
|
|||||||
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
||||||
echo -n "Affected projects: $affected"
|
echo -n "Affected projects: $affected"
|
||||||
|
|
||||||
|
branch_slug="$(echo ${{ github.head_ref || github.ref_name }} | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | cut -c 1-50 )"
|
||||||
projects_e2e=""
|
projects_e2e=""
|
||||||
if [[ $affected == *"governance"* ]]; then projects_e2e+='"governance-e2e" '; fi
|
preview_governance="not deployed"
|
||||||
if [[ $affected == *"trading"* ]]; then projects_e2e+='"trading-e2e" '; fi
|
preview_trading="not deployed"
|
||||||
if [[ $affected == *"explorer"* ]]; then projects_e2e+='"explorer-e2e" '; fi
|
preview_explorer="not deployed"
|
||||||
if [[ -z "$projects_e2e" ]]; then projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '; fi
|
if [[ -z "$projects_e2e" ]]; then
|
||||||
|
projects_e2e+='"governance-e2e" "trading-e2e" "explorer-e2e" '
|
||||||
|
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||||
|
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||||
|
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||||
|
else
|
||||||
|
if [[ $affected == *"governance"* ]]; then
|
||||||
|
projects_e2e+='"governance-e2e" '
|
||||||
|
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
||||||
|
fi
|
||||||
|
if [[ $affected == *"trading"* ]]; then
|
||||||
|
projects_e2e+='"trading-e2e" '
|
||||||
|
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
||||||
|
fi
|
||||||
|
if [[ $affected == *"explorer"* ]]; then
|
||||||
|
projects_e2e+='"explorer-e2e" '
|
||||||
|
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
||||||
|
fi
|
||||||
|
fi
|
||||||
projects_e2e=${projects_e2e%?}
|
projects_e2e=${projects_e2e%?}
|
||||||
projects_e2e=[${projects_e2e// /,}]
|
projects_e2e=[${projects_e2e// /,}]
|
||||||
echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV
|
echo PROJECTS_E2E=$projects_e2e >> $GITHUB_ENV
|
||||||
echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV
|
echo PROJECTS=$(echo $projects_e2e | sed 's|-e2e||g') >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_GOVERNANCE=$preview_governance >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_TRADING=$preview_trading >> $GITHUB_ENV
|
||||||
|
echo PREVIEW_EXPLORER=$preview_explorer >> $GITHUB_ENV
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
projects: ${{ env.PROJECTS }}
|
projects: ${{ env.PROJECTS }}
|
||||||
projects-e2e: ${{ env.PROJECTS_E2E }}
|
projects-e2e: ${{ env.PROJECTS_E2E }}
|
||||||
|
preview_governance: ${{ env.PREVIEW_GOVERNANCE }}
|
||||||
|
preview_trading: ${{ env.PREVIEW_TRADING }}
|
||||||
|
preview_explorer: ${{ env.PREVIEW_EXPLORER }}
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
needs: lint-test-build
|
needs: lint-test-build
|
||||||
@@ -95,6 +163,39 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
projects: ${{ needs.lint-test-build.outputs.projects }}
|
projects: ${{ needs.lint-test-build.outputs.projects }}
|
||||||
|
|
||||||
|
dist-check:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs:
|
||||||
|
- publish-dist
|
||||||
|
- lint-test-build
|
||||||
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
|
name: '(CD) comment preview links'
|
||||||
|
steps:
|
||||||
|
- name: Find Comment
|
||||||
|
uses: peter-evans/find-comment@v2
|
||||||
|
id: fc
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body-includes: Previews
|
||||||
|
|
||||||
|
- name: Create comment
|
||||||
|
uses: peter-evans/create-or-update-comment@v3
|
||||||
|
if: ${{ steps.fc.outputs.comment-id == 0 }}
|
||||||
|
with:
|
||||||
|
issue-number: ${{ github.event.pull_request.number }}
|
||||||
|
body: |
|
||||||
|
Previews:
|
||||||
|
* governance: ${{ needs.lint-test-build.outputs.preview_governance }}
|
||||||
|
* explorer: ${{ needs.lint-test-build.outputs.preview_explorer }}
|
||||||
|
* trading: ${{ needs.lint-test-build.outputs.preview_trading }}
|
||||||
|
|
||||||
|
cypress-check:
|
||||||
|
name: '(CI) cypress - check'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: cypress
|
||||||
|
steps:
|
||||||
|
- run: echo Done!
|
||||||
|
|
||||||
# Report single result at the end, to avoid mess with required checks in PR
|
# Report single result at the end, to avoid mess with required checks in PR
|
||||||
cypress-result:
|
cypress-result:
|
||||||
if: ${{ always() }}
|
if: ${{ always() }}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ jobs:
|
|||||||
project: ${{ fromJSON(inputs.projects) }}
|
project: ${{ fromJSON(inputs.projects) }}
|
||||||
name: ${{ matrix.project }}
|
name: ${{ matrix.project }}
|
||||||
runs-on: self-hosted-runner
|
runs-on: self-hosted-runner
|
||||||
timeout-minutes: 30
|
timeout-minutes: 40
|
||||||
steps:
|
steps:
|
||||||
# Checks if skip cache was requested
|
# Checks if skip cache was requested
|
||||||
- name: Set skip-nx-cache flag
|
- name: Set skip-nx-cache flag
|
||||||
@@ -93,3 +93,9 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: logs-${{ matrix.project }}
|
name: logs-${{ matrix.project }}
|
||||||
path: /home/runner/.vegacapsule/testnet/logs
|
path: /home/runner/.vegacapsule/testnet/logs
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
if: ${{ failure() }}
|
||||||
|
with:
|
||||||
|
name: test-report-${{ matrix.project }}
|
||||||
|
path: frontend-monorepo/apps/trading-e2e/cypress/reports
|
||||||
|
|||||||
@@ -2,15 +2,11 @@
|
|||||||
name: Verify PR title
|
name: Verify PR title
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
workflow_call:
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- ready_for_review
|
|
||||||
- reopened
|
|
||||||
- edited
|
|
||||||
- synchronize
|
|
||||||
jobs:
|
jobs:
|
||||||
lint_pr:
|
lint_pr:
|
||||||
|
timeout-minutes: 10
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@@ -23,8 +19,11 @@ jobs:
|
|||||||
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|
||||||
- name: Install root dependencies
|
- name: Cache node modules
|
||||||
run: yarn install --frozen-lockfile
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||||
|
|
||||||
- name: Check PR title
|
- name: Check PR title
|
||||||
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js
|
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --config ./commitlint.config-ci.js
|
||||||
@@ -15,6 +15,7 @@ jobs:
|
|||||||
app: ${{ fromJSON(inputs.projects) }}
|
app: ${{ fromJSON(inputs.projects) }}
|
||||||
name: ${{ matrix.app }}
|
name: ${{ matrix.app }}
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
timeout-minutes: 25
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code
|
- name: Check out code
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -36,66 +37,131 @@ jobs:
|
|||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
- name: Setup node
|
||||||
- name: Check node version
|
uses: actions/setup-node@v3
|
||||||
id: tags
|
with:
|
||||||
run: |
|
node-version-file: '.nvmrc'
|
||||||
nodeVersion=$(cat .nvmrc | head -n 1)
|
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||||
echo ::set-output name=nodeVersion::${nodeVersion}
|
cache: yarn
|
||||||
|
|
||||||
|
- name: Cache node modules
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-cache-node-modules-${{ hashFiles('yarn.lock') }}
|
||||||
|
|
||||||
|
# https://docs.github.com/en/actions/learn-github-actions/contexts
|
||||||
|
- name: Define variables
|
||||||
|
run: |
|
||||||
|
envName=''
|
||||||
|
dockerfile="dist.Dockerfile"
|
||||||
if [[ "${{ github.event_name }}" = "push" ]]; then
|
if [[ "${{ github.event_name }}" = "push" ]]; then
|
||||||
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
|
domain="vega.rocks"
|
||||||
bucketName="${{ github.event.repository.name }}-$envName"
|
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
|
||||||
echo ::set-output name=bucketName::${bucketName}
|
envName="$(echo ${{ github.ref }} | rev | cut -d '/' -f 1 | rev)"
|
||||||
echo ::set-output name=envName::${envName}
|
if [[ "${{ github.ref }}" =~ .*mainnet.* ]]; then
|
||||||
|
domain="vega.community"
|
||||||
|
if [[ "${{ matrix.app }}" = "trading" ]]; then
|
||||||
|
dockerfile="ipfs.Dockerfile"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
||||||
|
envName="stagnet1"
|
||||||
|
fi
|
||||||
|
bucketName="${{ matrix.app }}.${envName}.${domain}"
|
||||||
|
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
|
||||||
fi
|
fi
|
||||||
|
nodeVersion=$(cat .nvmrc | head -n 1)
|
||||||
|
echo ENV_NAME=${envName} >> $GITHUB_ENV
|
||||||
|
echo NODE_VERSION=${nodeVersion} >> $GITHUB_ENV
|
||||||
|
echo DOCKERFILE=docker/${dockerfile} >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Build local dist
|
||||||
|
if: ${{ env.DOCKERFILE != 'docker/ipfs.Dockerfile' }}
|
||||||
|
run: |
|
||||||
|
flags=""
|
||||||
|
if [[ ! -z "${{ env.ENV_NAME }}" ]]; then
|
||||||
|
if [[ "${{ env.ENV_NAME }}" != "ops-vega" ]]; then
|
||||||
|
flags="--env=${{ env.ENV_NAME }}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "${{ matrix.app }}" = "trading" ]; then
|
||||||
|
yarn nx export trading $flags || (yarn install && yarn nx export trading $flags)
|
||||||
|
DIST_LOCATION=dist/apps/trading/exported
|
||||||
|
else
|
||||||
|
yarn nx build ${{ matrix.app }} $flags || (yarn install && yarn nx build ${{ matrix.app }} $flags)
|
||||||
|
DIST_LOCATION=dist/apps/${{ matrix.app }}
|
||||||
|
fi
|
||||||
|
mv $DIST_LOCATION dist-result
|
||||||
|
tree dist-result
|
||||||
|
|
||||||
- name: Build and export to local Docker
|
- name: Build and export to local Docker
|
||||||
id: docker_build
|
id: docker_build
|
||||||
|
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
with:
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ env.DOCKERFILE }}
|
||||||
load: true
|
load: true
|
||||||
build-args: |
|
build-args: |
|
||||||
APP=${{ matrix.app }}
|
APP=${{ matrix.app }}
|
||||||
NODE_VERSION=${{ steps.tags.outputs.nodeVersion }}
|
NODE_VERSION=${{ env.NODE_VERSION }}
|
||||||
ENV_NAME=${{ steps.tags.outputs.envName || '' }}
|
ENV_NAME=${{ env.ENV_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
|
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
|
||||||
|
|
||||||
|
- name: Image digest
|
||||||
|
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
|
||||||
|
run: echo ${{ steps.docker_build.outputs.digest }}
|
||||||
|
|
||||||
- name: Sanity check docker image
|
- name: Sanity check docker image
|
||||||
|
if: ${{ github.event_name == 'pull_request' || ( env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' ) }}
|
||||||
run: |
|
run: |
|
||||||
echo "Check ipfs-hash"
|
echo "Check ipfs-hash"
|
||||||
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat ipfs-hash
|
if [[ "${{ env.DOCKERFILE }}" = "docker/ipfs.Dockerfile" ]]; then
|
||||||
|
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local cat /ipfs-hash
|
||||||
|
fi
|
||||||
|
|
||||||
echo "List html directory"
|
echo "List html directory"
|
||||||
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local ls -lah
|
docker run --rm ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local sh -c 'apk add --update tree; tree .'
|
||||||
|
|
||||||
echo "Copy dist to local filesystem"
|
- name: Copy dist to local filesystem
|
||||||
|
if: ${{ env.DOCKERFILE == 'docker/ipfs.Dockerfile' && github.event_name == 'push' }}
|
||||||
|
run: |
|
||||||
docker create --name=dist ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
|
docker create --name=dist ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:local
|
||||||
docker cp dist:/usr/share/nginx/html dist
|
docker cp dist:/usr/share/nginx/html dist
|
||||||
|
|
||||||
echo "Check local dist"
|
echo "check local dist files"
|
||||||
ls -al dist
|
tree dist/html
|
||||||
|
mv dist/html dist-result
|
||||||
|
|
||||||
- name: Publish dist as docker image
|
- name: Publish dist as docker image
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
with:
|
with:
|
||||||
|
context: .
|
||||||
|
file: ${{ env.DOCKERFILE }}
|
||||||
push: true
|
push: true
|
||||||
build-args: |
|
build-args: |
|
||||||
APP=${{ matrix.app }}
|
APP=${{ matrix.app }}
|
||||||
NODE_VERSION=${{ steps.tags.outputs.nodeVersion }}
|
NODE_VERSION=${{ env.NODE_VERSION }}
|
||||||
|
ENV_NAME=${{ env.ENV_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:${{ github.event.pull_request.head.sha || github.sha }}
|
ghcr.io/vegaprotocol/frontend/${{ matrix.app }}:${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
|
||||||
# - uses: shallwefootball/s3-upload-action@master
|
# bucket creation in github.com/vegaprotocol/terraform//frontend
|
||||||
# if: ${{ github.event_name == 'push' }}
|
- name: Publish dist to s3
|
||||||
# name: Upload dist S3
|
uses: jakejarvis/s3-sync-action@master
|
||||||
# with:
|
if: ${{ github.event_name == 'push' }}
|
||||||
# aws_key_id: ${{ secrets.AWS_KEY_ID }}
|
with:
|
||||||
# aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
|
args: --acl private --follow-symlinks --delete
|
||||||
# aws_bucket: ${{ steps.tags.outputs.bucketName }}
|
env:
|
||||||
# source_dir: 'dist'
|
AWS_S3_BUCKET: ${{ env.BUCKET_NAME }}
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
AWS_REGION: 'eu-west-1'
|
||||||
|
SOURCE_DIR: 'dist-result'
|
||||||
|
|
||||||
- name: Add preview label
|
- name: Add preview label
|
||||||
uses: actions-ecosystem/action-add-labels@v1
|
uses: actions-ecosystem/action-add-labels@v1
|
||||||
@@ -103,6 +169,3 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
labels: ${{ matrix.app }}-preview
|
labels: ${{ matrix.app }}-preview
|
||||||
number: ${{ github.event.number }}
|
number: ${{ github.event.number }}
|
||||||
|
|
||||||
- name: Image digest
|
|
||||||
run: echo ${{ steps.docker_build.outputs.digest }}
|
|
||||||
|
|||||||
@@ -46,3 +46,6 @@ cypress.env.json
|
|||||||
|
|
||||||
# Next.js
|
# Next.js
|
||||||
.next
|
.next
|
||||||
|
|
||||||
|
#cypress
|
||||||
|
/apps/trading-e2e/cypress/reports/
|
||||||
|
|||||||
@@ -7,5 +7,4 @@ __generated___
|
|||||||
|
|
||||||
apps/static/src/assets/devnet-tranches.json
|
apps/static/src/assets/devnet-tranches.json
|
||||||
apps/static/src/assets/mainnet-tranches.json
|
apps/static/src/assets/mainnet-tranches.json
|
||||||
apps/static/src/assets/stagnet3-tranches.json
|
|
||||||
apps/static/src/assets/testnet-tranches.json
|
apps/static/src/assets/testnet-tranches.json
|
||||||
|
|||||||
Vendored
+1
-19
@@ -1,20 +1,2 @@
|
|||||||
@Library('vega-shared-library') _
|
@Library('vega-shared-library') _
|
||||||
|
runApprobation ignoreFailure: false, frontendBranch: env.BRANCH_NAME, type: 'frontend'
|
||||||
def commitHash = 'UNKNOWN'
|
|
||||||
|
|
||||||
pipeline {
|
|
||||||
agent any
|
|
||||||
options {
|
|
||||||
skipDefaultCheckout true
|
|
||||||
parallelsAlwaysFailFast()
|
|
||||||
}
|
|
||||||
stages {
|
|
||||||
stage('approbation') {
|
|
||||||
steps {
|
|
||||||
sh 'printenv'
|
|
||||||
checkout scm
|
|
||||||
runApprobation ignoreFailure: false, frontendBranch: env.BRANCH_NAME, type: 'frontend'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ Run `nx serve my-app` for a dev server. Navigate to the port specified in `app/<
|
|||||||
In order to generate the schemas for your GraphQL queries, you can run `GRAPHQL_SCHEMA_PATH=[YOUR SCHEMA FILE / API URL HERE] nx run types:generate`.
|
In order to generate the schemas for your GraphQL queries, you can run `GRAPHQL_SCHEMA_PATH=[YOUR SCHEMA FILE / API URL HERE] nx run types:generate`.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
export GRAPHQL_SCHEMA_PATH=https://api.n11.testnet.vega.xyz/graphql
|
export GRAPHQL_SCHEMA_PATH=https://api.n07.testnet.vega.xyz/graphql
|
||||||
yarn nx run types:generate
|
yarn nx run types:generate
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
||||||
NX_TENDERMINT_URL=http://localhost:26617
|
NX_TENDERMINT_URL=http://localhost:26617
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
||||||
NX_VEGA_URL=http://localhost:3028/query
|
NX_VEGA_URL=http://localhost:3008/graphql
|
||||||
NX_VEGA_ENV=CUSTOM
|
NX_VEGA_ENV=CUSTOM
|
||||||
NX_VEGA_CONFIG_URL=
|
NX_VEGA_CONFIG_URL=
|
||||||
|
|
||||||
@@ -18,4 +18,4 @@ NX_EXPLORER_PARTIES=1
|
|||||||
NX_EXPLORER_VALIDATORS=1
|
NX_EXPLORER_VALIDATORS=1
|
||||||
|
|
||||||
CYPRESS_VEGA_WALLET_API_TOKEN=
|
CYPRESS_VEGA_WALLET_API_TOKEN=
|
||||||
CYPRESS_VEGA_URL=http://localhost:3028/query
|
CYPRESS_VEGA_URL=http://localhost:3008/graphql
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
||||||
NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/
|
NX_TENDERMINT_URL=https://mainnet-observer-proxy01.ops.vega.xyz/
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://mainnet-observer-proxy01.ops.vega.xyz/websocket
|
||||||
NX_VEGA_URL=https://api.vega.xyz/query
|
NX_VEGA_URL=https://api.vega.community/graphql
|
||||||
NX_VEGA_ENV=MAINNET
|
NX_VEGA_ENV=MAINNET
|
||||||
NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest
|
NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
# App configuration variables
|
|
||||||
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
|
||||||
NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n00.stagnet3.vega.xyz/websocket
|
|
||||||
NX_VEGA_URL=https://api.stagnet3.vega.xyz/graphql
|
|
||||||
NX_VEGA_ENV=STAGNET3
|
|
||||||
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
|
|
||||||
|
|
||||||
# App flags
|
|
||||||
NX_EXPLORER_ASSETS=1
|
|
||||||
NX_EXPLORER_GENESIS=1
|
|
||||||
NX_EXPLORER_GOVERNANCE=1
|
|
||||||
NX_EXPLORER_MARKETS=1
|
|
||||||
NX_EXPLORER_ORACLES=1
|
|
||||||
NX_EXPLORER_TXS_LIST=0
|
|
||||||
NX_EXPLORER_NETWORK_PARAMETERS=1
|
|
||||||
NX_EXPLORER_PARTIES=1
|
|
||||||
NX_EXPLORER_VALIDATORS=1
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
|
||||||
NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm
|
NX_TENDERMINT_URL=https://tm.n07.testnet.vega.xyz/tm
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://lb.testnet.vega.xyz/tm/websocket
|
||||||
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
|
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
|
||||||
NX_VEGA_ENV=TESTNET
|
NX_VEGA_ENV=TESTNET
|
||||||
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
|
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,11 @@ module.exports = defineConfig({
|
|||||||
chromeWebSecurity: false,
|
chromeWebSecurity: false,
|
||||||
viewportWidth: 1440,
|
viewportWidth: 1440,
|
||||||
viewportHeight: 900,
|
viewportHeight: 900,
|
||||||
|
testIsolation: false,
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
environment: 'CUSTOM',
|
environment: 'CUSTOM',
|
||||||
networkQueryUrl: 'http://localhost:3028/query',
|
networkQueryUrl: 'http://localhost:3008/graphql',
|
||||||
ethUrl: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
|
ethUrl: 'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
|
||||||
commitHash: 'dev',
|
commitHash: 'dev',
|
||||||
tsConfig: 'tsconfig.json',
|
tsConfig: 'tsconfig.json',
|
||||||
|
|||||||
@@ -10,6 +10,8 @@
|
|||||||
"governance.proposal.updateMarket.minVoterBalance",
|
"governance.proposal.updateMarket.minVoterBalance",
|
||||||
"governance.proposal.updateNetParam.minProposerBalance",
|
"governance.proposal.updateNetParam.minProposerBalance",
|
||||||
"governance.proposal.updateNetParam.minVoterBalance",
|
"governance.proposal.updateNetParam.minVoterBalance",
|
||||||
|
"governance.proposal.updateAsset.minProposerBalance",
|
||||||
|
"governance.proposal.updateAsset.minVoterBalance",
|
||||||
"reward.staking.delegation.maxPayoutPerEpoch",
|
"reward.staking.delegation.maxPayoutPerEpoch",
|
||||||
"reward.staking.delegation.maxPayoutPerParticipant",
|
"reward.staking.delegation.maxPayoutPerParticipant",
|
||||||
"reward.staking.delegation.minimumValidatorStake",
|
"reward.staking.delegation.minimumValidatorStake",
|
||||||
@@ -19,9 +21,6 @@
|
|||||||
"validators.delegation.minAmount"
|
"validators.delegation.minAmount"
|
||||||
],
|
],
|
||||||
"fiveDecimal": [
|
"fiveDecimal": [
|
||||||
"governance.proposal.updateAsset.minProposerBalance",
|
|
||||||
"governance.proposal.updateAsset.minVoterBalance",
|
|
||||||
"governance.proposal.updateAsset.requiredParticipation",
|
|
||||||
"market.fee.factors.infrastructureFee",
|
"market.fee.factors.infrastructureFee",
|
||||||
"market.fee.factors.makerFee",
|
"market.fee.factors.makerFee",
|
||||||
"market.liquidity.bondPenaltyParameter",
|
"market.liquidity.bondPenaltyParameter",
|
||||||
@@ -77,6 +76,7 @@
|
|||||||
"governance.proposal.updateNetParam.requiredMajority",
|
"governance.proposal.updateNetParam.requiredMajority",
|
||||||
"governance.proposal.updateNetParam.requiredParticipation",
|
"governance.proposal.updateNetParam.requiredParticipation",
|
||||||
"governance.proposal.updateMarket.minProposerEquityLikeShare",
|
"governance.proposal.updateMarket.minProposerEquityLikeShare",
|
||||||
|
"governance.proposal.updateAsset.requiredParticipation",
|
||||||
"validators.vote.required"
|
"validators.vote.required"
|
||||||
],
|
],
|
||||||
"duration": [
|
"duration": [
|
||||||
|
|||||||
@@ -9,21 +9,22 @@ context('Home Page', function () {
|
|||||||
it('should show connected environment stats', function () {
|
it('should show connected environment stats', function () {
|
||||||
const statTitles = {
|
const statTitles = {
|
||||||
0: 'Status',
|
0: 'Status',
|
||||||
1: 'Block height',
|
1: 'Epoch',
|
||||||
2: 'Uptime',
|
2: 'Block height',
|
||||||
3: 'Total nodes',
|
3: 'Uptime',
|
||||||
4: 'Total staked',
|
4: 'Total nodes',
|
||||||
5: 'Backlog',
|
5: 'Total staked',
|
||||||
6: 'Trades / second',
|
6: 'Backlog',
|
||||||
7: 'Orders / block',
|
7: 'Trades / second',
|
||||||
8: 'Orders / second',
|
8: 'Orders / block',
|
||||||
9: 'Transactions / block',
|
9: 'Orders / second',
|
||||||
10: 'Block time',
|
10: 'Transactions / block',
|
||||||
11: 'Time',
|
11: 'Block time',
|
||||||
12: 'App',
|
12: 'Time',
|
||||||
13: 'Tendermint',
|
13: 'App',
|
||||||
14: 'Up since',
|
14: 'Tendermint',
|
||||||
15: 'Chain ID',
|
15: 'Up since',
|
||||||
|
16: 'Chain ID',
|
||||||
};
|
};
|
||||||
|
|
||||||
cy.get('[data-testid="stats-title"]')
|
cy.get('[data-testid="stats-title"]')
|
||||||
@@ -31,42 +32,13 @@ context('Home Page', function () {
|
|||||||
cy.wrap($list).should('contain.text', statTitles[index]);
|
cy.wrap($list).should('contain.text', statTitles[index]);
|
||||||
})
|
})
|
||||||
.then(($list) => {
|
.then(($list) => {
|
||||||
cy.wrap($list).should('have.length', 16);
|
cy.wrap($list).should('have.length', 17);
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.get(statsValue).eq(0).should('contain.text', 'CONNECTED');
|
|
||||||
cy.get(statsValue).eq(1).should('not.be.empty');
|
|
||||||
cy.get(statsValue)
|
|
||||||
.eq(2)
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d+d \d+h \d+m \d+s/i);
|
|
||||||
cy.get(statsValue).eq(3).should('contain.text', '2');
|
|
||||||
cy.get(statsValue)
|
|
||||||
.eq(4)
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d+\.\d\d(?!\d)/i);
|
|
||||||
cy.get(statsValue).eq(5).should('contain.text', '0');
|
|
||||||
cy.get(statsValue).eq(6).should('contain.text', '0');
|
|
||||||
cy.get(statsValue).eq(7).should('contain.text', '0');
|
|
||||||
cy.get(statsValue).eq(8).should('contain.text', '0');
|
|
||||||
cy.get(statsValue).eq(9).should('not.be.empty');
|
|
||||||
cy.get(statsValue).eq(10).should('not.be.empty');
|
|
||||||
cy.get(statsValue).eq(11).should('not.be.empty');
|
|
||||||
cy.get(statsValue)
|
|
||||||
.eq(12)
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /v\d+\.\d+\.\d+/i);
|
|
||||||
cy.get(statsValue)
|
|
||||||
.eq(13)
|
|
||||||
.invoke('text')
|
|
||||||
.should('match', /\d+\.\d+\.\d+/i);
|
|
||||||
cy.get(statsValue).eq(14).should('not.be.empty');
|
|
||||||
cy.get(statsValue).eq(15).should('not.be.empty');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Block height should be updating', function () {
|
it('Block height should be updating', function () {
|
||||||
cy.get(statsValue)
|
cy.get(statsValue)
|
||||||
.eq(1)
|
.eq(2)
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((blockHeightTxt) => {
|
.then((blockHeightTxt) => {
|
||||||
cy.get(statsValue)
|
cy.get(statsValue)
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ context('Network parameters page', { tags: '@smoke' }, function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should list each network parameter displayed as a currency value with four decimals - in the correct format', function () {
|
it.skip('should list each network parameter displayed as a currency value with four decimals - in the correct format', function () {
|
||||||
cy.get_network_parameters().then((network_parameters) => {
|
cy.get_network_parameters().then((network_parameters) => {
|
||||||
network_parameters = Object.entries(network_parameters);
|
network_parameters = Object.entries(network_parameters);
|
||||||
network_parameters.forEach((network_parameter) => {
|
network_parameters.forEach((network_parameter) => {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const customNodeBtn = 'custom-node';
|
|||||||
context.skip('Node switcher', { tags: '@regression' }, function () {
|
context.skip('Node switcher', { tags: '@regression' }, function () {
|
||||||
beforeEach('visit home page', function () {
|
beforeEach('visit home page', function () {
|
||||||
cy.intercept('GET', 'https://static.vega.xyz/assets/capsule-network.json', {
|
cy.intercept('GET', 'https://static.vega.xyz/assets/capsule-network.json', {
|
||||||
hosts: ['http://localhost:3028/query'],
|
hosts: ['http://localhost:3008/graphql'],
|
||||||
}).as('nodeData');
|
}).as('nodeData');
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
cy.wait('@nodeData');
|
cy.wait('@nodeData');
|
||||||
|
|||||||
@@ -219,7 +219,7 @@ context.skip('Parties page', { tags: '@regression' }, function () {
|
|||||||
balance type asset {id symbol decimals}}}}}}}}';
|
balance type asset {id symbol decimals}}}}}}}}';
|
||||||
cy.request({
|
cy.request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: `http://localhost:3028/query`,
|
url: `http://localhost:3008/graphql`,
|
||||||
body: {
|
body: {
|
||||||
query: mutation,
|
query: mutation,
|
||||||
},
|
},
|
||||||
|
|||||||
+13
-8
@@ -1,13 +1,18 @@
|
|||||||
NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
|
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n00.stagnet3.vega.xyz/websocket
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml
|
|
||||||
NX_VEGA_NETWORKS='{"STAGNET1":"https://stagnet1.token.vega.xyz", "STAGNET3":"https://stagnet3.explorer.vega.xyz","VALIDATOR_TESTNET":"https://validator-testnet.fairground.wtf","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}'
|
|
||||||
NX_VEGA_ENV=STAGNET3
|
|
||||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
|
||||||
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
||||||
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml
|
||||||
|
NX_VEGA_ENV=STAGNET1
|
||||||
|
NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz
|
||||||
|
NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz
|
||||||
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
|
NX_TENDERMINT_URL=https://tm.n01.stagnet1.vega.xyz
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet1.vega.xyz/websocket
|
||||||
|
NX_BLOCK_EXPLORER=https://be.stagnet1.vega.xyz/rest
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
|
NX_ORACLE_PROOFS_URL=https://raw.githubusercontent.com/vegaprotocol/well-known/main/__generated__/oracle-proofs.json
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_VEGA_GOVERNANCE_URL=https://stagnet1.token.vega.xyz
|
||||||
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.jsoo
|
||||||
|
|
||||||
# App flags
|
# App flags
|
||||||
NX_EXPLORER_ASSETS=1
|
NX_EXPLORER_ASSETS=1
|
||||||
|
|||||||
@@ -3,15 +3,8 @@ NX_TENDERMINT_URL=http://localhost:26617
|
|||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
||||||
NX_VEGA_ENV=CUSTOM
|
NX_VEGA_ENV=CUSTOM
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/main/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/test/announcements.json
|
||||||
|
NX_VEGA_EXPLORER_URL=/
|
||||||
|
|
||||||
# App flags
|
# App flags
|
||||||
NX_EXPLORER_ASSETS=1
|
|
||||||
NX_EXPLORER_GENESIS=1
|
|
||||||
NX_EXPLORER_GOVERNANCE=1
|
|
||||||
NX_EXPLORER_MARKETS=1
|
|
||||||
NX_EXPLORER_ORACLES=1
|
|
||||||
NX_EXPLORER_TXS_LIST=0
|
NX_EXPLORER_TXS_LIST=0
|
||||||
NX_EXPLORER_NETWORK_PARAMETERS=1
|
|
||||||
NX_EXPLORER_PARTIES=1
|
|
||||||
NX_EXPLORER_VALIDATORS=1
|
|
||||||
|
|||||||
@@ -9,3 +9,4 @@ NX_VEGA_GOVERNANCE_URL=https://dev.token.vega.xyz
|
|||||||
NX_VEGA_URL=https://api.devnet1.vega.xyz/graphql
|
NX_VEGA_URL=https://api.devnet1.vega.xyz/graphql
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/devnet1/vegawallet-devnet1.toml
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
||||||
|
NX_VEGA_EXPLORER_URL=/
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=https://be.explorer.vega.xyz
|
NX_TENDERMINT_URL=https://be.vega.community
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.explorer.vega.xyz/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks/master/mainnet1/mainnet1.toml
|
||||||
NX_VEGA_ENV=MAINNET
|
NX_VEGA_ENV=MAINNET
|
||||||
NX_BLOCK_EXPLORER=https://be.explorer.vega.xyz/rest/
|
NX_BLOCK_EXPLORER=https://be.vega.community/rest/
|
||||||
NX_ETHERSCAN_URL=https://etherscan.io
|
NX_ETHERSCAN_URL=https://etherscan.io
|
||||||
NX_VEGA_GOVERNANCE_URL=https://token.vega.xyz
|
NX_VEGA_GOVERNANCE_URL=https://token.vega.xyz
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/mainnet/announcements.json
|
||||||
|
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz/
|
||||||
@@ -1,14 +1 @@
|
|||||||
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
# .env is stagnet1, so there are no overrides required
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
|
||||||
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet1/vegawallet-stagnet1.toml
|
|
||||||
NX_VEGA_ENV=STAGNET1
|
|
||||||
NX_VEGA_EXPLORER_URL=https://stagnet1.explorer.vega.xyz
|
|
||||||
NX_VEGA_TOKEN_URL=https://stagnet1.token.vega.xyz
|
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
|
||||||
NX_TENDERMINT_URL=https://tm.n01.stagnet1.vega.xyz
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet1.vega.xyz/websocket
|
|
||||||
NX_BLOCK_EXPLORER=https://be.stagnet1.vega.xyz/rest
|
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
|
||||||
NX_VEGA_GOVERNANCE_URL=https://stagnet1.token.vega.xyz
|
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.stagnet3.vega.xyz/websocket
|
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml
|
|
||||||
NX_VEGA_ENV=STAGNET3
|
|
||||||
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
|
|
||||||
NX_VEGA_GOVERNANCE_URL=https://stagnet3.token.vega.xyz
|
|
||||||
NX_VEGA_REPO_URL=https://github.com/vegaprotocol/vega-dev-releases/releases/
|
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
|
||||||
@@ -9,3 +9,4 @@ NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
|||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_VEGA_GOVERNANCE_URL=https://token.fairground.wtf
|
NX_VEGA_GOVERNANCE_URL=https://token.fairground.wtf
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
||||||
|
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
|
||||||
@@ -9,5 +9,6 @@ NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/annou
|
|||||||
|
|
||||||
NX_VEGA_GOVERNANCE_URL=https://validator-testnet.governance.vega.xyz
|
NX_VEGA_GOVERNANCE_URL=https://validator-testnet.governance.vega.xyz
|
||||||
NX_TENDERMINT_URL=https://tm-be.validators-testnet.vega.rocks
|
NX_TENDERMINT_URL=https://tm-be.validators-testnet.vega.rocks
|
||||||
NX_BLOCK_EXPLORER=https://be.validators-testnet.vega.rocks/
|
NX_BLOCK_EXPLORER=https://be.validators-testnet.vega.rocks/rest
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega.xyz/websocket
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega.xyz/websocket
|
||||||
|
NX_VEGA_EXPLORER_URL=https://validator-testnet.explorer.vega.xyz/
|
||||||
@@ -4,4 +4,5 @@ NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26607/websocket
|
|||||||
NX_VEGA_ENV=CUSTOM
|
NX_VEGA_ENV=CUSTOM
|
||||||
NX_BLOCK_EXPLORER=
|
NX_BLOCK_EXPLORER=
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/main/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/test/announcements.json
|
||||||
|
NX_VEGA_EXPLORER_URL=/
|
||||||
@@ -35,12 +35,11 @@ Example configurations are provided here:
|
|||||||
- [Devnet](./.env.devnet)
|
- [Devnet](./.env.devnet)
|
||||||
- [Capsule](./.env.capsule)
|
- [Capsule](./.env.capsule)
|
||||||
- [Testnet](./.env.testnet)
|
- [Testnet](./.env.testnet)
|
||||||
- [Stagnet3](./.env.stagnet3)
|
|
||||||
|
|
||||||
For convenience, you can boot the app injecting one of the configurations above by running:
|
For convenience, you can boot the app injecting one of the configurations above by running:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn nx run explorer:serve --env={env} # e.g. stagnet3
|
yarn nx run explorer:serve --env={env} # e.g. stagnet1
|
||||||
```
|
```
|
||||||
|
|
||||||
There are a few different configuration options offered for this app:
|
There are a few different configuration options offered for this app:
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ export type AssetBalanceProps = {
|
|||||||
assetId: string;
|
assetId: string;
|
||||||
price: string;
|
price: string;
|
||||||
showAssetLink?: boolean;
|
showAssetLink?: boolean;
|
||||||
|
showAssetSymbol?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -16,18 +17,21 @@ const AssetBalance = ({
|
|||||||
assetId,
|
assetId,
|
||||||
price,
|
price,
|
||||||
showAssetLink = true,
|
showAssetLink = true,
|
||||||
|
showAssetSymbol = false,
|
||||||
}: AssetBalanceProps) => {
|
}: AssetBalanceProps) => {
|
||||||
const { data: asset } = useAssetDataProvider(assetId);
|
const { data: asset, loading } = useAssetDataProvider(assetId);
|
||||||
|
|
||||||
const label =
|
const label =
|
||||||
asset && asset.decimals
|
!loading && asset && asset.decimals
|
||||||
? addDecimalsFormatNumber(price, asset.decimals)
|
? addDecimalsFormatNumber(price, asset.decimals)
|
||||||
: price;
|
: price;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="inline-block">
|
<div className="inline-block">
|
||||||
<span>{label}</span>{' '}
|
<span>{label}</span>{' '}
|
||||||
{showAssetLink && asset?.id ? <AssetLink assetId={assetId} /> : null}
|
{showAssetLink && asset?.id ? (
|
||||||
|
<AssetLink showAssetSymbol={showAssetSymbol} assetId={assetId} />
|
||||||
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,11 +13,17 @@ const DEFAULT_DECIMALS = 18;
|
|||||||
* the governance asset first, which is set by a network parameter
|
* the governance asset first, which is set by a network parameter
|
||||||
*/
|
*/
|
||||||
const GovernanceAssetBalance = ({ price }: GovernanceAssetBalanceProps) => {
|
const GovernanceAssetBalance = ({ price }: GovernanceAssetBalanceProps) => {
|
||||||
const { data } = useExplorerGovernanceAssetQuery();
|
const { data, loading } = useExplorerGovernanceAssetQuery();
|
||||||
|
|
||||||
if (data && data.networkParameter?.value) {
|
if (!loading && data && data.networkParameter?.value) {
|
||||||
const governanceAssetId = data.networkParameter.value;
|
const governanceAssetId = data.networkParameter.value;
|
||||||
return <AssetBalance price={price} assetId={governanceAssetId} />;
|
return (
|
||||||
|
<AssetBalance
|
||||||
|
price={price}
|
||||||
|
showAssetSymbol={true}
|
||||||
|
assetId={governanceAssetId}
|
||||||
|
/>
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
return (
|
return (
|
||||||
<div className="inline-block">
|
<div className="inline-block">
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { t } from '@vegaprotocol/i18n';
|
|||||||
import { ButtonLink } from '@vegaprotocol/ui-toolkit';
|
import { ButtonLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import { AgGridColumn } from 'ag-grid-react';
|
import { AgGridColumn } from 'ag-grid-react';
|
||||||
import { AgGridDynamic as AgGrid } from '@vegaprotocol/datagrid';
|
import { AgGridLazy as AgGrid } from '@vegaprotocol/datagrid';
|
||||||
import type { VegaICellRendererParams } from '@vegaprotocol/datagrid';
|
import type { VegaICellRendererParams } from '@vegaprotocol/datagrid';
|
||||||
import { useRef, useLayoutEffect } from 'react';
|
import { useRef, useLayoutEffect } from 'react';
|
||||||
import { BREAKPOINT_MD } from '../../config/breakpoints';
|
import { BREAKPOINT_MD } from '../../config/breakpoints';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const Footer = () => {
|
|||||||
const [nodeSwitcherOpen, setNodeSwitcherOpen] = useState(false);
|
const [nodeSwitcherOpen, setNodeSwitcherOpen] = useState(false);
|
||||||
const { screenSize } = useScreenDimensions();
|
const { screenSize } = useScreenDimensions();
|
||||||
const showFullFeedbackLabel = useMemo(
|
const showFullFeedbackLabel = useMemo(
|
||||||
() => ['lg', 'xl', 'xxl', 'xxxl'].includes(screenSize),
|
() => ['md', 'lg', 'xl', 'xxl', 'xxxl'].includes(screenSize),
|
||||||
[screenSize]
|
[screenSize]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ export const AssetLink = ({
|
|||||||
if (asDialog) {
|
if (asDialog) {
|
||||||
open(assetId, e.target as HTMLElement);
|
open(assetId, e.target as HTMLElement);
|
||||||
} else {
|
} else {
|
||||||
navigate(`${Routes.ASSETS}/${asset?.id}`);
|
navigate(`/${Routes.ASSETS}/${asset?.id}`);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
{...props}
|
{...props}
|
||||||
|
|||||||
@@ -14,11 +14,72 @@ import {
|
|||||||
SettlementAssetInfoPanel,
|
SettlementAssetInfoPanel,
|
||||||
} from '@vegaprotocol/market-info';
|
} from '@vegaprotocol/market-info';
|
||||||
import { MarketInfoTable } from '@vegaprotocol/market-info';
|
import { MarketInfoTable } from '@vegaprotocol/market-info';
|
||||||
import { Link } from 'react-router-dom';
|
import type { DataSourceDefinition } from '@vegaprotocol/types';
|
||||||
|
import isEqual from 'lodash/isEqual';
|
||||||
|
|
||||||
export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
|
export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
|
||||||
if (!market) return null;
|
if (!market) return null;
|
||||||
|
|
||||||
|
const settlementData =
|
||||||
|
market.tradableInstrument.instrument.product.dataSourceSpecForSettlementData
|
||||||
|
.data;
|
||||||
|
const terminationData =
|
||||||
|
market.tradableInstrument.instrument.product
|
||||||
|
.dataSourceSpecForTradingTermination.data;
|
||||||
|
|
||||||
|
const getSigners = (data: DataSourceDefinition) => {
|
||||||
|
if (data.sourceType.__typename === 'DataSourceDefinitionExternal') {
|
||||||
|
const signers = data.sourceType.sourceType.signers || [];
|
||||||
|
|
||||||
|
return signers.map(({ signer }, i) => {
|
||||||
|
return (
|
||||||
|
(signer.__typename === 'ETHAddress' && signer.address) ||
|
||||||
|
(signer.__typename === 'PubKey' && signer.key)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return [];
|
||||||
|
};
|
||||||
|
|
||||||
|
const oraclePanels = isEqual(
|
||||||
|
getSigners(settlementData),
|
||||||
|
getSigners(terminationData)
|
||||||
|
)
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
title: t('Settlement Oracle'),
|
||||||
|
content: (
|
||||||
|
<OracleInfoPanel
|
||||||
|
noBorder={false}
|
||||||
|
market={market}
|
||||||
|
type="settlementData"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('Termination Oracle'),
|
||||||
|
content: (
|
||||||
|
<OracleInfoPanel
|
||||||
|
noBorder={false}
|
||||||
|
market={market}
|
||||||
|
type="termination"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
title: t('Oracle'),
|
||||||
|
content: (
|
||||||
|
<OracleInfoPanel
|
||||||
|
noBorder={false}
|
||||||
|
market={market}
|
||||||
|
type="settlementData"
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const panels = [
|
const panels = [
|
||||||
{
|
{
|
||||||
title: t('Key details'),
|
title: t('Key details'),
|
||||||
@@ -60,9 +121,11 @@ export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
|
|||||||
<>
|
<>
|
||||||
<MarketInfoTable
|
<MarketInfoTable
|
||||||
noBorder={false}
|
noBorder={false}
|
||||||
data={trigger}
|
data={{
|
||||||
|
maxValidPrice: trigger.maxValidPrice,
|
||||||
|
minValidPrice: trigger.minValidPrice,
|
||||||
|
}}
|
||||||
decimalPlaces={market.decimalPlaces}
|
decimalPlaces={market.decimalPlaces}
|
||||||
omits={['referencePrice', '__typename']}
|
|
||||||
/>
|
/>
|
||||||
<MarketInfoTable
|
<MarketInfoTable
|
||||||
noBorder={false}
|
noBorder={false}
|
||||||
@@ -94,25 +157,7 @@ export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
|
|||||||
<LiquidityPriceRangeInfoPanel market={market} noBorder={false} />
|
<LiquidityPriceRangeInfoPanel market={market} noBorder={false} />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
...oraclePanels,
|
||||||
title: t('Oracle'),
|
|
||||||
content: (
|
|
||||||
<OracleInfoPanel noBorder={false} market={market}>
|
|
||||||
<Link
|
|
||||||
className="text-xs hover:underline"
|
|
||||||
to={`/oracles#${market.tradableInstrument.instrument.product.dataSourceSpecForSettlementData.id}`}
|
|
||||||
>
|
|
||||||
{t('View settlement data oracle specification')}
|
|
||||||
</Link>
|
|
||||||
<Link
|
|
||||||
className="text-xs hover:underline"
|
|
||||||
to={`/oracles#${market.tradableInstrument.instrument.product.dataSourceSpecForTradingTermination.id}`}
|
|
||||||
>
|
|
||||||
{t('View termination oracle specification')}
|
|
||||||
</Link>
|
|
||||||
</OracleInfoPanel>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { t } from '@vegaprotocol/i18n';
|
|||||||
import { ButtonLink } from '@vegaprotocol/ui-toolkit';
|
import { ButtonLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import { AgGridColumn } from 'ag-grid-react';
|
import { AgGridColumn } from 'ag-grid-react';
|
||||||
import { AgGridDynamic as AgGrid } from '@vegaprotocol/datagrid';
|
import { AgGridLazy as AgGrid } from '@vegaprotocol/datagrid';
|
||||||
import type {
|
import type {
|
||||||
VegaICellRendererParams,
|
VegaICellRendererParams,
|
||||||
VegaValueGetterParams,
|
VegaValueGetterParams,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import SizeInMarket from '../size-in-market/size-in-market';
|
|||||||
export interface DeterministicOrderDetailsProps {
|
export interface DeterministicOrderDetailsProps {
|
||||||
id: string;
|
id: string;
|
||||||
// Version to fetch, with 0 being 'latest' and 1 being 'first'. Defaults to 0
|
// Version to fetch, with 0 being 'latest' and 1 being 'first'. Defaults to 0
|
||||||
version?: number;
|
version?: number | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const wrapperClasses =
|
export const wrapperClasses =
|
||||||
@@ -28,7 +28,7 @@ export const wrapperClasses =
|
|||||||
*/
|
*/
|
||||||
const DeterministicOrderDetails = ({
|
const DeterministicOrderDetails = ({
|
||||||
id,
|
id,
|
||||||
version = 0,
|
version = null,
|
||||||
}: DeterministicOrderDetailsProps) => {
|
}: DeterministicOrderDetailsProps) => {
|
||||||
const { data, error } = useExplorerDeterministicOrderQuery({
|
const { data, error } = useExplorerDeterministicOrderQuery({
|
||||||
variables: { orderId: id, version },
|
variables: { orderId: id, version },
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export const PageHeader = ({
|
|||||||
copy = false,
|
copy = false,
|
||||||
className,
|
className,
|
||||||
}: PageHeaderProps) => {
|
}: PageHeaderProps) => {
|
||||||
const titleClasses = 'text-4xl xl:text-5xl uppercase font-alpha calt';
|
const titleClasses = 'text-xl uppercase font-alpha calt';
|
||||||
return (
|
return (
|
||||||
<header className={className}>
|
<header className={className}>
|
||||||
<span className={`${titleClasses} block`}>{prefix}</span>
|
<span className={`${titleClasses} block`}>{prefix}</span>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { VoteProgress } from '@vegaprotocol/proposals';
|
|||||||
import type { AgGridReact } from 'ag-grid-react';
|
import type { AgGridReact } from 'ag-grid-react';
|
||||||
import { AgGridColumn } from 'ag-grid-react';
|
import { AgGridColumn } from 'ag-grid-react';
|
||||||
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
import { ExternalLink } from '@vegaprotocol/ui-toolkit';
|
||||||
import { AgGridDynamic as AgGrid } from '@vegaprotocol/datagrid';
|
import { AgGridLazy as AgGrid } from '@vegaprotocol/datagrid';
|
||||||
import type {
|
import type {
|
||||||
VegaICellRendererParams,
|
VegaICellRendererParams,
|
||||||
VegaValueFormatterParams,
|
VegaValueFormatterParams,
|
||||||
@@ -12,7 +12,10 @@ import { useLayoutEffect, useMemo, useRef, useState } from 'react';
|
|||||||
import type { RowClickedEvent } from 'ag-grid-community';
|
import type { RowClickedEvent } from 'ag-grid-community';
|
||||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { NetworkParams, useNetworkParams } from '@vegaprotocol/react-helpers';
|
import {
|
||||||
|
NetworkParams,
|
||||||
|
useNetworkParams,
|
||||||
|
} from '@vegaprotocol/network-parameters';
|
||||||
import { ProposalStateMapping } from '@vegaprotocol/types';
|
import { ProposalStateMapping } from '@vegaprotocol/types';
|
||||||
import BigNumber from 'bignumber.js';
|
import BigNumber from 'bignumber.js';
|
||||||
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
import { DApp, TOKEN_PROPOSAL, useLinks } from '@vegaprotocol/environment';
|
||||||
|
|||||||
+1
-1
@@ -30,7 +30,7 @@ export const BundleExists = ({
|
|||||||
// Note if this is wrong, the wrong decoder will be used which will give incorrect data
|
// Note if this is wrong, the wrong decoder will be used which will give incorrect data
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="w-auto max-w-lg border-2 border-solid border-vega-light-100 dark:border-vega-dark-200 p-5 mt-5">
|
<div className="w-auto h-10 max-w-lg border-2 border-solid border-vega-light-100 dark:border-vega-dark-200 p-5 mt-5">
|
||||||
<IconForBundleStatus status={status} />
|
<IconForBundleStatus status={status} />
|
||||||
<h1 className="text-xl pb-1">
|
<h1 className="text-xl pb-1">
|
||||||
{status === 'STATUS_ENABLED'
|
{status === 'STATUS_ENABLED'
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
export { TxList } from './tx-list';
|
|
||||||
export { TxOrderType } from './tx-order-type';
|
export { TxOrderType } from './tx-order-type';
|
||||||
export { TxsInfiniteList } from './txs-infinite-list';
|
export { TxsInfiniteList } from './txs-infinite-list';
|
||||||
export { TxsInfiniteListItem } from './txs-infinite-list-item';
|
export { TxsInfiniteListItem } from './txs-infinite-list-item';
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import type { TendermintUnconfirmedTransactionsResponse } from '../../routes/txs/tendermint-unconfirmed-transactions-response.d';
|
|
||||||
|
|
||||||
interface TxsProps {
|
|
||||||
data: TendermintUnconfirmedTransactionsResponse | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const TxList = ({ data }: TxsProps) => {
|
|
||||||
if (!data) {
|
|
||||||
return <div>{t('Awaiting transactions')}</div>;
|
|
||||||
}
|
|
||||||
|
|
||||||
return <div>{JSON.stringify(data, null, ' ')}</div>;
|
|
||||||
};
|
|
||||||
@@ -7,7 +7,7 @@ import { toHex } from '../search/detect-search';
|
|||||||
import { ChainResponseCode } from './details/chain-response-code/chain-reponse.code';
|
import { ChainResponseCode } from './details/chain-response-code/chain-reponse.code';
|
||||||
import isNumber from 'lodash/isNumber';
|
import isNumber from 'lodash/isNumber';
|
||||||
|
|
||||||
const TRUNCATE_LENGTH = 5;
|
const TRUNCATE_LENGTH = 10;
|
||||||
|
|
||||||
export const TxsInfiniteListItem = ({
|
export const TxsInfiniteListItem = ({
|
||||||
hash,
|
hash,
|
||||||
@@ -34,10 +34,10 @@ export const TxsInfiniteListItem = ({
|
|||||||
className="flex items-center h-full border-t border-neutral-600 dark:border-neutral-800 txs-infinite-list-item grid grid-cols-10 py-2"
|
className="flex items-center h-full border-t border-neutral-600 dark:border-neutral-800 txs-infinite-list-item grid grid-cols-10 py-2"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
className="text-sm col-span-10 xl:col-span-3 leading-none"
|
className="text-sm col-span-10 md:col-span-3 leading-none"
|
||||||
data-testid="tx-hash"
|
data-testid="tx-hash"
|
||||||
>
|
>
|
||||||
<span className="xl:hidden uppercase text-vega-dark-300">
|
<span className="md:hidden uppercase text-vega-dark-300">
|
||||||
ID:
|
ID:
|
||||||
</span>
|
</span>
|
||||||
<TruncatedLink
|
<TruncatedLink
|
||||||
@@ -48,10 +48,10 @@ export const TxsInfiniteListItem = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="text-sm col-span-10 xl:col-span-3 leading-none"
|
className="text-sm col-span-10 md:col-span-3 leading-none"
|
||||||
data-testid="pub-key"
|
data-testid="pub-key"
|
||||||
>
|
>
|
||||||
<span className="xl:hidden uppercase text-vega-dark-300">
|
<span className="md:hidden uppercase text-vega-dark-300">
|
||||||
By:
|
By:
|
||||||
</span>
|
</span>
|
||||||
<TruncatedLink
|
<TruncatedLink
|
||||||
@@ -61,14 +61,14 @@ export const TxsInfiniteListItem = ({
|
|||||||
endChars={TRUNCATE_LENGTH}
|
endChars={TRUNCATE_LENGTH}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="text-sm col-span-5 xl:col-span-2 leading-none flex items-center">
|
<div className="text-sm col-span-5 md:col-span-2 leading-none flex items-center">
|
||||||
<TxOrderType orderType={type} command={command} />
|
<TxOrderType orderType={type} command={command} />
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="text-sm col-span-3 xl:col-span-1 leading-none flex items-center"
|
className="text-sm col-span-3 md:col-span-1 leading-none flex items-center"
|
||||||
data-testid="tx-block"
|
data-testid="tx-block"
|
||||||
>
|
>
|
||||||
<span className="xl:hidden uppercase text-vega-dark-300">
|
<span className="md:hidden uppercase text-vega-dark-300">
|
||||||
Block:
|
Block:
|
||||||
</span>
|
</span>
|
||||||
<TruncatedLink
|
<TruncatedLink
|
||||||
@@ -79,10 +79,10 @@ export const TxsInfiniteListItem = ({
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
className="text-sm col-span-2 xl:col-span-1 leading-none flex items-center"
|
className="text-sm col-span-2 md:col-span-1 leading-none flex items-center"
|
||||||
data-testid="tx-success"
|
data-testid="tx-success"
|
||||||
>
|
>
|
||||||
<span className="xl:hidden uppercase text-vega-dark-300">
|
<span className="md:hidden uppercase text-vega-dark-300">
|
||||||
Success:
|
Success:
|
||||||
</span>
|
</span>
|
||||||
{isNumber(code) ? (
|
{isNumber(code) ? (
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ describe('Txs infinite list', () => {
|
|||||||
error={Error('test error!')}
|
error={Error('test error!')}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
expect(
|
expect(screen.getByText('Cannot fetch transaction')).toBeInTheDocument();
|
||||||
screen.getByText('Cannot fetch transaction: Error: test error!')
|
|
||||||
).toBeInTheDocument();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('item renders data of n length into list of n length', () => {
|
it('item renders data of n length into list of n length', () => {
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ const NOOP = () => {};
|
|||||||
const Item = ({ index, style, isLoading, error }: ItemProps) => {
|
const Item = ({ index, style, isLoading, error }: ItemProps) => {
|
||||||
let content;
|
let content;
|
||||||
if (error) {
|
if (error) {
|
||||||
content = t(`Cannot fetch transaction: ${error}`);
|
content = t(`Cannot fetch transaction`);
|
||||||
} else if (isLoading) {
|
} else if (isLoading) {
|
||||||
content = <Loader />;
|
content = <Loader />;
|
||||||
} else {
|
} else {
|
||||||
@@ -68,7 +68,7 @@ export const TxsInfiniteList = ({
|
|||||||
className,
|
className,
|
||||||
}: TxsInfiniteListProps) => {
|
}: TxsInfiniteListProps) => {
|
||||||
const { screenSize } = useScreenDimensions();
|
const { screenSize } = useScreenDimensions();
|
||||||
const isStacked = ['xs', 'sm', 'md', 'lg'].includes(screenSize);
|
const isStacked = ['xs', 'sm'].includes(screenSize);
|
||||||
|
|
||||||
if (!txs) {
|
if (!txs) {
|
||||||
if (!areTxsLoading) {
|
if (!areTxsLoading) {
|
||||||
@@ -95,15 +95,15 @@ export const TxsInfiniteList = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={className} data-testid="transactions-list">
|
<div className={className} data-testid="transactions-list">
|
||||||
<div className="xl:grid grid-cols-10 w-full mb-3 hidden text-vega-dark-300 uppercase">
|
<div className="lg:grid grid-cols-10 w-full mb-3 hidden text-vega-dark-300 uppercase">
|
||||||
<div className="col-span-3">
|
<div className="col-span-3">
|
||||||
<span className="hidden xl:inline">Transaction </span>
|
<span className="hidden xl:inline">{t('Transaction')} </span>
|
||||||
<span>ID</span>
|
<span>ID</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="col-span-3">Submitted By</div>
|
<div className="col-span-3">{t('Submitted By')}</div>
|
||||||
<div className="col-span-2">Type</div>
|
<div className="col-span-2">{t('Type')}</div>
|
||||||
<div className="col-span-1">Block</div>
|
<div className="col-span-1">{t('Block')}</div>
|
||||||
<div className="col-span-1">Success</div>
|
<div className="col-span-1">{t('Success')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div data-testid="infinite-scroll-wrapper">
|
<div data-testid="infinite-scroll-wrapper">
|
||||||
<InfiniteLoader
|
<InfiniteLoader
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { Routes } from '../../routes/route-names';
|
import { Routes } from '../../routes/route-names';
|
||||||
import { RenderFetched } from '../render-fetched';
|
|
||||||
import { TruncatedLink } from '../truncate/truncated-link';
|
import { TruncatedLink } from '../truncate/truncated-link';
|
||||||
import { TxOrderType } from './tx-order-type';
|
import { TxOrderType } from './tx-order-type';
|
||||||
import { Table, TableRow, TableCell } from '../table';
|
import { Table, TableRow, TableCell } from '../table';
|
||||||
@@ -9,7 +8,7 @@ import type { BlockExplorerTransactions } from '../../routes/types/block-explore
|
|||||||
import isNumber from 'lodash/isNumber';
|
import isNumber from 'lodash/isNumber';
|
||||||
import { ChainResponseCode } from './details/chain-response-code/chain-reponse.code';
|
import { ChainResponseCode } from './details/chain-response-code/chain-reponse.code';
|
||||||
import { getTxsDataUrl } from '../../hooks/use-txs-data';
|
import { getTxsDataUrl } from '../../hooks/use-txs-data';
|
||||||
import { Loader } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Loader } from '@vegaprotocol/ui-toolkit';
|
||||||
import EmptyList from '../empty-list/empty-list';
|
import EmptyList from '../empty-list/empty-list';
|
||||||
|
|
||||||
interface TxsPerBlockProps {
|
interface TxsPerBlockProps {
|
||||||
@@ -27,7 +26,7 @@ export const TxsPerBlock = ({ blockHeight, txCount }: TxsPerBlockProps) => {
|
|||||||
} = useFetch<BlockExplorerTransactions>(url);
|
} = useFetch<BlockExplorerTransactions>(url);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RenderFetched error={error} loading={loading} className="text-body-large">
|
<AsyncRenderer data={data} error={error} loading={!!loading}>
|
||||||
{data && data.transactions.length > 0 ? (
|
{data && data.transactions.length > 0 ? (
|
||||||
<div className="overflow-x-auto whitespace-nowrap mb-28">
|
<div className="overflow-x-auto whitespace-nowrap mb-28">
|
||||||
<Table>
|
<Table>
|
||||||
@@ -95,6 +94,6 @@ export const TxsPerBlock = ({ blockHeight, txCount }: TxsPerBlockProps) => {
|
|||||||
label={t('0 transactions')}
|
label={t('0 transactions')}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
</RenderFetched>
|
</AsyncRenderer>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -144,12 +144,12 @@ afterEach(() => {
|
|||||||
describe('Block', () => {
|
describe('Block', () => {
|
||||||
it('renders error state if error is present', async () => {
|
it('renders error state if error is present', async () => {
|
||||||
(useFetch as jest.Mock).mockReturnValue({
|
(useFetch as jest.Mock).mockReturnValue({
|
||||||
state: { data: null, loading: false, error: 'asd' },
|
state: { data: null, loading: false, error: new Error('asd') },
|
||||||
});
|
});
|
||||||
render(renderComponent());
|
render(renderComponent());
|
||||||
|
|
||||||
expect(screen.getByText(`BLOCK ${blockId}`)).toBeInTheDocument();
|
expect(screen.getByText(`BLOCK ${blockId}`)).toBeInTheDocument();
|
||||||
expect(screen.getByText('Error retrieving data')).toBeInTheDocument();
|
expect(screen.getByText('Something went wrong: asd')).toBeInTheDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('renders loading state if present', async () => {
|
it('renders loading state if present', async () => {
|
||||||
|
|||||||
@@ -1,4 +1,3 @@
|
|||||||
import React from 'react';
|
|
||||||
import { Link, useParams } from 'react-router-dom';
|
import { Link, useParams } from 'react-router-dom';
|
||||||
import { DATA_SOURCES } from '../../../config';
|
import { DATA_SOURCES } from '../../../config';
|
||||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||||
@@ -12,9 +11,8 @@ import {
|
|||||||
TableCell,
|
TableCell,
|
||||||
} from '../../../components/table';
|
} from '../../../components/table';
|
||||||
import { TxsPerBlock } from '../../../components/txs/txs-per-block';
|
import { TxsPerBlock } from '../../../components/txs/txs-per-block';
|
||||||
import { Button } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Routes } from '../../route-names';
|
import { Routes } from '../../route-names';
|
||||||
import { RenderFetched } from '../../../components/render-fetched';
|
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
import { useFetch } from '@vegaprotocol/react-helpers';
|
||||||
import { NodeLink } from '../../../components/links';
|
import { NodeLink } from '../../../components/links';
|
||||||
@@ -34,7 +32,7 @@ const Block = () => {
|
|||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<RouteTitle data-testid="block-header">{t(`BLOCK ${block}`)}</RouteTitle>
|
<RouteTitle data-testid="block-header">{t(`BLOCK ${block}`)}</RouteTitle>
|
||||||
<RenderFetched error={error} loading={loading}>
|
<AsyncRenderer data={blockData} error={error} loading={!!loading}>
|
||||||
<>
|
<>
|
||||||
<div className="grid grid-cols-2 gap-2 mb-8">
|
<div className="grid grid-cols-2 gap-2 mb-8">
|
||||||
<Link
|
<Link
|
||||||
@@ -123,7 +121,7 @@ const Block = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</>
|
</>
|
||||||
</RenderFetched>
|
</AsyncRenderer>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
import { useFetch } from '@vegaprotocol/react-helpers';
|
||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
import { Loader, SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
||||||
import { DATA_SOURCES } from '../../config';
|
import { DATA_SOURCES } from '../../config';
|
||||||
import type { TendermintGenesisResponse } from './tendermint-genesis-response';
|
import type { TendermintGenesisResponse } from './tendermint-genesis-response';
|
||||||
import { useDocumentTitle } from '../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../hooks/use-document-title';
|
||||||
@@ -10,21 +10,26 @@ const Genesis = () => {
|
|||||||
useDocumentTitle(['Genesis']);
|
useDocumentTitle(['Genesis']);
|
||||||
|
|
||||||
const {
|
const {
|
||||||
state: { data: genesis, loading },
|
state: { data, loading, error },
|
||||||
} = useFetch<TendermintGenesisResponse>(
|
} = useFetch<TendermintGenesisResponse>(
|
||||||
`${DATA_SOURCES.tendermintUrl}/genesis`
|
`${DATA_SOURCES.tendermintUrl}/genesis`
|
||||||
);
|
);
|
||||||
if (!genesis?.result.genesis) {
|
|
||||||
if (loading) {
|
|
||||||
return <Loader />;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<>
|
||||||
<RouteTitle data-testid="genesis-header">{t('Genesis')}</RouteTitle>
|
<RouteTitle data-testid="genesis-header">{t('Genesis')}</RouteTitle>
|
||||||
<SyntaxHighlighter data={genesis?.result.genesis} />
|
<AsyncRenderer
|
||||||
</section>
|
data={data}
|
||||||
|
error={error}
|
||||||
|
loading={!!loading}
|
||||||
|
loadingMessage={t('Loading genesis information...')}
|
||||||
|
errorMessage={t('Could not fetch genesis data')}
|
||||||
|
>
|
||||||
|
<section>
|
||||||
|
<SyntaxHighlighter data={data?.result.genesis} />
|
||||||
|
</section>
|
||||||
|
</AsyncRenderer>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
import { proposalsDataProvider } from '@vegaprotocol/proposals';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { ProposalsTable } from '../../components/proposals/proposals-table';
|
import { ProposalsTable } from '../../components/proposals/proposals-table';
|
||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
|
|||||||
@@ -38,14 +38,16 @@ const DialogsContainer = () => {
|
|||||||
export const Layout = () => {
|
export const Layout = () => {
|
||||||
const isHome = Boolean(useMatch(Routes.HOME));
|
const isHome = Boolean(useMatch(Routes.HOME));
|
||||||
const { ANNOUNCEMENTS_CONFIG_URL } = useEnvironment();
|
const { ANNOUNCEMENTS_CONFIG_URL } = useEnvironment();
|
||||||
|
const fixedWidthClasses = 'w-full max-w-[1500px] mx-auto';
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div
|
<div
|
||||||
className={classNames(
|
className={classNames(
|
||||||
'max-w-[1500px] min-h-[100vh]',
|
'min-h-screen',
|
||||||
'mx-auto my-0',
|
'mx-auto my-0',
|
||||||
'grid grid-rows-[auto_1fr_auto] grid-cols-1',
|
'grid grid-rows-[auto_1fr_auto] grid-cols-1',
|
||||||
'border-vega-light-200 dark:border-vega-dark-200 lg:border-l lg:border-r',
|
'border-vega-light-200 dark:border-vega-dark-200',
|
||||||
'antialiased text-black dark:text-white',
|
'antialiased text-black dark:text-white',
|
||||||
'overflow-hidden relative'
|
'overflow-hidden relative'
|
||||||
)}
|
)}
|
||||||
@@ -59,13 +61,13 @@ export const Layout = () => {
|
|||||||
)}
|
)}
|
||||||
<Header />
|
<Header />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className={fixedWidthClasses}>
|
||||||
<main className="p-4">
|
<main className="p-4">
|
||||||
{!isHome && <BreadcrumbsContainer className="mb-4" />}
|
{!isHome && <BreadcrumbsContainer className="mb-4" />}
|
||||||
<Outlet />
|
<Outlet />
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div className={fixedWidthClasses}>
|
||||||
<Footer />
|
<Footer />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
@@ -49,6 +49,7 @@ export const MarketPage = () => {
|
|||||||
/>
|
/>
|
||||||
<AsyncRenderer
|
<AsyncRenderer
|
||||||
noDataMessage={t('This chain has no markets')}
|
noDataMessage={t('This chain has no markets')}
|
||||||
|
errorMessage={t('Could not fetch market') + ' ' + marketId}
|
||||||
data={data}
|
data={data}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
error={error}
|
error={error}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { marketsProvider } from '@vegaprotocol/market-list';
|
|||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer } from '@vegaprotocol/ui-toolkit';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDataProvider } from '@vegaprotocol/react-helpers';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { MarketsTable } from '../../components/markets/markets-table';
|
import { MarketsTable } from '../../components/markets/markets-table';
|
||||||
|
|
||||||
export const MarketsPage = () => {
|
export const MarketsPage = () => {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { render, screen } from '@testing-library/react';
|
import { render, screen } from '@testing-library/react';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { NetworkParametersTable } from './network-parameters';
|
import { NetworkParametersTable } from './network-parameters';
|
||||||
|
|
||||||
describe('NetworkParametersTable', () => {
|
describe('NetworkParametersTable', () => {
|
||||||
|
|||||||
@@ -13,14 +13,15 @@ import {
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { RouteTitle } from '../../components/route-title';
|
import { RouteTitle } from '../../components/route-title';
|
||||||
import orderBy from 'lodash/orderBy';
|
import orderBy from 'lodash/orderBy';
|
||||||
import { useNetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import { useNetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import type { NetworkParamsQuery } from '@vegaprotocol/react-helpers';
|
import type { NetworkParamsQuery } from '@vegaprotocol/network-parameters';
|
||||||
import { useScrollToLocation } from '../../hooks/scroll-to-location';
|
import { useScrollToLocation } from '../../hooks/scroll-to-location';
|
||||||
import { useDocumentTitle } from '../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../hooks/use-document-title';
|
||||||
|
|
||||||
const PERCENTAGE_PARAMS = [
|
const PERCENTAGE_PARAMS = [
|
||||||
'governance.proposal.asset.requiredMajority',
|
'governance.proposal.asset.requiredMajority',
|
||||||
'governance.proposal.asset.requiredParticipation',
|
'governance.proposal.asset.requiredParticipation',
|
||||||
|
'governance.proposal.updateAsset.requiredParticipation',
|
||||||
'governance.proposal.freeform.requiredMajority',
|
'governance.proposal.freeform.requiredMajority',
|
||||||
'governance.proposal.freeform.requiredParticipation',
|
'governance.proposal.freeform.requiredParticipation',
|
||||||
'governance.proposal.market.requiredMajority',
|
'governance.proposal.market.requiredMajority',
|
||||||
@@ -53,6 +54,8 @@ const BIG_NUMBER_PARAMS = [
|
|||||||
'governance.proposal.asset.minProposerBalance',
|
'governance.proposal.asset.minProposerBalance',
|
||||||
'governance.proposal.market.minProposerBalance',
|
'governance.proposal.market.minProposerBalance',
|
||||||
'governance.proposal.market.minVoterBalance',
|
'governance.proposal.market.minVoterBalance',
|
||||||
|
'governance.proposal.updateAsset.minProposerBalance',
|
||||||
|
'governance.proposal.updateAsset.minVoterBalance',
|
||||||
];
|
];
|
||||||
|
|
||||||
export const NetworkParameterRow = ({
|
export const NetworkParameterRow = ({
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Loader, SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
||||||
import { RouteTitle } from '../../../components/route-title';
|
import { RouteTitle } from '../../../components/route-title';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useExplorerOracleSpecsQuery } from '../__generated__/Oracles';
|
import { useExplorerOracleSpecsQuery } from '../__generated__/Oracles';
|
||||||
@@ -8,7 +8,7 @@ import { useScrollToLocation } from '../../../hooks/scroll-to-location';
|
|||||||
import filter from 'recursive-key-filter';
|
import filter from 'recursive-key-filter';
|
||||||
|
|
||||||
const Oracles = () => {
|
const Oracles = () => {
|
||||||
const { data, loading } = useExplorerOracleSpecsQuery();
|
const { data, loading, error } = useExplorerOracleSpecsQuery();
|
||||||
|
|
||||||
useDocumentTitle(['Oracles']);
|
useDocumentTitle(['Oracles']);
|
||||||
useScrollToLocation();
|
useScrollToLocation();
|
||||||
@@ -16,28 +16,40 @@ const Oracles = () => {
|
|||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<RouteTitle data-testid="oracle-specs-heading">{t('Oracles')}</RouteTitle>
|
<RouteTitle data-testid="oracle-specs-heading">{t('Oracles')}</RouteTitle>
|
||||||
{loading ? <Loader /> : null}
|
<AsyncRenderer
|
||||||
{data?.oracleSpecsConnection?.edges
|
data={data}
|
||||||
? data.oracleSpecsConnection.edges.map((o) => {
|
loading={loading}
|
||||||
const id = o?.node.dataSourceSpec.spec.id;
|
error={error}
|
||||||
if (!id) {
|
loadingMessage={t('Loading oracle data...')}
|
||||||
return null;
|
errorMessage={t('Oracle data could not be loaded')}
|
||||||
}
|
noDataMessage={t('No oracles found')}
|
||||||
return (
|
noDataCondition={(data) =>
|
||||||
<div id={id} key={id} className="mb-10">
|
!data?.oracleSpecsConnection?.edges ||
|
||||||
<OracleDetails
|
data.oracleSpecsConnection.edges?.length === 0
|
||||||
id={id}
|
}
|
||||||
dataSource={o?.node}
|
>
|
||||||
showBroadcasts={false}
|
{data?.oracleSpecsConnection?.edges
|
||||||
/>
|
? data.oracleSpecsConnection.edges.map((o) => {
|
||||||
<details>
|
const id = o?.node.dataSourceSpec.spec.id;
|
||||||
<summary className="pointer">JSON</summary>
|
if (!id) {
|
||||||
<SyntaxHighlighter data={filter(o, ['__typename'])} />
|
return null;
|
||||||
</details>
|
}
|
||||||
</div>
|
return (
|
||||||
);
|
<div id={id} key={id} className="mb-10">
|
||||||
})
|
<OracleDetails
|
||||||
: null}
|
id={id}
|
||||||
|
dataSource={o?.node}
|
||||||
|
showBroadcasts={false}
|
||||||
|
/>
|
||||||
|
<details>
|
||||||
|
<summary className="pointer">JSON</summary>
|
||||||
|
<SyntaxHighlighter data={filter(o, ['__typename'])} />
|
||||||
|
</details>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})
|
||||||
|
: null}
|
||||||
|
</AsyncRenderer>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,12 +1,11 @@
|
|||||||
import { RouteTitle } from '../../../components/route-title';
|
import { RouteTitle } from '../../../components/route-title';
|
||||||
import { RenderFetched } from '../../../components/render-fetched';
|
|
||||||
import { truncateByChars } from '@vegaprotocol/utils';
|
import { truncateByChars } from '@vegaprotocol/utils';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useParams } from 'react-router-dom';
|
||||||
import { useExplorerOracleSpecByIdQuery } from '../__generated__/Oracles';
|
import { useExplorerOracleSpecByIdQuery } from '../__generated__/Oracles';
|
||||||
import { OracleDetails } from '../components/oracle';
|
import { OracleDetails } from '../components/oracle';
|
||||||
import { SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, SyntaxHighlighter } from '@vegaprotocol/ui-toolkit';
|
||||||
import filter from 'recursive-key-filter';
|
import filter from 'recursive-key-filter';
|
||||||
import { TruncateInline } from '../../../components/truncate/truncate';
|
import { TruncateInline } from '../../../components/truncate/truncate';
|
||||||
|
|
||||||
@@ -27,7 +26,14 @@ export const Oracle = () => {
|
|||||||
{t(`Oracle `)}
|
{t(`Oracle `)}
|
||||||
<TruncateInline startChars={5} endChars={5} text={id || '1'} />
|
<TruncateInline startChars={5} endChars={5} text={id || '1'} />
|
||||||
</RouteTitle>
|
</RouteTitle>
|
||||||
<RenderFetched error={error} loading={loading}>
|
<AsyncRenderer
|
||||||
|
data={data}
|
||||||
|
error={error}
|
||||||
|
loading={loading}
|
||||||
|
noDataCondition={(data) => !data?.oracleSpec}
|
||||||
|
errorMessage={t('Could not load oracle data')}
|
||||||
|
loadingMessage={t('Loading oracle data...')}
|
||||||
|
>
|
||||||
{data?.oracleSpec ? (
|
{data?.oracleSpec ? (
|
||||||
<div id={id} key={id} className="mb-10">
|
<div id={id} key={id} className="mb-10">
|
||||||
<OracleDetails
|
<OracleDetails
|
||||||
@@ -44,7 +50,7 @@ export const Oracle = () => {
|
|||||||
) : (
|
) : (
|
||||||
<span></span>
|
<span></span>
|
||||||
)}
|
)}
|
||||||
</RenderFetched>
|
</AsyncRenderer>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -48,6 +48,13 @@ query ExplorerPartyAssets($partyId: ID!) {
|
|||||||
}
|
}
|
||||||
stakingSummary {
|
stakingSummary {
|
||||||
currentStakeAvailable
|
currentStakeAvailable
|
||||||
|
linkings(pagination: { first: 100 }) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
amount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
accountsConnection {
|
accountsConnection {
|
||||||
edges {
|
edges {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export type ExplorerPartyAssetsQueryVariables = Types.Exact<{
|
|||||||
}>;
|
}>;
|
||||||
|
|
||||||
|
|
||||||
export type ExplorerPartyAssetsQuery = { __typename?: 'Query', partiesConnection?: { __typename?: 'PartyConnection', edges: Array<{ __typename?: 'PartyEdge', node: { __typename?: 'Party', id: string, delegationsConnection?: { __typename?: 'DelegationsConnection', edges?: Array<{ __typename?: 'DelegationEdge', node: { __typename?: 'Delegation', amount: string, epoch: number, node: { __typename?: 'Node', id: string, name: string } } } | null> | null } | null, stakingSummary: { __typename?: 'StakingSummary', currentStakeAvailable: string }, accountsConnection?: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'AccountBalance', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } }, market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, product: { __typename?: 'Future', quoteName: string } } } } | null } } | null> | null } | null } }> } | null };
|
export type ExplorerPartyAssetsQuery = { __typename?: 'Query', partiesConnection?: { __typename?: 'PartyConnection', edges: Array<{ __typename?: 'PartyEdge', node: { __typename?: 'Party', id: string, delegationsConnection?: { __typename?: 'DelegationsConnection', edges?: Array<{ __typename?: 'DelegationEdge', node: { __typename?: 'Delegation', amount: string, epoch: number, node: { __typename?: 'Node', id: string, name: string } } } | null> | null } | null, stakingSummary: { __typename?: 'StakingSummary', currentStakeAvailable: string, linkings: { __typename?: 'StakesConnection', edges?: Array<{ __typename?: 'StakeLinkingEdge', node: { __typename?: 'StakeLinking', amount: string } } | null> | null } }, accountsConnection?: { __typename?: 'AccountsConnection', edges?: Array<{ __typename?: 'AccountEdge', node: { __typename?: 'AccountBalance', type: Types.AccountType, balance: string, asset: { __typename?: 'Asset', name: string, id: string, decimals: number, symbol: string, source: { __typename: 'BuiltinAsset' } | { __typename: 'ERC20', contractAddress: string } }, market?: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, product: { __typename?: 'Future', quoteName: string } } } } | null } } | null> | null } | null } }> } | null };
|
||||||
|
|
||||||
export const ExplorerPartyAssetsAccountsFragmentDoc = gql`
|
export const ExplorerPartyAssetsAccountsFragmentDoc = gql`
|
||||||
fragment ExplorerPartyAssetsAccounts on AccountBalance {
|
fragment ExplorerPartyAssetsAccounts on AccountBalance {
|
||||||
@@ -64,6 +64,13 @@ export const ExplorerPartyAssetsDocument = gql`
|
|||||||
}
|
}
|
||||||
stakingSummary {
|
stakingSummary {
|
||||||
currentStakeAvailable
|
currentStakeAvailable
|
||||||
|
linkings(pagination: {first: 100}) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
amount
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
accountsConnection {
|
accountsConnection {
|
||||||
edges {
|
edges {
|
||||||
|
|||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import { useParams } from 'react-router-dom';
|
||||||
|
import { toNonHex } from '../../../../components/search/detect-search';
|
||||||
|
import { PageHeader } from '../../../../components/page-header';
|
||||||
|
import { useDocumentTitle } from '../../../../hooks/use-document-title';
|
||||||
|
|
||||||
|
import { PartyAccounts } from '../components/party-accounts';
|
||||||
|
|
||||||
|
const PartyAccountsByAsset = () => {
|
||||||
|
const { party } = useParams<{ party: string }>();
|
||||||
|
|
||||||
|
useDocumentTitle(['Public keys', party || '-']);
|
||||||
|
const partyId = toNonHex(party ? party : '');
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section>
|
||||||
|
<PageHeader title={t('Balances by asset')} />
|
||||||
|
|
||||||
|
<PartyAccounts partyId={partyId} />
|
||||||
|
</section>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export { PartyAccountsByAsset };
|
||||||
@@ -1,32 +1,9 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { AccountManager } from '@vegaprotocol/accounts';
|
||||||
import get from 'lodash/get';
|
import { useCallback } from 'react';
|
||||||
import AssetBalance from '../../../../components/asset-balance/asset-balance';
|
import { useAssetDetailsDialogStore } from '@vegaprotocol/assets';
|
||||||
import { AssetLink, MarketLink } from '../../../../components/links';
|
|
||||||
import { Table, TableRow } from '../../../../components/table';
|
|
||||||
import type * as Schema from '@vegaprotocol/types';
|
|
||||||
import type { ExplorerPartyAssetsAccountsFragment } from '../__generated__/Party-assets';
|
|
||||||
|
|
||||||
const accountTypeString: Record<Schema.AccountType, string> = {
|
|
||||||
ACCOUNT_TYPE_BOND: t('Bond'),
|
|
||||||
ACCOUNT_TYPE_EXTERNAL: t('External'),
|
|
||||||
ACCOUNT_TYPE_FEES_INFRASTRUCTURE: t('Fees (Infrastructure)'),
|
|
||||||
ACCOUNT_TYPE_FEES_LIQUIDITY: t('Fees (Liquidity)'),
|
|
||||||
ACCOUNT_TYPE_FEES_MAKER: t('Fees (Maker)'),
|
|
||||||
ACCOUNT_TYPE_GENERAL: t('General'),
|
|
||||||
ACCOUNT_TYPE_GLOBAL_INSURANCE: t('Global Insurance Pool'),
|
|
||||||
ACCOUNT_TYPE_GLOBAL_REWARD: t('Global Reward Pool'),
|
|
||||||
ACCOUNT_TYPE_INSURANCE: t('Insurance'),
|
|
||||||
ACCOUNT_TYPE_MARGIN: t('Margin'),
|
|
||||||
ACCOUNT_TYPE_PENDING_TRANSFERS: t('Pending Transfers'),
|
|
||||||
ACCOUNT_TYPE_REWARD_LP_RECEIVED_FEES: t('Reward - LP Fees received'),
|
|
||||||
ACCOUNT_TYPE_REWARD_MAKER_PAID_FEES: t('Reward - Maker fees paid'),
|
|
||||||
ACCOUNT_TYPE_REWARD_MAKER_RECEIVED_FEES: t('Reward - Maker fees received'),
|
|
||||||
ACCOUNT_TYPE_REWARD_MARKET_PROPOSERS: t('Reward - Market proposers'),
|
|
||||||
ACCOUNT_TYPE_SETTLEMENT: t('Settlement'),
|
|
||||||
};
|
|
||||||
|
|
||||||
interface PartyAccountsProps {
|
interface PartyAccountsProps {
|
||||||
accounts: ExplorerPartyAssetsAccountsFragment[];
|
partyId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -34,49 +11,22 @@ interface PartyAccountsProps {
|
|||||||
* probably do with sorting by asset, and then within asset, by type with general
|
* probably do with sorting by asset, and then within asset, by type with general
|
||||||
* appearing first and... tbd
|
* appearing first and... tbd
|
||||||
*/
|
*/
|
||||||
export const PartyAccounts = ({ accounts }: PartyAccountsProps) => {
|
export const PartyAccounts = ({ partyId }: PartyAccountsProps) => {
|
||||||
return (
|
const { open: openAssetDetailsDialog } = useAssetDetailsDialogStore();
|
||||||
<Table className="max-w-5xl min-w-fit">
|
const onClickAsset = useCallback(
|
||||||
<thead>
|
(assetId?: string) => {
|
||||||
<TableRow modifier="bordered" className="font-mono">
|
assetId && openAssetDetailsDialog(assetId);
|
||||||
<td>{t('Type')}</td>
|
},
|
||||||
<td>{t('Market')}</td>
|
[openAssetDetailsDialog]
|
||||||
<td className="text-right pr-2">{t('Balance')}</td>
|
);
|
||||||
<td>{t('Asset')}</td>
|
|
||||||
</TableRow>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
{accounts.map((account) => {
|
|
||||||
const m = get(account, 'market.tradableInstrument.instrument.name');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TableRow
|
<div className="block min-h-44 h-60 4 w-full border-red-800 relative">
|
||||||
key={`pa-${account.asset.id}-${account.type}`}
|
<AccountManager
|
||||||
title={account.asset.name}
|
partyId={partyId}
|
||||||
id={`${accountTypeString[account.type]} ${m ? ` - ${m}` : ''}`}
|
onClickAsset={onClickAsset}
|
||||||
>
|
isReadOnly={true}
|
||||||
<td className="text-md">{accountTypeString[account.type]}</td>
|
/>
|
||||||
<td className="text-md">
|
</div>
|
||||||
{account.market?.id ? (
|
|
||||||
<MarketLink id={account.market?.id} />
|
|
||||||
) : (
|
|
||||||
<p>-</p>
|
|
||||||
)}
|
|
||||||
</td>
|
|
||||||
<td className="text-md text-right pr-2">
|
|
||||||
<AssetBalance
|
|
||||||
assetId={account.asset.id}
|
|
||||||
price={account.balance}
|
|
||||||
showAssetLink={false}
|
|
||||||
/>
|
|
||||||
</td>
|
|
||||||
<td className="text-md">
|
|
||||||
<AssetLink assetId={account.asset.id} />
|
|
||||||
</td>
|
|
||||||
</TableRow>
|
|
||||||
);
|
|
||||||
})}
|
|
||||||
</tbody>
|
|
||||||
</Table>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,63 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import { useNavigate } from 'react-router-dom';
|
||||||
|
import { Routes } from '../../../../routes/route-names';
|
||||||
|
import { Button, Icon, Loader } from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { PartyBlock } from './party-block';
|
||||||
|
import type { AccountFields } from '@vegaprotocol/accounts';
|
||||||
|
|
||||||
|
export interface PartyBlockAccountProps {
|
||||||
|
partyId: string;
|
||||||
|
accountData: AccountFields[] | null;
|
||||||
|
accountLoading: boolean;
|
||||||
|
accountError?: Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays an overview of a party's assets. This uses existing data
|
||||||
|
* providers to structure the details by asset, rather than looking at
|
||||||
|
* it by account. The assumption is that this is a more natural way to
|
||||||
|
* get an idea of the assets and activity of a party.
|
||||||
|
*/
|
||||||
|
export const PartyBlockAccounts = ({
|
||||||
|
partyId,
|
||||||
|
accountData,
|
||||||
|
accountLoading,
|
||||||
|
accountError,
|
||||||
|
}: PartyBlockAccountProps) => {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
|
const shouldShowActionButton =
|
||||||
|
accountData && accountData.length > 0 && !accountLoading && !accountError;
|
||||||
|
|
||||||
|
const action = shouldShowActionButton ? (
|
||||||
|
<Button
|
||||||
|
size="sm"
|
||||||
|
onClick={() => navigate(`/${Routes.PARTIES}/${partyId}/assets`)}
|
||||||
|
>
|
||||||
|
{t('Show all')}
|
||||||
|
</Button>
|
||||||
|
) : null;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PartyBlock title={t('Assets')} action={action}>
|
||||||
|
{accountData && accountData.length > 0 ? (
|
||||||
|
<p>
|
||||||
|
{accountData.length} {t('assets, including')}{' '}
|
||||||
|
{accountData
|
||||||
|
.map((a) => a.asset.symbol)
|
||||||
|
.slice(0, 3)
|
||||||
|
.join(', ')}
|
||||||
|
</p>
|
||||||
|
) : accountLoading && !accountError ? (
|
||||||
|
<Loader size="small" />
|
||||||
|
) : accountData && accountData.length === 0 ? (
|
||||||
|
<p>{t('No accounts found')}</p>
|
||||||
|
) : (
|
||||||
|
<p>
|
||||||
|
<Icon className="mr-1" name="error" />
|
||||||
|
<span className="text-sm">{t('Could not load assets')}</span>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</PartyBlock>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import { useExplorerPartyAssetsQuery } from '../__generated__/Party-assets';
|
||||||
|
import GovernanceAssetBalance from '../../../../components/asset-balance/governance-asset-balance';
|
||||||
|
import {
|
||||||
|
Icon,
|
||||||
|
KeyValueTable,
|
||||||
|
KeyValueTableRow,
|
||||||
|
Loader,
|
||||||
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { PartyBlock } from './party-block';
|
||||||
|
import BigNumber from 'bignumber.js';
|
||||||
|
|
||||||
|
export interface PartyBlockStakeProps {
|
||||||
|
partyId: string;
|
||||||
|
accountLoading: boolean;
|
||||||
|
accountError?: Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays an overview of a single party's staking balance, importantly maintaining'
|
||||||
|
* the same height before and after the details are loaded in.
|
||||||
|
*
|
||||||
|
* Unlike PartyBlockAccounts there is not action button in the title of this block as
|
||||||
|
* there is no page for it to link to currently. That's a future task.
|
||||||
|
*/
|
||||||
|
export const PartyBlockStake = ({
|
||||||
|
partyId,
|
||||||
|
accountLoading,
|
||||||
|
accountError,
|
||||||
|
}: PartyBlockStakeProps) => {
|
||||||
|
const partyRes = useExplorerPartyAssetsQuery({
|
||||||
|
// Don't cache data for this query, party information can move quite quickly
|
||||||
|
fetchPolicy: 'network-only',
|
||||||
|
variables: { partyId: partyId },
|
||||||
|
skip: !partyId,
|
||||||
|
});
|
||||||
|
|
||||||
|
const p = partyRes.data?.partiesConnection?.edges[0].node;
|
||||||
|
|
||||||
|
const linkedLength = p?.stakingSummary?.linkings?.edges?.length;
|
||||||
|
const linkedStake =
|
||||||
|
linkedLength && linkedLength > 0
|
||||||
|
? p?.stakingSummary?.linkings?.edges
|
||||||
|
?.reduce((total, e) => {
|
||||||
|
return new BigNumber(total).plus(
|
||||||
|
new BigNumber(e?.node.amount || 0)
|
||||||
|
);
|
||||||
|
}, new BigNumber(0))
|
||||||
|
.toString()
|
||||||
|
: '0';
|
||||||
|
|
||||||
|
return (
|
||||||
|
<PartyBlock title={t('Staking')}>
|
||||||
|
{p?.stakingSummary.currentStakeAvailable ? (
|
||||||
|
<KeyValueTable>
|
||||||
|
<KeyValueTableRow noBorder={true}>
|
||||||
|
<div>{t('Available stake')}</div>
|
||||||
|
<div>
|
||||||
|
<GovernanceAssetBalance
|
||||||
|
price={p.stakingSummary.currentStakeAvailable}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</KeyValueTableRow>
|
||||||
|
<KeyValueTableRow noBorder={true}>
|
||||||
|
<div>{t('Active stake')}</div>
|
||||||
|
<div>
|
||||||
|
<GovernanceAssetBalance price={linkedStake || '0'} />
|
||||||
|
</div>
|
||||||
|
</KeyValueTableRow>
|
||||||
|
</KeyValueTable>
|
||||||
|
) : accountLoading && !accountError ? (
|
||||||
|
<Loader size="small" />
|
||||||
|
) : !accountError ? (
|
||||||
|
<p>{t('No staking balance')}</p>
|
||||||
|
) : (
|
||||||
|
<p>
|
||||||
|
<Icon className="mr-1" name="error" />
|
||||||
|
<span className="text-sm">{t('Could not load stake details')}</span>
|
||||||
|
</p>
|
||||||
|
)}
|
||||||
|
</PartyBlock>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
import type { ReactNode } from 'react';
|
||||||
|
|
||||||
|
export interface PartyBlockProps {
|
||||||
|
children: ReactNode;
|
||||||
|
title: string;
|
||||||
|
action?: ReactNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export function PartyBlock({ children, title, action }: PartyBlockProps) {
|
||||||
|
return (
|
||||||
|
<div className="border-2 min-h-[138px] border-solid border-vega-light-100 dark:border-vega-dark-200 p-5 mt-5">
|
||||||
|
<div
|
||||||
|
className="flex flex-col md:flex-row gap-1 justify-between content-start mb-2"
|
||||||
|
data-testid="page-title"
|
||||||
|
>
|
||||||
|
<h3 className="font-semibold text-lg">{title}</h3>
|
||||||
|
|
||||||
|
{action ? action : null}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,24 +1,26 @@
|
|||||||
import { getNodes } from '@vegaprotocol/utils';
|
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
import { useScreenDimensions } from '@vegaprotocol/react-helpers';
|
||||||
import { useMemo } from 'react';
|
import { useMemo } from 'react';
|
||||||
import { useParams } from 'react-router-dom';
|
import { useNavigate, useParams } from 'react-router-dom';
|
||||||
import { SubHeading } from '../../../components/sub-heading';
|
import { SubHeading } from '../../../components/sub-heading';
|
||||||
import { Panel } from '../../../components/panel';
|
|
||||||
import { toNonHex } from '../../../components/search/detect-search';
|
import { toNonHex } from '../../../components/search/detect-search';
|
||||||
import { useTxsData } from '../../../hooks/use-txs-data';
|
import { useTxsData } from '../../../hooks/use-txs-data';
|
||||||
import { TxsInfiniteList } from '../../../components/txs';
|
import { TxsInfiniteList } from '../../../components/txs';
|
||||||
import { PageHeader } from '../../../components/page-header';
|
import { PageHeader } from '../../../components/page-header';
|
||||||
import { useExplorerPartyAssetsQuery } from './__generated__/Party-assets';
|
|
||||||
import type { ExplorerPartyAssetsAccountsFragment } from './__generated__/Party-assets';
|
|
||||||
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
||||||
import GovernanceAssetBalance from '../../../components/asset-balance/governance-asset-balance';
|
import { Icon, Intent, Notification, Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { PartyAccounts } from './components/party-accounts';
|
import { aggregatedAccountsDataProvider } from '@vegaprotocol/accounts';
|
||||||
|
import { PartyBlockStake } from './components/party-block-stake';
|
||||||
|
import { PartyBlockAccounts } from './components/party-block-accounts';
|
||||||
|
import { isValidPartyId } from './components/party-id-error';
|
||||||
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
|
|
||||||
const Party = () => {
|
const Party = () => {
|
||||||
const { party } = useParams<{ party: string }>();
|
const { party } = useParams<{ party: string }>();
|
||||||
|
|
||||||
useDocumentTitle(['Public keys', party || '-']);
|
useDocumentTitle(['Public keys', party || '-']);
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
const partyId = toNonHex(party ? party : '');
|
const partyId = toNonHex(party ? party : '');
|
||||||
const { isMobile } = useScreenDimensions();
|
const { isMobile } = useScreenDimensions();
|
||||||
const visibleChars = useMemo(() => (isMobile ? 10 : 14), [isMobile]);
|
const visibleChars = useMemo(() => (isMobile ? 10 : 14), [isMobile]);
|
||||||
@@ -28,71 +30,72 @@ const Party = () => {
|
|||||||
filters,
|
filters,
|
||||||
});
|
});
|
||||||
|
|
||||||
const partyRes = useExplorerPartyAssetsQuery({
|
const variables = useMemo(() => ({ partyId }), [partyId]);
|
||||||
// Don't cache data for this query, party information can move quite quickly
|
const {
|
||||||
fetchPolicy: 'network-only',
|
data: AccountData,
|
||||||
variables: { partyId: partyId },
|
loading: AccountLoading,
|
||||||
skip: !party,
|
error: AccountError,
|
||||||
|
} = useDataProvider({
|
||||||
|
dataProvider: aggregatedAccountsDataProvider,
|
||||||
|
variables,
|
||||||
});
|
});
|
||||||
|
|
||||||
const p = partyRes.data?.partiesConnection?.edges[0].node;
|
if (!isValidPartyId(partyId)) {
|
||||||
|
return (
|
||||||
const header = p?.id ? (
|
<div className="max-w-sm mx-auto">
|
||||||
<PageHeader
|
<Notification
|
||||||
title={p.id}
|
message={t('Invalid party ID')}
|
||||||
copy
|
intent={Intent.Danger}
|
||||||
truncateStart={visibleChars}
|
buttonProps={{
|
||||||
truncateEnd={visibleChars}
|
text: t('Go back'),
|
||||||
/>
|
action: () => navigate(-1),
|
||||||
) : (
|
className: 'py-1',
|
||||||
<Panel>
|
size: 'sm',
|
||||||
<p>No data found for public key {party}</p>
|
}}
|
||||||
</Panel>
|
/>
|
||||||
);
|
</div>
|
||||||
|
);
|
||||||
const staking = (
|
}
|
||||||
<section>
|
|
||||||
{p?.stakingSummary?.currentStakeAvailable ? (
|
|
||||||
<div className="mt-4 leading-3">
|
|
||||||
<strong className="font-semibold">{t('Staking Balance: ')}</strong>
|
|
||||||
<GovernanceAssetBalance
|
|
||||||
price={p.stakingSummary.currentStakeAvailable}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
|
|
||||||
const accounts = getNodes<ExplorerPartyAssetsAccountsFragment>(
|
|
||||||
p?.accountsConnection
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<h1
|
<PageHeader
|
||||||
className="font-alpha calt uppercase font-xl mb-4 text-vega-dark-100 dark:text-vega-light-100"
|
title={partyId}
|
||||||
data-testid="parties-header"
|
copy
|
||||||
>
|
truncateStart={visibleChars}
|
||||||
{t('Public key')}
|
truncateEnd={visibleChars}
|
||||||
</h1>
|
/>
|
||||||
{partyRes.data ? (
|
|
||||||
<>
|
|
||||||
{header}
|
|
||||||
<SubHeading>{t('Asset data')}</SubHeading>
|
|
||||||
{accounts ? <PartyAccounts accounts={accounts} /> : null}
|
|
||||||
{staking}
|
|
||||||
|
|
||||||
<SubHeading>{t('Transactions')}</SubHeading>
|
<div className="grid md:grid-flow-col grid-flow-row md:space-x-4 grid-cols-1 md:grid-cols-2 w-full">
|
||||||
<TxsInfiniteList
|
<PartyBlockAccounts
|
||||||
hasMoreTxs={hasMoreTxs}
|
accountError={AccountError}
|
||||||
areTxsLoading={loading}
|
accountLoading={AccountLoading}
|
||||||
txs={txsData}
|
accountData={AccountData}
|
||||||
loadMoreTxs={loadTxs}
|
partyId={partyId}
|
||||||
error={error}
|
/>
|
||||||
className="mb-28"
|
<PartyBlockStake
|
||||||
/>
|
accountError={AccountError}
|
||||||
</>
|
accountLoading={AccountLoading}
|
||||||
) : null}
|
partyId={partyId}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<SubHeading>{t('Transactions')}</SubHeading>
|
||||||
|
{!error && txsData ? (
|
||||||
|
<TxsInfiniteList
|
||||||
|
hasMoreTxs={hasMoreTxs}
|
||||||
|
areTxsLoading={loading}
|
||||||
|
txs={txsData}
|
||||||
|
loadMoreTxs={loadTxs}
|
||||||
|
error={error}
|
||||||
|
className="mb-28"
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<Splash>
|
||||||
|
<Icon name="error" className="mr-1" />
|
||||||
|
{t('Could not load transaction list for party')}
|
||||||
|
</Splash>
|
||||||
|
)}
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { Outlet } from 'react-router-dom';
|
||||||
|
|
||||||
|
const PartiesSubPage = () => {
|
||||||
|
return <Outlet />;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default PartiesSubPage;
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import React from 'react';
|
|
||||||
import { DATA_SOURCES } from '../../config';
|
|
||||||
import type { TendermintUnconfirmedTransactionsResponse } from '../txs/tendermint-unconfirmed-transactions-response.d';
|
|
||||||
import { TxList } from '../../components/txs';
|
|
||||||
import { RouteTitle } from '../../components/route-title';
|
|
||||||
import { t } from '@vegaprotocol/i18n';
|
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
|
||||||
import { useDocumentTitle } from '../../hooks/use-document-title';
|
|
||||||
|
|
||||||
const PendingTxs = () => {
|
|
||||||
const {
|
|
||||||
state: { data: unconfirmedTransactions },
|
|
||||||
} = useFetch<TendermintUnconfirmedTransactionsResponse>(
|
|
||||||
`${DATA_SOURCES.tendermintUrl}/unconfirmed_txs`
|
|
||||||
);
|
|
||||||
|
|
||||||
useDocumentTitle(['Pending transactions']);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<section>
|
|
||||||
<RouteTitle data-testid="unconfirmed-transactions-header">
|
|
||||||
{t('Unconfirmed transactions')}
|
|
||||||
</RouteTitle>
|
|
||||||
<br />
|
|
||||||
<div>{t(`Number: ${unconfirmedTransactions?.result?.n_txs || 0}`)}</div>
|
|
||||||
<br />
|
|
||||||
<div>
|
|
||||||
<br />
|
|
||||||
<TxList data={unconfirmedTransactions} />
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
export { PendingTxs };
|
|
||||||
@@ -14,7 +14,6 @@ import { Block } from './blocks/id';
|
|||||||
import { Blocks } from './blocks/home';
|
import { Blocks } from './blocks/home';
|
||||||
import { Tx } from './txs/id';
|
import { Tx } from './txs/id';
|
||||||
import { TxsList } from './txs/home';
|
import { TxsList } from './txs/home';
|
||||||
import { PendingTxs } from './pending';
|
|
||||||
import flags from '../config/flags';
|
import flags from '../config/flags';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { Routes } from './route-names';
|
import { Routes } from './route-names';
|
||||||
@@ -29,6 +28,7 @@ import compact from 'lodash/compact';
|
|||||||
import { AssetLink, MarketLink } from '../components/links';
|
import { AssetLink, MarketLink } from '../components/links';
|
||||||
import { truncateMiddle } from '@vegaprotocol/ui-toolkit';
|
import { truncateMiddle } from '@vegaprotocol/ui-toolkit';
|
||||||
import { remove0x } from '@vegaprotocol/utils';
|
import { remove0x } from '@vegaprotocol/utils';
|
||||||
|
import { PartyAccountsByAsset } from './parties/id/accounts';
|
||||||
|
|
||||||
export type Navigable = {
|
export type Navigable = {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -75,14 +75,43 @@ const partiesRoutes: Route[] = flags.parties
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: ':party',
|
path: ':party',
|
||||||
element: <PartySingle />,
|
element: <Party />,
|
||||||
handle: {
|
|
||||||
breadcrumb: (params: Params<string>) => (
|
children: [
|
||||||
<Link to={linkTo(Routes.PARTIES, params.party)}>
|
{
|
||||||
{truncateMiddle(params.party as string)}
|
index: true,
|
||||||
</Link>
|
element: <PartySingle />,
|
||||||
),
|
handle: {
|
||||||
},
|
breadcrumb: (params: Params<string>) => (
|
||||||
|
<Link to={linkTo(Routes.PARTIES, params.party)}>
|
||||||
|
{truncateMiddle(params.party as string)}
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'assets',
|
||||||
|
element: <Party />,
|
||||||
|
handle: {
|
||||||
|
breadcrumb: (params: Params<string>) => (
|
||||||
|
<Link to={linkTo(Routes.PARTIES, params.party)}>
|
||||||
|
{truncateMiddle(params.party as string)}
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
index: true,
|
||||||
|
element: <PartyAccountsByAsset />,
|
||||||
|
handle: {
|
||||||
|
breadcrumb: () => {
|
||||||
|
return t('Assets');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@@ -237,17 +266,6 @@ export const routerConfig: Route[] = [
|
|||||||
breadcrumb: () => <Link to={Routes.TX}>{t('Transactions')}</Link>,
|
breadcrumb: () => <Link to={Routes.TX}>{t('Transactions')}</Link>,
|
||||||
},
|
},
|
||||||
children: [
|
children: [
|
||||||
{
|
|
||||||
path: 'pending',
|
|
||||||
element: <PendingTxs />,
|
|
||||||
handle: {
|
|
||||||
breadcrumb: () => (
|
|
||||||
<Link to={linkTo(Routes.TX, 'pending')}>
|
|
||||||
{t('Pending transactions')}
|
|
||||||
</Link>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: ':txHash',
|
path: ':txHash',
|
||||||
element: <Tx />,
|
element: <Tx />,
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ interface TxDetailsProps {
|
|||||||
|
|
||||||
export const txDetailsTruncateLength = 30;
|
export const txDetailsTruncateLength = 30;
|
||||||
|
|
||||||
export const TxDetails = ({ txData, pubKey, className }: TxDetailsProps) => {
|
export const TxDetails = ({ txData, pubKey }: TxDetailsProps) => {
|
||||||
if (!txData) {
|
if (!txData) {
|
||||||
return <>{t('Awaiting Block Explorer transaction details')}</>;
|
return <>{t('Awaiting Block Explorer transaction details')}</>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ import {
|
|||||||
} from '@vegaprotocol/environment';
|
} from '@vegaprotocol/environment';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { NodeStatus, NodeStatusMapping } from '@vegaprotocol/types';
|
import { NodeStatus, NodeStatusMapping } from '@vegaprotocol/types';
|
||||||
|
import { PartyLink } from '../../components/links';
|
||||||
|
|
||||||
type RateProps = {
|
type RateProps = {
|
||||||
value: BigNumber | number | undefined;
|
value: BigNumber | number | undefined;
|
||||||
@@ -191,7 +192,9 @@ export const ValidatorsPage = () => {
|
|||||||
<KeyValueTable>
|
<KeyValueTable>
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
<div>{t('ID')}</div>
|
<div>{t('ID')}</div>
|
||||||
<div className="break-all text-xs">{v.id}</div>
|
<div className="break-all text-xs font-mono">
|
||||||
|
{v.id}
|
||||||
|
</div>
|
||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
<div>{t('Status')}</div>
|
<div>{t('Status')}</div>
|
||||||
@@ -218,12 +221,14 @@ export const ValidatorsPage = () => {
|
|||||||
</div>
|
</div>
|
||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
<div>{t('Public key')}</div>
|
<div>{t('Key')}</div>
|
||||||
<div className="break-all text-xs">{v.pubkey}</div>
|
<div className="break-all text-xs">
|
||||||
|
<PartyLink id={v.pubkey} />
|
||||||
|
</div>
|
||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
<div>{t('Ethereum address')}</div>
|
<div>{t('Ethereum address')}</div>
|
||||||
<div className="break-all text-xs">
|
<div className="break-all text-xs font-mono">
|
||||||
<EtherscanLink address={v.ethereumAddress} />{' '}
|
<EtherscanLink address={v.ethereumAddress} />{' '}
|
||||||
<CopyWithTooltip text={v.ethereumAddress}>
|
<CopyWithTooltip text={v.ethereumAddress}>
|
||||||
<button title={t('Copy address to clipboard')}>
|
<button title={t('Copy address to clipboard')}>
|
||||||
@@ -234,7 +239,9 @@ export const ValidatorsPage = () => {
|
|||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
<div>{t('Tendermint public key')}</div>
|
<div>{t('Tendermint public key')}</div>
|
||||||
<div className="break-all text-xs">{v.tmPubkey}</div>
|
<div className="break-all text-xs font-mono">
|
||||||
|
{v.tmPubkey}
|
||||||
|
</div>
|
||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
|
|
||||||
<KeyValueTableRow>
|
<KeyValueTableRow>
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
|
@import 'ag-grid-community/dist/styles/ag-grid.css';
|
||||||
|
@import 'ag-grid-community/dist/styles/ag-theme-balham.css';
|
||||||
|
@import 'ag-grid-community/dist/styles/ag-theme-balham-dark.css';
|
||||||
|
|
||||||
/* You can add global styles to this file, and also import other style files */
|
/* You can add global styles to this file, and also import other style files */
|
||||||
@tailwind base;
|
@tailwind base;
|
||||||
@tailwind components;
|
@tailwind components;
|
||||||
@@ -11,3 +15,48 @@
|
|||||||
.react-markdown-container a:before {
|
.react-markdown-container a:before {
|
||||||
content: '🔗 ';
|
content: '🔗 ';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* AG GRID - Do not edit without updating other global stylesheets for each app */
|
||||||
|
|
||||||
|
.vega-ag-grid .ag-root-wrapper {
|
||||||
|
border: solid 0px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vega-ag-grid .ag-react-container {
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vega-ag-grid .ag-cell,
|
||||||
|
.vega-ag-grid .ag-full-width-row .ag-cell-wrapper.ag-row-group {
|
||||||
|
line-height: calc(min(var(--ag-line-height, 26px), 26px) - 4px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vega-ag-grid .ag-row {
|
||||||
|
border-width: 1px 0;
|
||||||
|
border-bottom: 1px solid transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Light variables */
|
||||||
|
.ag-theme-balham {
|
||||||
|
--ag-background-color: theme(colors.white);
|
||||||
|
--ag-border-color: theme(colors.neutral[300]);
|
||||||
|
--ag-header-background-color: theme(colors.white);
|
||||||
|
--ag-odd-row-background-color: theme(colors.white);
|
||||||
|
--ag-header-column-separator-color: theme(colors.neutral[300]);
|
||||||
|
--ag-row-border-color: theme(colors.white);
|
||||||
|
--ag-row-hover-color: theme(colors.neutral[100]);
|
||||||
|
--ag-font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dark variables */
|
||||||
|
.ag-theme-balham-dark {
|
||||||
|
--ag-background-color: theme(colors.black);
|
||||||
|
--ag-border-color: theme(colors.neutral[700]);
|
||||||
|
--ag-header-background-color: theme(colors.black);
|
||||||
|
--ag-odd-row-background-color: theme(colors.black);
|
||||||
|
--ag-header-column-separator-color: theme(colors.neutral[600]);
|
||||||
|
--ag-row-border-color: theme(colors.black);
|
||||||
|
--ag-row-hover-color: theme(colors.neutral[800]);
|
||||||
|
--ag-font-size: 12px;
|
||||||
|
}
|
||||||
|
|||||||
@@ -5,20 +5,22 @@ NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
|||||||
NX_FAIRGROUND=false
|
NX_FAIRGROUND=false
|
||||||
NX_VEGA_NETWORKS={}
|
NX_VEGA_NETWORKS={}
|
||||||
|
|
||||||
NX_VEGA_URL=http://localhost:3028/query
|
NX_VEGA_URL=http://localhost:3008/graphql
|
||||||
NX_ETHEREUM_CHAIN_ID=1440
|
NX_ETHEREUM_CHAIN_ID=1440
|
||||||
NX_ETH_URL_CONNECT=1
|
NX_ETH_URL_CONNECT=1
|
||||||
NX_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session
|
NX_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session
|
||||||
NX_LOCAL_PROVIDER_URL=http://localhost:8545/
|
NX_LOCAL_PROVIDER_URL=http://localhost:8545/
|
||||||
|
NX_ETH_LOCAL_PROVIDER_URL=http://localhost:8545/
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet
|
||||||
NX_TRANCHES_SERVICE_URL=https://tranches-stagnet3-k8s.ops.vega.xyz
|
NX_TRANCHES_SERVICE_URL=https://tranches-stagnet1-k8s.ops.vega.xyz
|
||||||
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/test/announcements.json
|
||||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||||
|
NX_WALLETCONNECT_PROJECT_ID=fe8091dc35738863e509fc4947525c72
|
||||||
|
|
||||||
#Test configuration variables
|
#Test configuration variables
|
||||||
CYPRESS_FAIRGROUND=false
|
CYPRESS_FAIRGROUND=false
|
||||||
CYPRESS_VEGA_URL=http://localhost:3028/query
|
CYPRESS_VEGA_URL=http://localhost:3008/graphql
|
||||||
CYPRESS_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session
|
CYPRESS_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session
|
||||||
CYPRESS_ETHEREUM_PROVIDER_URL=http://localhost:8545
|
CYPRESS_ETHEREUM_PROVIDER_URL=http://localhost:8545
|
||||||
CYPRESS_EXPLORER_URL=https://explorer.fairground.wtf
|
CYPRESS_EXPLORER_URL=https://explorer.fairground.wtf
|
||||||
@@ -29,6 +31,5 @@ CYPRESS_VEGA_ENV=CUSTOM
|
|||||||
CYPRESS_VEGA_PUBLIC_KEY=02eceaba4df2bef76ea10caf728d8a099a2aa846cced25737cccaa9812342f65
|
CYPRESS_VEGA_PUBLIC_KEY=02eceaba4df2bef76ea10caf728d8a099a2aa846cced25737cccaa9812342f65
|
||||||
CYPRESS_VEGA_PUBLIC_KEY2=7f9cf07d3a9905b1a61a1069f7a758855da428bc0f4a97de87f48644bfc25535
|
CYPRESS_VEGA_PUBLIC_KEY2=7f9cf07d3a9905b1a61a1069f7a758855da428bc0f4a97de87f48644bfc25535
|
||||||
CYPRESS_VEGA_TOKEN_URL=https://token.fairground.wtf
|
CYPRESS_VEGA_TOKEN_URL=https://token.fairground.wtf
|
||||||
CYPRESS_VEGA_URL=http://localhost:3028/query
|
|
||||||
CYPRESS_VEGA_WALLET_URL=http://localhost:1789
|
CYPRESS_VEGA_WALLET_URL=http://localhost:1789
|
||||||
CYPRESS_VEGA_WALLET_API_TOKEN=
|
CYPRESS_VEGA_WALLET_API_TOKEN=
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_VEGA_ENV=MAINNET
|
NX_VEGA_ENV=MAINNET
|
||||||
NX_VEGA_URL=https://api.vega.xyz/query
|
NX_VEGA_URL=https://api.vega.community/graphql
|
||||||
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
NX_ETHEREUM_PROVIDER_URL=https://mainnet.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||||
NX_ETHERSCAN_URL=https://etherscan.io
|
NX_ETHERSCAN_URL=https://etherscan.io
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
# App configuration variables
|
|
||||||
NX_VEGA_ENV=STAGNET3
|
|
||||||
NX_VEGA_URL=https://api.stagnet3.vega.xyz/graphql
|
|
||||||
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_VEGA_ENV=TESTNET
|
NX_VEGA_ENV=TESTNET
|
||||||
NX_VEGA_URL=https://api.n11.testnet.vega.xyz/graphql
|
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
|
||||||
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ module.exports = defineConfig({
|
|||||||
viewportWidth: 1440,
|
viewportWidth: 1440,
|
||||||
viewportHeight: 900,
|
viewportHeight: 900,
|
||||||
numTestsKeptInMemory: 5,
|
numTestsKeptInMemory: 5,
|
||||||
|
testIsolation: false,
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
ethProviderUrl: 'http://localhost:8545/',
|
ethProviderUrl: 'http://localhost:8545/',
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
export const upgradeProposalsData = {
|
||||||
|
lastBlockHeight: '2014133',
|
||||||
|
protocolUpgradeProposals: {
|
||||||
|
edges: [
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
upgradeBlockHeight: '2015942',
|
||||||
|
vegaReleaseTag: 'v1',
|
||||||
|
approvers: [
|
||||||
|
'02a6531716b7a6d82779b7793c3ad2fcb47290ea2ff0912c56f61219bd9675ff',
|
||||||
|
'121934387281812a2d5e6913e5d57c0f85a8f169e2752347ee2e23b52d46623c',
|
||||||
|
'65c80e2f5f84e2109eec30810f137ba04cbbecaba8f27706c146cc6c6f90db29',
|
||||||
|
'bd6339d2428c79ac3bc9011771236d17bac92bcb1806423388d52fb440043aef',
|
||||||
|
],
|
||||||
|
status: 'PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED',
|
||||||
|
__typename: 'ProtocolUpgradeProposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProtocolUpgradeProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
upgradeBlockHeight: '1955065',
|
||||||
|
vegaReleaseTag: 'v0.71.0+dev-12156-bca1d57e',
|
||||||
|
approvers: [
|
||||||
|
'02a6531716b7a6d82779b7793c3ad2fcb47290ea2ff0912c56f61219bd9675ff',
|
||||||
|
'121934387281812a2d5e6913e5d57c0f85a8f169e2752347ee2e23b52d46623c',
|
||||||
|
'65c80e2f5f84e2109eec30810f137ba04cbbecaba8f27706c146cc6c6f90db29',
|
||||||
|
'bd6339d2428c79ac3bc9011771236d17bac92bcb1806423388d52fb440043aef',
|
||||||
|
],
|
||||||
|
status: 'PROTOCOL_UPGRADE_PROPOSAL_STATUS_APPROVED',
|
||||||
|
__typename: 'ProtocolUpgradeProposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProtocolUpgradeProposalEdge',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
__typename: 'ProtocolUpgradeProposalConnection',
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
export const nodeData = {
|
||||||
|
epoch: {
|
||||||
|
id: '204731',
|
||||||
|
timestamps: {
|
||||||
|
start: '2023-04-14T09:30:09.452005Z',
|
||||||
|
end: null,
|
||||||
|
expiry: '2023-04-14T09:31:09.452005Z',
|
||||||
|
__typename: 'EpochTimestamps',
|
||||||
|
},
|
||||||
|
__typename: 'Epoch',
|
||||||
|
},
|
||||||
|
nodesConnection: {
|
||||||
|
edges: [
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
avatarUrl:
|
||||||
|
'https://www.gravatar.com/avatar/y2hwc4xjds7zvlam3y4in94q2rcdimsn?d=identicon',
|
||||||
|
id: 'f337b5cc50c49a928e49129a2eca62277a81b4b7336b6e4131f8f0431e8db029',
|
||||||
|
name: 'lovely-fisherman',
|
||||||
|
pubkey:
|
||||||
|
'02a6531716b7a6d82779b7793c3ad2fcb47290ea2ff0912c56f61219bd9675ff',
|
||||||
|
stakedByOperator: '3000000000000000000000',
|
||||||
|
stakedByDelegates: '0',
|
||||||
|
stakedTotal: '3000000000000000000000',
|
||||||
|
pendingStake: '0',
|
||||||
|
rankingScore: {
|
||||||
|
rankingScore: '0.4999166805532412',
|
||||||
|
stakeScore: '0.2499583402766206',
|
||||||
|
performanceScore: '1',
|
||||||
|
votingPower: '2499',
|
||||||
|
status: 'VALIDATOR_NODE_STATUS_TENDERMINT',
|
||||||
|
__typename: 'RankingScore',
|
||||||
|
},
|
||||||
|
__typename: 'Node',
|
||||||
|
},
|
||||||
|
__typename: 'NodeEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
avatarUrl:
|
||||||
|
'https://www.gravatar.com/avatar/g1tw70qnoo0tf8ror30jefwhae92zy16?d=identicon',
|
||||||
|
id: 'cdadcf885556e372b6b39679d6ad46854d1d9c1e982da7ff2929544df01f9088',
|
||||||
|
name: 'magnificent-door',
|
||||||
|
pubkey:
|
||||||
|
'121934387281812a2d5e6913e5d57c0f85a8f169e2752347ee2e23b52d46623c',
|
||||||
|
stakedByOperator: '3000000000000000000000',
|
||||||
|
stakedByDelegates: '0',
|
||||||
|
stakedTotal: '3000000000000000000000',
|
||||||
|
pendingStake: '0',
|
||||||
|
rankingScore: {
|
||||||
|
rankingScore: '0.4999166805532412',
|
||||||
|
stakeScore: '0.2499583402766206',
|
||||||
|
performanceScore: '1',
|
||||||
|
votingPower: '2499',
|
||||||
|
status: 'VALIDATOR_NODE_STATUS_TENDERMINT',
|
||||||
|
__typename: 'RankingScore',
|
||||||
|
},
|
||||||
|
__typename: 'Node',
|
||||||
|
},
|
||||||
|
__typename: 'NodeEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
avatarUrl:
|
||||||
|
'https://www.gravatar.com/avatar/s2e7hp7soq5zdhxeap7p21onetsjiy6w?d=identicon',
|
||||||
|
id: '9a13de2548fef30d928e71e76004c98ec7ad9d8fc3ddcd16ddee210b28ea4cfc',
|
||||||
|
name: 'helpful-tree',
|
||||||
|
pubkey:
|
||||||
|
'bd6339d2428c79ac3bc9011771236d17bac92bcb1806423388d52fb440043aef',
|
||||||
|
stakedByOperator: '3000000000000000000000',
|
||||||
|
stakedByDelegates: '2000000000000000000',
|
||||||
|
stakedTotal: '3002000000000000000000',
|
||||||
|
pendingStake: '0',
|
||||||
|
rankingScore: {
|
||||||
|
rankingScore: '0.5002499583402766',
|
||||||
|
stakeScore: '0.2501249791701383',
|
||||||
|
performanceScore: '1',
|
||||||
|
votingPower: '2501',
|
||||||
|
status: 'VALIDATOR_NODE_STATUS_TENDERMINT',
|
||||||
|
__typename: 'RankingScore',
|
||||||
|
},
|
||||||
|
__typename: 'Node',
|
||||||
|
},
|
||||||
|
__typename: 'NodeEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
avatarUrl:
|
||||||
|
'https://www.gravatar.com/avatar/3gop683kg2cvd8rpv286hzagqt3yjsdq?d=identicon',
|
||||||
|
id: '93ac271ab95038333587e47d11461e6edc0126e6e77156281c545f4c5650a6d0',
|
||||||
|
name: 'easy-cookie',
|
||||||
|
pubkey:
|
||||||
|
'65c80e2f5f84e2109eec30810f137ba04cbbecaba8f27706c146cc6c6f90db29',
|
||||||
|
stakedByOperator: '3000000000000000000000',
|
||||||
|
stakedByDelegates: '0',
|
||||||
|
stakedTotal: '3000000000000000000000',
|
||||||
|
pendingStake: '0',
|
||||||
|
rankingScore: {
|
||||||
|
rankingScore: '0.4999166805532412',
|
||||||
|
stakeScore: '0.2499583402766206',
|
||||||
|
performanceScore: '1',
|
||||||
|
votingPower: '2499',
|
||||||
|
status: 'VALIDATOR_NODE_STATUS_TENDERMINT',
|
||||||
|
__typename: 'RankingScore',
|
||||||
|
},
|
||||||
|
__typename: 'Node',
|
||||||
|
},
|
||||||
|
__typename: 'NodeEdge',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
__typename: 'NodesConnection',
|
||||||
|
},
|
||||||
|
nodeData: {
|
||||||
|
stakedTotal: '12002000000000000000000',
|
||||||
|
__typename: 'NodeData',
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -0,0 +1,325 @@
|
|||||||
|
export const proposalsData = {
|
||||||
|
proposalsConnection: {
|
||||||
|
edges: [
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: 'e8ba9d268e12514644fd1fc7ff289292f4ce6489cc32cc73133aea52c04aef89',
|
||||||
|
rationale: {
|
||||||
|
title: 'Add asset Wrapped Ether',
|
||||||
|
description: 'Proposal to add asset WETH to Vega network',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: '',
|
||||||
|
state: 'STATE_OPEN',
|
||||||
|
datetime: '2026-12-01T11:41:28.654288Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2026-12-01T11:45:33Z',
|
||||||
|
enactmentDatetime: '2026-12-01T11:45:43Z',
|
||||||
|
change: {
|
||||||
|
name: 'Wrapped Ether',
|
||||||
|
symbol: 'WETH',
|
||||||
|
decimals: 18,
|
||||||
|
quantum: '0.0008',
|
||||||
|
source: {
|
||||||
|
contractAddress: '0x9B18C6CaD886D5653783E2B25759124760F4407F',
|
||||||
|
withdrawThreshold: '1',
|
||||||
|
lifetimeLimit: '400000000000000000',
|
||||||
|
__typename: 'ERC20',
|
||||||
|
},
|
||||||
|
__typename: 'NewAsset',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: 'd848fc7881f13d366df5f61ab139d5fcfa72bf838151bb51b54381870e357931',
|
||||||
|
rationale: {
|
||||||
|
title: 'Add asset Dai Stablecoin',
|
||||||
|
description: 'Proposal to add asset DAI to Vega network',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: '',
|
||||||
|
state: 'STATE_ENACTED',
|
||||||
|
datetime: '2022-11-29T15:49:57.80978Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2023-04-13T15:52:58Z',
|
||||||
|
enactmentDatetime: '2023-04-13T15:53:08Z',
|
||||||
|
change: {
|
||||||
|
name: 'Dai Stablecoin',
|
||||||
|
symbol: 'DAI',
|
||||||
|
decimals: 18,
|
||||||
|
quantum: '1',
|
||||||
|
source: {
|
||||||
|
contractAddress: '0xad018fB8ec00bfd622B91C83E684a6AC7bB8fbA4',
|
||||||
|
withdrawThreshold: '1',
|
||||||
|
lifetimeLimit: '500000000000000000000',
|
||||||
|
__typename: 'ERC20',
|
||||||
|
},
|
||||||
|
__typename: 'NewAsset',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: 'ccbd651b4a1167fd73c4a0340ac759fa0a31ca487ad46a13254b741ad71947ed',
|
||||||
|
rationale: {
|
||||||
|
title: 'New DAI market',
|
||||||
|
description: 'New DAI market',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: '0VFQusmmESdrP5GuL8naB6lxfoE3RPGaEeo7abdN',
|
||||||
|
state: 'STATE_ENACTED',
|
||||||
|
datetime: '2022-11-26T19:36:19.26034Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2022-11-26T19:36:42Z',
|
||||||
|
enactmentDatetime: '2023-03-22T13:57:37Z',
|
||||||
|
change: {
|
||||||
|
instrument: {
|
||||||
|
name: 'UNIDAI Monthly (Dec 2022)',
|
||||||
|
code: 'UNIDAI.MF21',
|
||||||
|
futureProduct: {
|
||||||
|
settlementAsset: { symbol: 'tDAI', __typename: 'Asset' },
|
||||||
|
__typename: 'FutureProduct',
|
||||||
|
},
|
||||||
|
__typename: 'InstrumentConfiguration',
|
||||||
|
},
|
||||||
|
__typename: 'NewMarket',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: 'bc70383f0e9515b15542cf4c63590cd2ca46b3363ba7c4a72af0e62112b3951b',
|
||||||
|
rationale: {
|
||||||
|
title: 'USDC-III',
|
||||||
|
description: 'USDC-III D List test',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: '',
|
||||||
|
state: 'STATE_ENACTED',
|
||||||
|
datetime: '2022-11-22T15:17:28.829605Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2022-11-22T15:18:56Z',
|
||||||
|
enactmentDatetime: '2022-11-22T15:19:06Z',
|
||||||
|
change: {
|
||||||
|
name: 'USDC-III',
|
||||||
|
symbol: 'USDC-III',
|
||||||
|
decimals: 18,
|
||||||
|
quantum: '1',
|
||||||
|
source: {
|
||||||
|
contractAddress: '0x1F1A067aEC530b66BA5128C9Db76825eC22c3C6b',
|
||||||
|
withdrawThreshold: '100000000000000000000000000',
|
||||||
|
lifetimeLimit: '1000000000000000000000000000',
|
||||||
|
__typename: 'ERC20',
|
||||||
|
},
|
||||||
|
__typename: 'NewAsset',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: '9d9b2a9d0179d0e4ccb317f6c4a5db0b905d893190bfb5e5499985ef313281c8',
|
||||||
|
rationale: {
|
||||||
|
title: 'New BTC market',
|
||||||
|
description: 'New BTC market',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: 'AXeRWS3TvLBFDgWOSHQpKFJf3NTbnWK6310q02fZ',
|
||||||
|
state: 'STATE_ENACTED',
|
||||||
|
datetime: '2022-11-26T19:36:19.26034Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2022-11-26T19:36:42Z',
|
||||||
|
enactmentDatetime: '2023-03-22T13:57:37Z',
|
||||||
|
change: {
|
||||||
|
instrument: {
|
||||||
|
name: 'ETHBTC Quarterly (Feb 2023)',
|
||||||
|
code: 'ETHBTC.QM21',
|
||||||
|
futureProduct: {
|
||||||
|
settlementAsset: { symbol: 'tBTC', __typename: 'Asset' },
|
||||||
|
__typename: 'FutureProduct',
|
||||||
|
},
|
||||||
|
__typename: 'InstrumentConfiguration',
|
||||||
|
},
|
||||||
|
__typename: 'NewMarket',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
node: {
|
||||||
|
id: '9c48796e7988769ededc2b2b02220b00e93f65f23e8141bf1fd23a6983d95943',
|
||||||
|
rationale: {
|
||||||
|
title: 'Update governance.proposal.asset.requiredMajority',
|
||||||
|
description:
|
||||||
|
'Proposal to update governance.proposal.asset.requiredMajority to 300}',
|
||||||
|
__typename: 'ProposalRationale',
|
||||||
|
},
|
||||||
|
reference: '',
|
||||||
|
state: 'STATE_ENACTED',
|
||||||
|
datetime: '2022-11-22T13:22:52.370655Z',
|
||||||
|
rejectionReason: null,
|
||||||
|
party: {
|
||||||
|
id: '69464e35bcb8e8a2900ca0f87acaf252d50cf2ab2fc73694845a16b7c8a0dc6f',
|
||||||
|
__typename: 'Party',
|
||||||
|
},
|
||||||
|
errorDetails: null,
|
||||||
|
terms: {
|
||||||
|
closingDatetime: '2022-11-22T13:27:13Z',
|
||||||
|
enactmentDatetime: '2022-11-22T13:27:33Z',
|
||||||
|
change: {
|
||||||
|
networkParameter: {
|
||||||
|
key: 'governance.proposal.asset.requiredParticipation',
|
||||||
|
value: '0.000001',
|
||||||
|
__typename: 'NetworkParameter',
|
||||||
|
},
|
||||||
|
__typename: 'UpdateNetworkParameter',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalTerms',
|
||||||
|
},
|
||||||
|
votes: {
|
||||||
|
yes: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
no: {
|
||||||
|
totalTokens: '0',
|
||||||
|
totalNumber: '0',
|
||||||
|
totalEquityLikeShareWeight: '0',
|
||||||
|
__typename: 'ProposalVoteSide',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalVotes',
|
||||||
|
},
|
||||||
|
__typename: 'Proposal',
|
||||||
|
},
|
||||||
|
__typename: 'ProposalEdge',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
__typename: 'ProposalsConnection',
|
||||||
|
},
|
||||||
|
};
|
||||||
@@ -9,7 +9,7 @@
|
|||||||
"name": "Token test market",
|
"name": "Token test market",
|
||||||
"code": "Token.24h",
|
"code": "Token.24h",
|
||||||
"future": {
|
"future": {
|
||||||
"settlementAsset": "fBTC",
|
"settlementAsset": "73174a6fb1d5802ba0ac7bd7ab79e0a3a4837b262de0a4e80815a55442692bd0",
|
||||||
"quoteName": "fBTC",
|
"quoteName": "fBTC",
|
||||||
"dataSourceSpecForSettlementData": {
|
"dataSourceSpecForSettlementData": {
|
||||||
"external": {
|
"external": {
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ import {
|
|||||||
navigation,
|
navigation,
|
||||||
} from '../../support/common.functions';
|
} from '../../support/common.functions';
|
||||||
import {
|
import {
|
||||||
convertUnixTimestampToDateformat,
|
|
||||||
createRawProposal,
|
createRawProposal,
|
||||||
createTenDigitUnixTimeStampForSpecifiedDays,
|
createTenDigitUnixTimeStampForSpecifiedDays,
|
||||||
enterUniqueFreeFormProposalBody,
|
enterUniqueFreeFormProposalBody,
|
||||||
generateFreeFormProposalTitle,
|
generateFreeFormProposalTitle,
|
||||||
getGovernanceProposalDateFormatForSpecifiedDays,
|
getDateFormatForSpecifiedDays,
|
||||||
getProposalIdFromList,
|
getProposalIdFromList,
|
||||||
getProposalInformationFromTable,
|
getProposalInformationFromTable,
|
||||||
getSubmittedProposalFromProposalList,
|
getSubmittedProposalFromProposalList,
|
||||||
@@ -23,6 +22,7 @@ import { ensureSpecifiedUnstakedTokensAreAssociated } from '../../../../governan
|
|||||||
import { ethereumWalletConnect } from '../../../../governance-e2e/src/support/wallet-eth.functions';
|
import { ethereumWalletConnect } from '../../../../governance-e2e/src/support/wallet-eth.functions';
|
||||||
import { vegaWalletSetSpecifiedApprovalAmount } from '../../../../governance-e2e/src/support/wallet-teardown.functions';
|
import { vegaWalletSetSpecifiedApprovalAmount } from '../../../../governance-e2e/src/support/wallet-teardown.functions';
|
||||||
import type { testFreeformProposal } from '../../support/common-interfaces';
|
import type { testFreeformProposal } from '../../support/common-interfaces';
|
||||||
|
import { formatDateWithLocalTimezone } from '@vegaprotocol/utils';
|
||||||
|
|
||||||
const proposalVoteProgressForPercentage =
|
const proposalVoteProgressForPercentage =
|
||||||
'[data-testid="vote-progress-indicator-percentage-for"]';
|
'[data-testid="vote-progress-indicator-percentage-for"]';
|
||||||
@@ -44,10 +44,12 @@ describe(
|
|||||||
function () {
|
function () {
|
||||||
before('connect wallets and set approval limit', function () {
|
before('connect wallets and set approval limit', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
vegaWalletSetSpecifiedApprovalAmount('1000');
|
ethereumWalletConnect();
|
||||||
|
cy.associateTokensToVegaWallet('1');
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit proposals tab', function () {
|
beforeEach('visit proposals tab', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -97,20 +99,22 @@ describe(
|
|||||||
getSubmittedProposalFromProposalList(proposalTitle).within(() =>
|
getSubmittedProposalFromProposalList(proposalTitle).within(() =>
|
||||||
cy.get(viewProposalButton).click()
|
cy.get(viewProposalButton).click()
|
||||||
);
|
);
|
||||||
convertUnixTimestampToDateformat(proposalTimeStamp).then(
|
cy.wrap(
|
||||||
(closingDate) => {
|
formatDateWithLocalTimezone(new Date(proposalTimeStamp * 1000))
|
||||||
getProposalInformationFromTable('Closes on')
|
).then((closingDate) => {
|
||||||
.contains(closingDate)
|
getProposalInformationFromTable('Closes on')
|
||||||
.should('be.visible');
|
.contains(closingDate)
|
||||||
}
|
.should('be.visible');
|
||||||
);
|
});
|
||||||
getGovernanceProposalDateFormatForSpecifiedDays(0).then(
|
cy.wrap(
|
||||||
(proposalDate) => {
|
formatDateWithLocalTimezone(
|
||||||
getProposalInformationFromTable('Proposed on')
|
new Date(createTenDigitUnixTimeStampForSpecifiedDays(0) * 1000)
|
||||||
.contains(proposalDate)
|
)
|
||||||
.should('be.visible');
|
).then((proposalDate) => {
|
||||||
}
|
getProposalInformationFromTable('Proposed on')
|
||||||
);
|
.contains(proposalDate)
|
||||||
|
.should('be.visible');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Newly created proposal details - shows default status set to fail', function () {
|
it('Newly created proposal details - shows default status set to fail', function () {
|
||||||
@@ -153,18 +157,16 @@ describe(
|
|||||||
cy.getByTestId('vote-buttons').contains('against').should('be.visible');
|
cy.getByTestId('vote-buttons').contains('against').should('be.visible');
|
||||||
cy.getByTestId('vote-buttons').contains('for').should('be.visible');
|
cy.getByTestId('vote-buttons').contains('for').should('be.visible');
|
||||||
voteForProposal('for');
|
voteForProposal('for');
|
||||||
getGovernanceProposalDateFormatForSpecifiedDays(0, 'shortMonth').then(
|
getDateFormatForSpecifiedDays(0).then((votedDate) => {
|
||||||
(votedDate) => {
|
// 3001-VOTE-051
|
||||||
// 3001-VOTE-051
|
// 3001-VOTE-093
|
||||||
// 3001-VOTE-093
|
cy.contains('You voted:')
|
||||||
cy.contains('You voted:')
|
.siblings()
|
||||||
.siblings()
|
.contains('For')
|
||||||
.contains('For')
|
.siblings()
|
||||||
.siblings()
|
.contains(votedDate)
|
||||||
.contains(votedDate)
|
.should('be.visible');
|
||||||
.should('be.visible');
|
});
|
||||||
}
|
|
||||||
);
|
|
||||||
cy.get(proposalVoteProgressForPercentage) // 3001-VOTE-072
|
cy.get(proposalVoteProgressForPercentage) // 3001-VOTE-072
|
||||||
.contains('100.00%')
|
.contains('100.00%')
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
@@ -213,11 +215,12 @@ describe(
|
|||||||
|
|
||||||
// 3001-VOTE-042, 3001-VOTE-057, 3001-VOTE-058, 3001-VOTE-059, 3001-VOTE-060
|
// 3001-VOTE-042, 3001-VOTE-057, 3001-VOTE-058, 3001-VOTE-059, 3001-VOTE-060
|
||||||
it('Newly created proposal details - ability to increase associated tokens - by voting again after association', function () {
|
it('Newly created proposal details - ability to increase associated tokens - by voting again after association', function () {
|
||||||
|
vegaWalletSetSpecifiedApprovalAmount('1000');
|
||||||
createRawProposal();
|
createRawProposal();
|
||||||
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
getSubmittedProposalFromProposalList(rawProposal.rationale.title)
|
getSubmittedProposalFromProposalList(
|
||||||
.as('submittedProposal')
|
rawProposal.rationale.title
|
||||||
.within(() => cy.get(viewProposalButton).click());
|
).within(() => cy.get(viewProposalButton).click());
|
||||||
});
|
});
|
||||||
voteForProposal('for');
|
voteForProposal('for');
|
||||||
// 3001-VOTE-079
|
// 3001-VOTE-079
|
||||||
@@ -235,9 +238,9 @@ describe(
|
|||||||
);
|
);
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
getSubmittedProposalFromProposalList(rawProposal.rationale.title)
|
getSubmittedProposalFromProposalList(
|
||||||
.as('submittedProposal')
|
rawProposal.rationale.title
|
||||||
.within(() => cy.get(viewProposalButton).click());
|
).within(() => cy.get(viewProposalButton).click());
|
||||||
});
|
});
|
||||||
cy.get(proposalVoteProgressForPercentage)
|
cy.get(proposalVoteProgressForPercentage)
|
||||||
.contains('100.00%')
|
.contains('100.00%')
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ import {
|
|||||||
createUpdateNetworkProposalTxBody,
|
createUpdateNetworkProposalTxBody,
|
||||||
createFreeFormProposalTxBody,
|
createFreeFormProposalTxBody,
|
||||||
} from '../../support/proposal.functions';
|
} from '../../support/proposal.functions';
|
||||||
import { ensureSpecifiedUnstakedTokensAreAssociated } from '../../support/staking.functions';
|
|
||||||
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
||||||
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-teardown.functions';
|
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-teardown.functions';
|
||||||
|
|
||||||
|
const proposalListItem = '[data-testid="proposals-list-item"]';
|
||||||
const closedProposals = '[data-testid="closed-proposals"]';
|
const closedProposals = '[data-testid="closed-proposals"]';
|
||||||
const proposalStatus = '[data-testid="proposal-status"]';
|
const proposalStatus = '[data-testid="proposal-status"]';
|
||||||
const viewProposalButton = '[data-testid="view-proposal-btn"]';
|
const viewProposalButton = '[data-testid="view-proposal-btn"]';
|
||||||
@@ -33,13 +33,10 @@ context(
|
|||||||
before('Connect wallets and set approval', function () {
|
before('Connect wallets and set approval', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
vegaWalletSetSpecifiedApprovalAmount('1000');
|
vegaWalletSetSpecifiedApprovalAmount('1000');
|
||||||
cy.connectVegaWallet();
|
|
||||||
ethereumWalletConnect();
|
|
||||||
ensureSpecifiedUnstakedTokensAreAssociated('1');
|
|
||||||
cy.clearLocalStorage();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit proposals', function () {
|
beforeEach('visit proposals', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -56,7 +53,8 @@ context(
|
|||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.get(closedProposals).within(() => {
|
cy.get(closedProposals).within(() => {
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil('[data-testid="proposals-list-item"]')
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get(proposalStatus).should('have.text', 'Enacted ');
|
cy.get(proposalStatus).should('have.text', 'Enacted ');
|
||||||
cy.get(viewProposalButton).click();
|
cy.get(viewProposalButton).click();
|
||||||
@@ -83,7 +81,8 @@ context(
|
|||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.get(openProposals).within(() => {
|
cy.get(openProposals).within(() => {
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil('[data-testid="proposals-list-item"]')
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => cy.get(viewProposalButton).click());
|
.within(() => cy.get(viewProposalButton).click());
|
||||||
});
|
});
|
||||||
getProposalInformationFromTable('State')
|
getProposalInformationFromTable('State')
|
||||||
@@ -114,9 +113,10 @@ context(
|
|||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.get(openProposals).within(() => {
|
cy.get(openProposals, { timeout: 6000 }).within(() => {
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil('[data-testid="proposals-list-item"]')
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => cy.get(viewProposalButton).click());
|
.within(() => cy.get(viewProposalButton).click());
|
||||||
});
|
});
|
||||||
getProposalInformationFromTable('State')
|
getProposalInformationFromTable('State')
|
||||||
@@ -138,7 +138,8 @@ context(
|
|||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.get(openProposals).within(() => {
|
cy.get(openProposals).within(() => {
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil('[data-testid="proposals-list-item"]')
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => cy.get(viewProposalButton).click());
|
.within(() => cy.get(viewProposalButton).click());
|
||||||
});
|
});
|
||||||
getProposalInformationFromTable('State')
|
getProposalInformationFromTable('State')
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ context(
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit governance tab', function () {
|
beforeEach('visit governance tab', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -232,7 +233,7 @@ context(
|
|||||||
|
|
||||||
it('Unable to create a freeform proposal - when json parent section contains unexpected field', function () {
|
it('Unable to create a freeform proposal - when json parent section contains unexpected field', function () {
|
||||||
const errorMsg =
|
const errorMsg =
|
||||||
'Invalid params: the transaction does not use a valid Vega command: unknown field unexpected" in vega.commands.v1.ProposalSubmission';
|
'Invalid params: the transaction does not use a valid Vega command: unknown field "unexpected" in vega.commands.v1.ProposalSubmission';
|
||||||
|
|
||||||
// 3001-VOTE-038 3002-PROP-013 3002-PROP-014
|
// 3001-VOTE-038 3002-PROP-013 3002-PROP-014
|
||||||
goToMakeNewProposal(governanceProposalType.RAW);
|
goToMakeNewProposal(governanceProposalType.RAW);
|
||||||
@@ -313,7 +314,7 @@ context(
|
|||||||
|
|
||||||
it('Unable to vote on a proposal - when vega wallet disconnected - option to connect from within', function () {
|
it('Unable to vote on a proposal - when vega wallet disconnected - option to connect from within', function () {
|
||||||
createRawProposal();
|
createRawProposal();
|
||||||
cy.get('[data-testid="manage-vega-wallet"]').click();
|
cy.get('[data-testid="manage-vega-wallet"]:visible').click();
|
||||||
cy.get('[data-testid="disconnect"]').click();
|
cy.get('[data-testid="disconnect"]').click();
|
||||||
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
getSubmittedProposalFromProposalList(
|
getSubmittedProposalFromProposalList(
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ const liquidityVoteStatus = 'liquidity-votes-status';
|
|||||||
const tokenVoteStatus = 'token-votes-status';
|
const tokenVoteStatus = 'token-votes-status';
|
||||||
const proposalTermsSection = 'proposal';
|
const proposalTermsSection = 'proposal';
|
||||||
const vegaWalletPublicKey = Cypress.env('vegaWalletPublicKey');
|
const vegaWalletPublicKey = Cypress.env('vegaWalletPublicKey');
|
||||||
|
const fUSDCId =
|
||||||
|
'816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc';
|
||||||
const epochTimeout = Cypress.env('epochTimeout');
|
const epochTimeout = Cypress.env('epochTimeout');
|
||||||
const proposalTimeout = { timeout: 14000 };
|
const proposalTimeout = { timeout: 14000 };
|
||||||
|
|
||||||
@@ -74,6 +76,7 @@ context(
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit governance tab', function () {
|
beforeEach('visit governance tab', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -218,7 +221,7 @@ context(
|
|||||||
|
|
||||||
it('Unable to submit new market proposal with missing/invalid fields', function () {
|
it('Unable to submit new market proposal with missing/invalid fields', function () {
|
||||||
const errorMsg =
|
const errorMsg =
|
||||||
'Invalid params: the transaction is not a valid Vega command: unknown field "filters" in vega.DataSourceDefinition';
|
'Invalid params: the transaction does not use a valid Vega command: unknown field "invalid" in vega.NewMarket';
|
||||||
|
|
||||||
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
|
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
|
||||||
cy.get(newProposalSubmitButton).should('be.visible').click();
|
cy.get(newProposalSubmitButton).should('be.visible').click();
|
||||||
@@ -264,7 +267,7 @@ context(
|
|||||||
it('Unable to submit update market proposal without minimum amount of tokens', function () {
|
it('Unable to submit update market proposal without minimum amount of tokens', function () {
|
||||||
vegaWalletTeardown();
|
vegaWalletTeardown();
|
||||||
vegaWalletFaucetAssetsWithoutCheck(
|
vegaWalletFaucetAssetsWithoutCheck(
|
||||||
'fUSDC',
|
fUSDCId,
|
||||||
'1000000',
|
'1000000',
|
||||||
vegaWalletPublicKey
|
vegaWalletPublicKey
|
||||||
);
|
);
|
||||||
@@ -290,7 +293,7 @@ context(
|
|||||||
// 3001-VOTE-092 3004-PMAC-001
|
// 3001-VOTE-092 3004-PMAC-001
|
||||||
it('Able to submit update market proposal and vote for proposal', function () {
|
it('Able to submit update market proposal and vote for proposal', function () {
|
||||||
vegaWalletFaucetAssetsWithoutCheck(
|
vegaWalletFaucetAssetsWithoutCheck(
|
||||||
'fUSDC',
|
fUSDCId,
|
||||||
'1000000',
|
'1000000',
|
||||||
vegaWalletPublicKey
|
vegaWalletPublicKey
|
||||||
);
|
);
|
||||||
@@ -302,7 +305,10 @@ context(
|
|||||||
cy.get('dd').eq(0).should('have.text', 'Test market 1');
|
cy.get('dd').eq(0).should('have.text', 'Test market 1');
|
||||||
cy.get('dd').eq(1).should('have.text', 'TEST.24h');
|
cy.get('dd').eq(1).should('have.text', 'TEST.24h');
|
||||||
cy.get('dd').eq(2).should('not.be.empty');
|
cy.get('dd').eq(2).should('not.be.empty');
|
||||||
cy.get('dd').eq(2).invoke('text').as('EnactedMarketId');
|
cy.get('dd')
|
||||||
|
.eq(2)
|
||||||
|
.invoke('text')
|
||||||
|
.as('EnactedMarketId', { type: 'static' });
|
||||||
});
|
});
|
||||||
cy.get('@EnactedMarketId').then((marketId) => {
|
cy.get('@EnactedMarketId').then((marketId) => {
|
||||||
cy.VegaWalletSubmitLiquidityProvision(String(marketId), '1');
|
cy.VegaWalletSubmitLiquidityProvision(String(marketId), '1');
|
||||||
@@ -320,6 +326,7 @@ context(
|
|||||||
cy.get('@EnactedMarketId').then((marketId) => {
|
cy.get('@EnactedMarketId').then((marketId) => {
|
||||||
cy.contains(String(marketId))
|
cy.contains(String(marketId))
|
||||||
.parentsUntil(proposalListItem)
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId(viewProposalBtn).click();
|
cy.getByTestId(viewProposalBtn).click();
|
||||||
});
|
});
|
||||||
@@ -373,16 +380,19 @@ context(
|
|||||||
cy.get(newProposalSubmitButton).should('be.visible').click();
|
cy.get(newProposalSubmitButton).should('be.visible').click();
|
||||||
// cannot submit a proposal with ERC20 address already in use
|
// cannot submit a proposal with ERC20 address already in use
|
||||||
cy.contains('Proposal rejected', proposalTimeout).should('be.visible');
|
cy.contains('Proposal rejected', proposalTimeout).should('be.visible');
|
||||||
cy.getByTestId('dialog-content').within(() => {
|
cy.getByTestId('dialog-content')
|
||||||
cy.get('p').should(
|
.last()
|
||||||
'have.text',
|
.within(() => {
|
||||||
'PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE'
|
cy.get('p').should(
|
||||||
);
|
'have.text',
|
||||||
});
|
'PROPOSAL_ERROR_ERC20_ADDRESS_ALREADY_IN_USE'
|
||||||
|
);
|
||||||
|
});
|
||||||
closeDialog();
|
closeDialog();
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil(proposalListItem)
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId(viewProposalBtn).click();
|
cy.getByTestId(viewProposalBtn).click();
|
||||||
});
|
});
|
||||||
@@ -420,6 +430,7 @@ context(
|
|||||||
cy.get(proposalType)
|
cy.get(proposalType)
|
||||||
.contains('Update asset')
|
.contains('Update asset')
|
||||||
.parentsUntil(proposalListItem)
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get(proposalDetails).should('contain.text', assetId); // 3001-VOTE-029
|
cy.get(proposalDetails).should('contain.text', assetId); // 3001-VOTE-029
|
||||||
cy.getByTestId(viewProposalBtn).click();
|
cy.getByTestId(viewProposalBtn).click();
|
||||||
@@ -436,7 +447,7 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it.only('Able to submit update asset proposal using max deadline', function () {
|
it('Able to submit update asset proposal using max deadline', function () {
|
||||||
goToMakeNewProposal(governanceProposalType.UPDATE_ASSET);
|
goToMakeNewProposal(governanceProposalType.UPDATE_ASSET);
|
||||||
enterUpdateAssetProposalDetails();
|
enterUpdateAssetProposalDetails();
|
||||||
cy.get(maxVoteDeadline).click();
|
cy.get(maxVoteDeadline).click();
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import {
|
|||||||
generateFreeFormProposalTitle,
|
generateFreeFormProposalTitle,
|
||||||
getProposalIdFromList,
|
getProposalIdFromList,
|
||||||
getProposalInformationFromTable,
|
getProposalInformationFromTable,
|
||||||
getSortOrderOfSuppliedArray,
|
|
||||||
getSubmittedProposalFromProposalList,
|
getSubmittedProposalFromProposalList,
|
||||||
goToMakeNewProposal,
|
goToMakeNewProposal,
|
||||||
governanceProposalType,
|
governanceProposalType,
|
||||||
@@ -24,9 +23,9 @@ import { ensureSpecifiedUnstakedTokensAreAssociated } from '../../support/stakin
|
|||||||
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
||||||
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-teardown.functions';
|
import { vegaWalletSetSpecifiedApprovalAmount } from '../../support/wallet-teardown.functions';
|
||||||
|
|
||||||
const proposalDetailsTitle = '[data-testid="proposal-title"]';
|
|
||||||
const openProposals = '[data-testid="open-proposals"]';
|
const openProposals = '[data-testid="open-proposals"]';
|
||||||
const voteStatus = '[data-testid="vote-status"]';
|
const voteStatus = '[data-testid="vote-status"]';
|
||||||
|
const proposalClosingDate = '[data-testid="vote-details"]';
|
||||||
const viewProposalButton = '[data-testid="view-proposal-btn"]';
|
const viewProposalButton = '[data-testid="view-proposal-btn"]';
|
||||||
|
|
||||||
describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
||||||
@@ -36,6 +35,7 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit proposals tab', function () {
|
beforeEach('visit proposals tab', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -45,16 +45,8 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('Newly created proposals list - proposals closest to closing date appear higher in list', function () {
|
it('Newly created proposals list - proposals closest to closing date appear higher in list', function () {
|
||||||
const minCloseDays = 2;
|
|
||||||
const maxCloseDays = 3;
|
|
||||||
|
|
||||||
// 3001-VOTE-005
|
// 3001-VOTE-005
|
||||||
const proposalDays = [
|
const proposalDays = [364, 50, 2];
|
||||||
minCloseDays + 1,
|
|
||||||
maxCloseDays,
|
|
||||||
minCloseDays + 3,
|
|
||||||
minCloseDays + 2,
|
|
||||||
];
|
|
||||||
for (let index = 0; index < proposalDays.length; index++) {
|
for (let index = 0; index < proposalDays.length; index++) {
|
||||||
goToMakeNewProposal(governanceProposalType.RAW);
|
goToMakeNewProposal(governanceProposalType.RAW);
|
||||||
enterRawProposalBody(
|
enterRawProposalBody(
|
||||||
@@ -64,19 +56,15 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
waitForProposalSync();
|
waitForProposalSync();
|
||||||
}
|
}
|
||||||
|
|
||||||
const arrayOfProposals: string[] = [];
|
|
||||||
|
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
cy.get(proposalDetailsTitle)
|
cy.get(openProposals).within(() => {
|
||||||
.each((proposalTitleElement) => {
|
cy.get(proposalClosingDate).first().should('contain.text', 'year');
|
||||||
arrayOfProposals.push(proposalTitleElement.text());
|
cy.get(proposalClosingDate).should('contain.text', 'months');
|
||||||
})
|
cy.get(proposalClosingDate)
|
||||||
.then(() => {
|
.last()
|
||||||
cy.wrap(getSortOrderOfSuppliedArray(arrayOfProposals)).should(
|
.invoke('text')
|
||||||
'equal',
|
.should('match', /days|minutes/);
|
||||||
'descending'
|
});
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Newly created proposals list - able to filter by proposerID to show it in list', function () {
|
it('Newly created proposals list - able to filter by proposerID to show it in list', function () {
|
||||||
|
|||||||
@@ -25,9 +25,10 @@ const rewardsTimeOut = { timeout: 60000 };
|
|||||||
|
|
||||||
context('rewards - flow', { tags: '@slow' }, function () {
|
context('rewards - flow', { tags: '@slow' }, function () {
|
||||||
before('set up environment to allow rewards', function () {
|
before('set up environment to allow rewards', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
depositAsset(vegaAssetAddress, '1000');
|
depositAsset(vegaAssetAddress, '1000', 18);
|
||||||
cy.validatorsSelfDelegate();
|
cy.validatorsSelfDelegate();
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -56,7 +57,7 @@ context('rewards - flow', { tags: '@slow' }, function () {
|
|||||||
cy.getByTestId(rewardsTable)
|
cy.getByTestId(rewardsTable)
|
||||||
.first()
|
.first()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId('asset').should('have.text', 'Vega');
|
cy.getByTestId('asset', rewardsTimeOut).should('have.text', 'Vega');
|
||||||
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD').should('have.text', '1');
|
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD').should('have.text', '1');
|
||||||
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE').should(
|
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
@@ -93,13 +94,13 @@ context('rewards - flow', { tags: '@slow' }, function () {
|
|||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get('h2').first().should('contain.text', 'EPOCH');
|
cy.get('h2').first().should('contain.text', 'EPOCH');
|
||||||
cy.getByTestId('individual-rewards-asset').should('have.text', 'Vega');
|
cy.getByTestId('individual-rewards-asset').should('have.text', 'Vega');
|
||||||
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD')
|
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD', rewardsTimeOut)
|
||||||
.should('contain.text', '0.1177')
|
.should('contain.text', '0.4415')
|
||||||
.and('contain.text', '(11.7733%)');
|
.and('contain.text', '(44.15%)');
|
||||||
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE')
|
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE')
|
||||||
.should('contain.text', '0.0001')
|
.should('contain.text', '0.0004')
|
||||||
.and('contain.text', '(11.7733%)');
|
.and('contain.text', '(44.15%)');
|
||||||
cy.getByTestId('total').should('have.text', '0.1179');
|
cy.getByTestId('total').should('have.text', '0.4419');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -40,12 +40,15 @@ const stakeAddStakeRadioButton = 'add-stake-radio';
|
|||||||
const stakeMaximumTokens = 'token-amount-use-maximum';
|
const stakeMaximumTokens = 'token-amount-use-maximum';
|
||||||
const vegaWalletAssociatedBalance = 'currency-value';
|
const vegaWalletAssociatedBalance = 'currency-value';
|
||||||
const vegaWalletStakedBalances = 'vega-wallet-balance-staked-validators';
|
const vegaWalletStakedBalances = 'vega-wallet-balance-staked-validators';
|
||||||
const ethWalletContainer = 'ethereum-wallet';
|
const ethWallet = 'ethereum-wallet';
|
||||||
const vegaWallet = 'vega-wallet';
|
const vegaWallet = 'vega-wallet';
|
||||||
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
|
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
|
||||||
const txTimeout = Cypress.env('txTimeout');
|
const txTimeout = Cypress.env('txTimeout');
|
||||||
const epochTimeout = Cypress.env('epochTimeout');
|
const epochTimeout = Cypress.env('epochTimeout');
|
||||||
|
|
||||||
|
const getEthereumWallet = () => cy.get(`[data-testid="${ethWallet}"]:visible`);
|
||||||
|
const getVegaWallet = () => cy.get(`[data-testid="${vegaWallet}"]:visible`);
|
||||||
|
|
||||||
context(
|
context(
|
||||||
'Staking Tab - with eth and vega wallets connected',
|
'Staking Tab - with eth and vega wallets connected',
|
||||||
{ tags: '@slow' },
|
{ tags: '@slow' },
|
||||||
@@ -63,6 +66,7 @@ context(
|
|||||||
beforeEach(
|
beforeEach(
|
||||||
'teardown wallet & drill into a specific validator',
|
'teardown wallet & drill into a specific validator',
|
||||||
function () {
|
function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -187,31 +191,35 @@ context(
|
|||||||
.should('contain', 1.0, txTimeout);
|
.should('contain', 1.0, txTimeout);
|
||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
navigateTo(navigation.validators);
|
navigateTo(navigation.validators);
|
||||||
cy.get(`[row-id="${0}"]`).within(() => {
|
cy.get(`[row-id="${0}"]`)
|
||||||
cy.getByTestId(stakeValidatorListTotalStake)
|
.eq(1)
|
||||||
.should('have.text', '2.00')
|
.within(() => {
|
||||||
.and('be.visible');
|
cy.getByTestId(stakeValidatorListTotalStake)
|
||||||
cy.getByTestId(stakeValidatorListTotalShare)
|
.should('have.text', '2.00')
|
||||||
.should('have.text', '66.67%')
|
.and('be.visible');
|
||||||
.and('be.visible');
|
cy.getByTestId(stakeValidatorListTotalShare)
|
||||||
cy.getByTestId(stakeValidatorListTotalStake)
|
.should('have.text', '66.67%')
|
||||||
.scrollIntoView()
|
.and('be.visible');
|
||||||
.should('have.text', '2.00')
|
cy.getByTestId(stakeValidatorListTotalStake)
|
||||||
.and('be.visible');
|
.scrollIntoView()
|
||||||
});
|
.should('have.text', '2.00')
|
||||||
cy.get(`[row-id="${1}"]`).within(() => {
|
.and('be.visible');
|
||||||
cy.getByTestId(stakeValidatorListTotalStake)
|
});
|
||||||
.scrollIntoView()
|
cy.get(`[row-id="${1}"]`)
|
||||||
.should('have.text', '1.00')
|
.eq(1)
|
||||||
.and('be.visible');
|
.within(() => {
|
||||||
cy.getByTestId(stakeValidatorListTotalShare)
|
cy.getByTestId(stakeValidatorListTotalStake)
|
||||||
.should('have.text', '33.33%')
|
.scrollIntoView()
|
||||||
.and('be.visible');
|
.should('have.text', '1.00')
|
||||||
cy.getByTestId(stakeValidatorListTotalStake)
|
.and('be.visible');
|
||||||
.scrollIntoView()
|
cy.getByTestId(stakeValidatorListTotalShare)
|
||||||
.should('have.text', '1.00')
|
.should('have.text', '33.33%')
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
});
|
cy.getByTestId(stakeValidatorListTotalStake)
|
||||||
|
.scrollIntoView()
|
||||||
|
.should('have.text', '1.00')
|
||||||
|
.and('be.visible');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 2001-STKE-041
|
// 2001-STKE-041
|
||||||
@@ -329,11 +337,11 @@ context(
|
|||||||
verifyStakedBalance(2.0);
|
verifyStakedBalance(2.0);
|
||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
stakingPageDisassociateAllTokens();
|
stakingPageDisassociateAllTokens();
|
||||||
cy.getByTestId(ethWalletContainer).within(() => {
|
getEthereumWallet().within(() => {
|
||||||
cy.contains(vegaWalletPublicKeyShort, txTimeout).should('not.exist');
|
cy.contains(vegaWalletPublicKeyShort, txTimeout).should('not.exist');
|
||||||
});
|
});
|
||||||
verifyEthWalletTotalAssociatedBalance('0.0');
|
verifyEthWalletTotalAssociatedBalance('0.0');
|
||||||
cy.getByTestId(vegaWallet).within(() => {
|
getVegaWallet().within(() => {
|
||||||
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
'contain',
|
'contain',
|
||||||
'0.00'
|
'0.00'
|
||||||
@@ -357,11 +365,11 @@ context(
|
|||||||
verifyStakedBalance(2.0);
|
verifyStakedBalance(2.0);
|
||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
stakingPageDisassociateAllTokens('contract');
|
stakingPageDisassociateAllTokens('contract');
|
||||||
cy.getByTestId(ethWalletContainer).within(() => {
|
getEthereumWallet().within(() => {
|
||||||
cy.contains(vegaWalletPublicKeyShort, txTimeout).should('not.exist');
|
cy.contains(vegaWalletPublicKeyShort, txTimeout).should('not.exist');
|
||||||
});
|
});
|
||||||
verifyEthWalletTotalAssociatedBalance('0.0');
|
verifyEthWalletTotalAssociatedBalance('0.0');
|
||||||
cy.getByTestId(vegaWallet).within(() => {
|
getVegaWallet().within(() => {
|
||||||
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
'contain',
|
'contain',
|
||||||
'0.00'
|
'0.00'
|
||||||
@@ -386,7 +394,7 @@ context(
|
|||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
stakingPageDisassociateTokens('1');
|
stakingPageDisassociateTokens('1');
|
||||||
verifyEthWalletTotalAssociatedBalance('2.0');
|
verifyEthWalletTotalAssociatedBalance('2.0');
|
||||||
cy.getByTestId(vegaWallet).within(() => {
|
getVegaWallet().within(() => {
|
||||||
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
'contain',
|
'contain',
|
||||||
'2.00'
|
'2.00'
|
||||||
@@ -453,7 +461,7 @@ context(
|
|||||||
verifyUnstakedBalance(0.0);
|
verifyUnstakedBalance(0.0);
|
||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
stakingPageAssociateTokens('6');
|
stakingPageAssociateTokens('6');
|
||||||
cy.getByTestId(vegaWallet).within(() => {
|
getVegaWallet().within(() => {
|
||||||
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
cy.getByTestId(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
'contain',
|
'contain',
|
||||||
'12.00'
|
'12.00'
|
||||||
|
|||||||
@@ -25,11 +25,11 @@ const vegaWalletUnstakedBalance =
|
|||||||
'[data-testid="vega-wallet-balance-unstaked"]';
|
'[data-testid="vega-wallet-balance-unstaked"]';
|
||||||
const txTimeout = Cypress.env('txTimeout');
|
const txTimeout = Cypress.env('txTimeout');
|
||||||
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
|
const vegaWalletPublicKeyShort = Cypress.env('vegaWalletPublicKeyShort');
|
||||||
const ethWalletAssociateButton = '[data-testid="associate-btn"]';
|
const ethWalletAssociateButton = '[data-testid="associate-btn"]:visible';
|
||||||
const associateWalletRadioButton = '[data-testid="associate-radio-wallet"]';
|
const associateWalletRadioButton = '[data-testid="associate-radio-wallet"]';
|
||||||
const tokenAmountInputBox = '[data-testid="token-amount-input"]';
|
const tokenAmountInputBox = '[data-testid="token-amount-input"]';
|
||||||
const tokenSubmitButton = '[data-testid="token-input-submit-button"]';
|
const tokenSubmitButton = '[data-testid="token-input-submit-button"]';
|
||||||
const ethWalletDissociateButton = '[href="/token/disassociate"]';
|
const ethWalletDissociateButton = '[href="/token/disassociate"]:visible';
|
||||||
const vestingContractSection = '[data-testid="vega-in-vesting-contract"]';
|
const vestingContractSection = '[data-testid="vega-in-vesting-contract"]';
|
||||||
const vegaInWalletSection = '[data-testid="vega-in-wallet"]';
|
const vegaInWalletSection = '[data-testid="vega-in-wallet"]';
|
||||||
const connectedVegaKey = '[data-testid="connected-vega-key"]';
|
const connectedVegaKey = '[data-testid="connected-vega-key"]';
|
||||||
@@ -53,6 +53,7 @@ context(
|
|||||||
beforeEach(
|
beforeEach(
|
||||||
'teardown wallet & drill into a specific validator',
|
'teardown wallet & drill into a specific validator',
|
||||||
function () {
|
function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -78,21 +79,26 @@ context(
|
|||||||
|
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '0.00');
|
validateWalletCurrency('Associated', '0.00');
|
||||||
validateWalletCurrency('Pending association', '2.00');
|
validateWalletCurrency('Pending association', '2.00');
|
||||||
validateWalletCurrency('Total associated after pending', '2.00');
|
validateWalletCurrency('Total associated after pending', '2.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
|
|
||||||
// 0005-ETXN-002
|
// 0005-ETXN-002
|
||||||
verifyEthWalletAssociatedBalance('2.0');
|
verifyEthWalletAssociatedBalance('2.0');
|
||||||
|
|
||||||
verifyEthWalletTotalAssociatedBalance('2.0');
|
verifyEthWalletTotalAssociatedBalance('2.0');
|
||||||
|
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 2.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
2.0
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should('contain', 2.0);
|
cy.get(vegaWalletUnstakedBalance, txTimeout).should('contain', 2.0);
|
||||||
});
|
});
|
||||||
@@ -111,12 +117,12 @@ context(
|
|||||||
stakingPageDisassociateTokens('2');
|
stakingPageDisassociateTokens('2');
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '2.00');
|
validateWalletCurrency('Associated', '2.00');
|
||||||
validateWalletCurrency('Pending association', '2.00');
|
validateWalletCurrency('Pending association', '2.00');
|
||||||
validateWalletCurrency('Total associated after pending', '0.00');
|
validateWalletCurrency('Total associated after pending', '0.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
cy.getByTestId('eth-wallet-associated-balances', txTimeout).should(
|
cy.getByTestId('eth-wallet-associated-balances', txTimeout).should(
|
||||||
'not.exist'
|
'not.exist'
|
||||||
);
|
);
|
||||||
@@ -128,26 +134,38 @@ context(
|
|||||||
stakingPageAssociateTokens('1001', { approve: true });
|
stakingPageAssociateTokens('1001', { approve: true });
|
||||||
verifyEthWalletAssociatedBalance('1,001.00');
|
verifyEthWalletAssociatedBalance('1,001.00');
|
||||||
verifyEthWalletTotalAssociatedBalance('1,001.00');
|
verifyEthWalletTotalAssociatedBalance('1,001.00');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
.last()
|
||||||
'contain',
|
.within(() => {
|
||||||
'1,001.00'
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
);
|
'contain',
|
||||||
});
|
'1,001.00'
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to disassociate a partial amount of tokens currently associated', function () {
|
it('Able to disassociate a partial amount of tokens currently associated', function () {
|
||||||
stakingPageAssociateTokens('2');
|
stakingPageAssociateTokens('2');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 2.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
2.0
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
cy.get('button').contains('Select a validator to nominate').click();
|
cy.get('button').contains('Select a validator to nominate').click();
|
||||||
stakingPageDisassociateTokens('1');
|
stakingPageDisassociateTokens('1');
|
||||||
verifyEthWalletAssociatedBalance('1.0');
|
verifyEthWalletAssociatedBalance('1.0');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 1.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
1.0
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to disassociate all tokens - using max', function () {
|
it('Able to disassociate all tokens - using max', function () {
|
||||||
@@ -155,26 +173,40 @@ context(
|
|||||||
const warningText =
|
const warningText =
|
||||||
'Warning: Any tokens that have been nominated to a node will sacrifice rewards they are due for the current epoch. If you do not wish to sacrifice these, you should remove stake from a node at the end of an epoch before disassociation.';
|
'Warning: Any tokens that have been nominated to a node will sacrifice rewards they are due for the current epoch. If you do not wish to sacrifice these, you should remove stake from a node at the end of an epoch before disassociation.';
|
||||||
stakingPageAssociateTokens('2');
|
stakingPageAssociateTokens('2');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 2.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
2.0
|
||||||
|
);
|
||||||
|
});
|
||||||
cy.get('button').contains('Select a validator to nominate').click();
|
cy.get('button').contains('Select a validator to nominate').click();
|
||||||
cy.get(ethWalletDissociateButton).click();
|
cy.get(ethWalletDissociateButton).click();
|
||||||
cy.get(disassociationWarning).should('contain', warningText);
|
cy.get(disassociationWarning).should('contain', warningText);
|
||||||
stakingPageDisassociateAllTokens();
|
stakingPageDisassociateAllTokens();
|
||||||
cy.get(ethWalletContainer).within(() => {
|
cy.get(ethWalletContainer)
|
||||||
cy.contains(vegaWalletPublicKeyShort, { timeout: 20000 }).should(
|
.first()
|
||||||
'not.exist'
|
.within(() => {
|
||||||
);
|
cy.contains(vegaWalletPublicKeyShort, { timeout: 20000 }).should(
|
||||||
});
|
'not.exist'
|
||||||
cy.get(ethWalletContainer).within(() => {
|
);
|
||||||
cy.contains(vegaWalletPublicKeyShort, { timeout: 20000 }).should(
|
});
|
||||||
'not.exist'
|
cy.get(ethWalletContainer)
|
||||||
);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.contains(vegaWalletPublicKeyShort, { timeout: 20000 }).should(
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 0.0);
|
'not.exist'
|
||||||
});
|
);
|
||||||
|
});
|
||||||
|
cy.get(vegaWallet)
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
0.0
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to associate and disassociate vesting contract tokens', function () {
|
it('Able to associate and disassociate vesting contract tokens', function () {
|
||||||
@@ -192,17 +224,22 @@ context(
|
|||||||
|
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '0.00');
|
validateWalletCurrency('Associated', '0.00');
|
||||||
validateWalletCurrency('Pending association', '2.00');
|
validateWalletCurrency('Pending association', '2.00');
|
||||||
validateWalletCurrency('Total associated after pending', '2.00');
|
validateWalletCurrency('Total associated after pending', '2.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
verifyEthWalletAssociatedBalance('2.0');
|
verifyEthWalletAssociatedBalance('2.0');
|
||||||
verifyEthWalletTotalAssociatedBalance('2.0');
|
verifyEthWalletTotalAssociatedBalance('2.0');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 2.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
2.0
|
||||||
|
);
|
||||||
|
});
|
||||||
cy.get(vegaWalletUnstakedBalance, txTimeout).should('contain', 2.0);
|
cy.get(vegaWalletUnstakedBalance, txTimeout).should('contain', 2.0);
|
||||||
stakingPageDisassociateTokens('1', {
|
stakingPageDisassociateTokens('1', {
|
||||||
type: 'contract',
|
type: 'contract',
|
||||||
@@ -210,12 +247,12 @@ context(
|
|||||||
});
|
});
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '2.00');
|
validateWalletCurrency('Associated', '2.00');
|
||||||
validateWalletCurrency('Pending association', '1.00');
|
validateWalletCurrency('Pending association', '1.00');
|
||||||
validateWalletCurrency('Total associated after pending', '1.00');
|
validateWalletCurrency('Total associated after pending', '1.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
verifyEthWalletAssociatedBalance('1.0');
|
verifyEthWalletAssociatedBalance('1.0');
|
||||||
verifyEthWalletTotalAssociatedBalance('1.0');
|
verifyEthWalletTotalAssociatedBalance('1.0');
|
||||||
});
|
});
|
||||||
@@ -228,45 +265,68 @@ context(
|
|||||||
stakingPageAssociateTokens('21', { type: 'wallet' });
|
stakingPageAssociateTokens('21', { type: 'wallet' });
|
||||||
cy.get('button').contains('Select a validator to nominate').click();
|
cy.get('button').contains('Select a validator to nominate').click();
|
||||||
stakingPageAssociateTokens('37', { type: 'contract' });
|
stakingPageAssociateTokens('37', { type: 'contract' });
|
||||||
cy.get(vestingContractSection).within(() => {
|
cy.get(vestingContractSection)
|
||||||
cy.get(associatedKey).should(
|
.first()
|
||||||
'contain',
|
.within(() => {
|
||||||
Cypress.env('vegaWalletPublicKeyShort')
|
cy.get(associatedKey).should(
|
||||||
);
|
'contain',
|
||||||
cy.get(associatedAmount, txTimeout).should('contain', 37);
|
Cypress.env('vegaWalletPublicKeyShort')
|
||||||
});
|
);
|
||||||
cy.get(vegaInWalletSection).within(() => {
|
cy.get(associatedAmount, txTimeout).should('contain', 37);
|
||||||
cy.get(associatedKey).should(
|
});
|
||||||
'contain',
|
cy.get(vegaInWalletSection)
|
||||||
Cypress.env('vegaWalletPublicKeyShort')
|
.first()
|
||||||
);
|
.within(() => {
|
||||||
cy.get(associatedAmount, txTimeout).should('contain', 21);
|
cy.get(associatedKey).should(
|
||||||
});
|
'contain',
|
||||||
cy.get(vegaWallet).within(() => {
|
Cypress.env('vegaWalletPublicKeyShort')
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 58);
|
);
|
||||||
});
|
cy.get(associatedAmount, txTimeout).should('contain', 21);
|
||||||
|
});
|
||||||
|
cy.get(vegaWallet)
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
58
|
||||||
|
);
|
||||||
|
});
|
||||||
stakingPageDisassociateTokens('6', { type: 'contract' });
|
stakingPageDisassociateTokens('6', { type: 'contract' });
|
||||||
cy.get(vestingContractSection).within(() => {
|
cy.get(vestingContractSection)
|
||||||
cy.get(associatedAmount, txTimeout).should('contain', 31);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(associatedAmount, txTimeout).should('contain', 31);
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 52);
|
});
|
||||||
});
|
cy.get(vegaWallet)
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
52
|
||||||
|
);
|
||||||
|
});
|
||||||
navigateTo(navigation.validators);
|
navigateTo(navigation.validators);
|
||||||
stakingPageDisassociateTokens('9', { type: 'wallet' });
|
stakingPageDisassociateTokens('9', { type: 'wallet' });
|
||||||
cy.get(vegaInWalletSection).within(() => {
|
cy.get(vegaInWalletSection)
|
||||||
cy.get(associatedAmount, txTimeout).should('contain', 12);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(associatedAmount, txTimeout).should('contain', 12);
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 43);
|
});
|
||||||
});
|
cy.get(vegaWallet)
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
43
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Not able to associate more tokens than owned', function () {
|
it('Not able to associate more tokens than owned', function () {
|
||||||
// 1004-ASSO-008
|
// 1004-ASSO-008
|
||||||
// 1004-ASSO-010
|
// 1004-ASSO-010
|
||||||
// No warning visible as described in AC, but the button is disabled
|
// No warning visible as described in AC, but the button is disabled
|
||||||
cy.get(ethWalletAssociateButton).first().click();
|
cy.get(ethWalletAssociateButton).click();
|
||||||
cy.get(associateWalletRadioButton, { timeout: 30000 }).click();
|
cy.get(associateWalletRadioButton, { timeout: 30000 }).click();
|
||||||
cy.get(tokenSubmitButton, txTimeout).should('be.disabled'); // button disabled with no input
|
cy.get(tokenSubmitButton, txTimeout).should('be.disabled'); // button disabled with no input
|
||||||
cy.get(tokenAmountInputBox, { timeout: 10000 }).type('6500000');
|
cy.get(tokenAmountInputBox, { timeout: 10000 }).type('6500000');
|
||||||
@@ -278,12 +338,12 @@ context(
|
|||||||
vegaWalletAssociate('2');
|
vegaWalletAssociate('2');
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '0.00');
|
validateWalletCurrency('Associated', '0.00');
|
||||||
validateWalletCurrency('Pending association', '2.00');
|
validateWalletCurrency('Pending association', '2.00');
|
||||||
validateWalletCurrency('Total associated after pending', '2.00');
|
validateWalletCurrency('Total associated after pending', '2.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
validateWalletCurrency('Associated', '2.00');
|
validateWalletCurrency('Associated', '2.00');
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -294,33 +354,38 @@ context(
|
|||||||
});
|
});
|
||||||
cy.getByTestId('currency-title', txTimeout).should(
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
'have.length.above',
|
'have.length.above',
|
||||||
3
|
6
|
||||||
);
|
);
|
||||||
validateWalletCurrency('Associated', '2.00');
|
validateWalletCurrency('Associated', '2.00');
|
||||||
validateWalletCurrency('Pending association', '2.00');
|
validateWalletCurrency('Pending association', '2.00');
|
||||||
validateWalletCurrency('Total associated after pending', '0.00');
|
validateWalletCurrency('Total associated after pending', '0.00');
|
||||||
cy.getByTestId('currency-title', txTimeout).should('have.length', 3);
|
cy.getByTestId('currency-title', txTimeout).should('have.length', 6);
|
||||||
validateWalletCurrency('Associated', '0.00');
|
validateWalletCurrency('Associated', '0.00');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to associate tokens to different public key of connected vega wallet', function () {
|
it('Able to associate tokens to different public key of connected vega wallet', function () {
|
||||||
cy.get(ethWalletAssociateButton).first().click();
|
cy.get(ethWalletAssociateButton).click();
|
||||||
cy.get(associateWalletRadioButton).click();
|
cy.get(associateWalletRadioButton).click();
|
||||||
cy.get(connectedVegaKey).should(
|
cy.get(connectedVegaKey).should(
|
||||||
'have.text',
|
'have.text',
|
||||||
Cypress.env('vegaWalletPublicKey')
|
Cypress.env('vegaWalletPublicKey')
|
||||||
);
|
);
|
||||||
|
|
||||||
cy.get('[data-testid="manage-vega-wallet"]').click();
|
cy.get('[data-testid="manage-vega-wallet"]:visible').click();
|
||||||
cy.get('[data-testid="select-keypair-button"]').eq(0).click();
|
cy.get('[data-testid="select-keypair-button"]').eq(0).click();
|
||||||
cy.get(connectedVegaKey).should(
|
cy.get(connectedVegaKey).should(
|
||||||
'have.text',
|
'have.text',
|
||||||
Cypress.env('vegaWalletPublicKey2')
|
Cypress.env('vegaWalletPublicKey2')
|
||||||
);
|
);
|
||||||
stakingPageAssociateTokens('2');
|
stakingPageAssociateTokens('2');
|
||||||
cy.get(vegaWallet).within(() => {
|
cy.get(vegaWallet)
|
||||||
cy.get(vegaWalletAssociatedBalance, txTimeout).should('contain', 2.0);
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(vegaWalletAssociatedBalance, txTimeout).should(
|
||||||
|
'contain',
|
||||||
|
2.0
|
||||||
|
);
|
||||||
|
});
|
||||||
cy.get(associateCompleteText).should(
|
cy.get(associateCompleteText).should(
|
||||||
'have.text',
|
'have.text',
|
||||||
`Vega key ${Cypress.env(
|
`Vega key ${Cypress.env(
|
||||||
|
|||||||
@@ -4,10 +4,7 @@ import {
|
|||||||
waitForSpinner,
|
waitForSpinner,
|
||||||
} from '../../support/common.functions';
|
} from '../../support/common.functions';
|
||||||
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
import { ethereumWalletConnect } from '../../support/wallet-eth.functions';
|
||||||
import {
|
import { depositAsset } from '../../support/wallet-teardown.functions';
|
||||||
depositAsset,
|
|
||||||
vegaWalletTeardown,
|
|
||||||
} from '../../support/wallet-teardown.functions';
|
|
||||||
|
|
||||||
const withdraw = 'withdraw';
|
const withdraw = 'withdraw';
|
||||||
const withdrawalForm = 'withdraw-form';
|
const withdrawalForm = 'withdraw-form';
|
||||||
@@ -25,6 +22,15 @@ const withdrawalAmount = 'withdrawal-amount';
|
|||||||
const withdrawalRecipient = 'withdrawal-recipient';
|
const withdrawalRecipient = 'withdrawal-recipient';
|
||||||
const withdrawFundsButton = 'withdraw-funds';
|
const withdrawFundsButton = 'withdraw-funds';
|
||||||
const completeWithdrawalButton = 'complete-withdrawal';
|
const completeWithdrawalButton = 'complete-withdrawal';
|
||||||
|
const tableTxHash = '[col-id="txHash"]';
|
||||||
|
const tableAssetSymbol = '[col-id="asset.symbol"]';
|
||||||
|
const tableAmount = '[col-id="amount"]';
|
||||||
|
const tableReceiverAddress = '[col-id="details.receiverAddress"]';
|
||||||
|
const tableWithdrawnTimeStamp = '[col-id="withdrawnTimestamp"]';
|
||||||
|
const tableWithdrawnStatus = '[col-id="status"]';
|
||||||
|
const tableCreatedTimeStamp = '[col-id="createdTimestamp"]';
|
||||||
|
const toastContent = 'toast-content';
|
||||||
|
const toastPanel = 'toast-panel';
|
||||||
const usdtName = 'USDC (local)';
|
const usdtName = 'USDC (local)';
|
||||||
const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0';
|
const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0';
|
||||||
const usdcSymbol = 'tUSDC';
|
const usdcSymbol = 'tUSDC';
|
||||||
@@ -42,26 +48,23 @@ context(
|
|||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
// When running tests locally, will fail if run without restarting capsule
|
// When running tests locally, will fail if run without restarting capsule
|
||||||
cy.updateCapsuleMultiSig().then(() => {
|
cy.updateCapsuleMultiSig().then(() => {
|
||||||
depositAsset(usdcEthAddress, '100');
|
ethereumWalletConnect();
|
||||||
|
depositAsset(usdcEthAddress, '1000', 5);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('Navigate to withdrawal page', function () {
|
beforeEach('Navigate to withdrawal page', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
navigateTo(navigation.withdraw);
|
navigateTo(navigation.withdraw);
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
vegaWalletTeardown();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to open withdrawal form with vega wallet connected', function () {
|
it('Able to open withdrawal form with vega wallet connected', function () {
|
||||||
// needs to reload page for withdrawal form to be displayed in ci - not reproducible outside of ci
|
|
||||||
cy.reload();
|
|
||||||
waitForSpinner();
|
|
||||||
ethereumWalletConnect();
|
|
||||||
cy.getByTestId(withdraw).should('be.visible').click();
|
cy.getByTestId(withdraw).should('be.visible').click();
|
||||||
cy.getByTestId(withdrawalForm).within(() => {
|
cy.getByTestId(withdrawalForm, txTimeout).within(() => {
|
||||||
cy.get('select').find('option').should('have.length.at.least', 2);
|
cy.get('select').find('option').should('have.length.at.least', 2);
|
||||||
cy.getByTestId(ethAddressInput).should('be.visible');
|
cy.getByTestId(ethAddressInput).should('be.visible');
|
||||||
cy.getByTestId(amountInput).should('be.visible');
|
cy.getByTestId(amountInput).should('be.visible');
|
||||||
@@ -70,7 +73,7 @@ context(
|
|||||||
|
|
||||||
it('Unable to submit withdrawal with invalid fields', function () {
|
it('Unable to submit withdrawal with invalid fields', function () {
|
||||||
cy.getByTestId(withdraw).should('be.visible').click();
|
cy.getByTestId(withdraw).should('be.visible').click();
|
||||||
cy.getByTestId(withdrawalForm).within(() => {
|
cy.getByTestId(withdrawalForm, txTimeout).within(() => {
|
||||||
cy.get('select').select(usdtSelectValue, { force: true });
|
cy.get('select').select(usdtSelectValue, { force: true });
|
||||||
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
||||||
cy.getByTestId(submitWithdrawalButton).click();
|
cy.getByTestId(submitWithdrawalButton).click();
|
||||||
@@ -94,7 +97,7 @@ context(
|
|||||||
it('Able to withdraw asset: -eth wallet connected -withdraw funds button', function () {
|
it('Able to withdraw asset: -eth wallet connected -withdraw funds button', function () {
|
||||||
// fill in withdrawal form
|
// fill in withdrawal form
|
||||||
cy.getByTestId(withdraw).should('be.visible').click();
|
cy.getByTestId(withdraw).should('be.visible').click();
|
||||||
cy.getByTestId(withdrawalForm).within(() => {
|
cy.getByTestId(withdrawalForm, txTimeout).within(() => {
|
||||||
cy.get('select').select(usdtSelectValue, { force: true });
|
cy.get('select').select(usdtSelectValue, { force: true });
|
||||||
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
||||||
cy.getByTestId(withdrawalThreshold).should(
|
cy.getByTestId(withdrawalThreshold).should(
|
||||||
@@ -102,7 +105,7 @@ context(
|
|||||||
'100,000.00000T'
|
'100,000.00000T'
|
||||||
);
|
);
|
||||||
cy.getByTestId(delayTime).should('have.text', 'None');
|
cy.getByTestId(delayTime).should('have.text', 'None');
|
||||||
cy.getByTestId(amountInput).click().type('100');
|
cy.getByTestId(amountInput).click().type('120');
|
||||||
cy.getByTestId(submitWithdrawalButton).click();
|
cy.getByTestId(submitWithdrawalButton).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -116,7 +119,7 @@ context(
|
|||||||
.should('have.attr', 'href')
|
.should('have.attr', 'href')
|
||||||
.and('contain', '/txs/');
|
.and('contain', '/txs/');
|
||||||
cy.getByTestId(withdrawalAssetSymbol).should('have.text', usdcSymbol);
|
cy.getByTestId(withdrawalAssetSymbol).should('have.text', usdcSymbol);
|
||||||
cy.getByTestId(withdrawalAmount).should('have.text', '100.00');
|
cy.getByTestId(withdrawalAmount).should('have.text', '120.00');
|
||||||
cy.getByTestId(withdrawalRecipient)
|
cy.getByTestId(withdrawalRecipient)
|
||||||
.should('have.text', truncatedWithdrawalEthAddress)
|
.should('have.text', truncatedWithdrawalEthAddress)
|
||||||
.and('have.attr', 'href')
|
.and('have.attr', 'href')
|
||||||
@@ -128,43 +131,36 @@ context(
|
|||||||
'Withdraw asset complete'
|
'Withdraw asset complete'
|
||||||
);
|
);
|
||||||
cy.getByTestId(dialogClose).click();
|
cy.getByTestId(dialogClose).click();
|
||||||
|
|
||||||
// need to reload page to see withdrawal history complete
|
|
||||||
cy.reload();
|
|
||||||
waitForAssetsDisplayed(usdtName);
|
|
||||||
|
|
||||||
// withdrawal history for complete withdrawal displayed
|
// withdrawal history for complete withdrawal displayed
|
||||||
cy.get('[col-id="txHash"]', txTimeout)
|
cy.get(tableWithdrawnStatus)
|
||||||
.should('have.length.above', 1)
|
.eq(1, txTimeout)
|
||||||
.eq(1)
|
.should('have.text', 'Completed')
|
||||||
.parent()
|
.parent()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get('[col-id="asset.symbol"]').should('have.text', usdcSymbol);
|
cy.get(tableAssetSymbol).should('have.text', usdcSymbol);
|
||||||
cy.get('[col-id="amount"]').should('have.text', '100.00');
|
cy.get(tableAmount).should('have.text', '120.00');
|
||||||
cy.get('[col-id="details.receiverAddress"]')
|
cy.get(tableReceiverAddress)
|
||||||
.find('a')
|
.find('a')
|
||||||
.should('have.attr', 'href')
|
.should('have.attr', 'href')
|
||||||
.and('contain', 'https://sepolia.etherscan.io/address/');
|
.and('contain', 'https://sepolia.etherscan.io/address/');
|
||||||
cy.get('[col-id="withdrawnTimestamp"]').should('not.be.empty');
|
cy.get(tableWithdrawnTimeStamp).should('not.be.empty');
|
||||||
cy.get('[col-id="status"]').should('have.text', 'Completed');
|
cy.get(tableTxHash)
|
||||||
cy.get('[col-id="txHash"]')
|
|
||||||
.find('a')
|
.find('a')
|
||||||
.should('have.attr', 'href')
|
.should('have.attr', 'href')
|
||||||
.and('contain', 'https://sepolia.etherscan.io/tx/');
|
.and('contain', 'https://sepolia.etherscan.io/tx/');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Skipping because of bug #1857
|
it('Able to withdraw asset: -eth wallet not connected', function () {
|
||||||
it.skip('Able to withdraw asset: -eth wallet not connected', function () {
|
|
||||||
const ethWalletAddress = Cypress.env('ethWalletPublicKey');
|
const ethWalletAddress = Cypress.env('ethWalletPublicKey');
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForAssetsDisplayed(usdtName);
|
waitForAssetsDisplayed(usdtName);
|
||||||
// fill in withdrawal form
|
// fill in withdrawal form
|
||||||
cy.getByTestId(withdraw).should('be.visible').click();
|
cy.getByTestId(withdraw).should('be.visible').click();
|
||||||
cy.getByTestId(withdrawalForm).within(() => {
|
cy.getByTestId(withdrawalForm, txTimeout).within(() => {
|
||||||
cy.get('select').select(usdtSelectValue, { force: true });
|
cy.get('select').select(usdtSelectValue, { force: true });
|
||||||
cy.getByTestId(ethAddressInput).should('be.empty');
|
cy.getByTestId(ethAddressInput).should('be.empty');
|
||||||
cy.getByTestId(amountInput).click().type('100');
|
cy.getByTestId(amountInput).click().type('110');
|
||||||
cy.getByTestId(submitWithdrawalButton).click();
|
cy.getByTestId(submitWithdrawalButton).click();
|
||||||
|
|
||||||
// Need eth address to submit withdrawal
|
// Need eth address to submit withdrawal
|
||||||
@@ -180,20 +176,38 @@ context(
|
|||||||
'Transaction complete'
|
'Transaction complete'
|
||||||
);
|
);
|
||||||
cy.getByTestId(dialogClose).click();
|
cy.getByTestId(dialogClose).click();
|
||||||
|
cy.get(tableTxHash)
|
||||||
cy.getByTestId(completeWithdrawalButton)
|
.eq(1)
|
||||||
.eq(0)
|
.should('have.text', 'Complete withdrawal')
|
||||||
.parent()
|
|
||||||
.parent()
|
.parent()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get('[col-id="asset.symbol"]').should('have.text', usdcSymbol);
|
cy.get(tableAssetSymbol).should('have.text', usdcSymbol);
|
||||||
cy.get('[col-id="amount"]').should('have.text', '100.00');
|
cy.get(tableAmount).should('have.text', '110.00');
|
||||||
cy.get('[col-id="details.receiverAddress"]')
|
cy.get(tableReceiverAddress)
|
||||||
.find('a')
|
.find('a')
|
||||||
.should('have.attr', 'href')
|
.should('have.attr', 'href')
|
||||||
.and('contain', 'https://sepolia.etherscan.io/address/');
|
.and('contain', 'https://sepolia.etherscan.io/address/');
|
||||||
cy.get('[col-id="createdTimestamp"]').should('not.be.empty');
|
cy.get(tableCreatedTimeStamp).should('not.be.empty');
|
||||||
cy.getByTestId(completeWithdrawalButton).click();
|
});
|
||||||
|
ethereumWalletConnect();
|
||||||
|
cy.getByTestId(completeWithdrawalButton).click();
|
||||||
|
cy.getByTestId(toastContent)
|
||||||
|
.last()
|
||||||
|
.should('contain.text', 'Awaiting confirmation')
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId('external-link').should('exist');
|
||||||
|
});
|
||||||
|
cy.getByTestId(toastContent)
|
||||||
|
.first()
|
||||||
|
.should('contain.text', 'The withdrawal has been approved.')
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId(toastPanel).should('contain.text', '110.00', 'tUSDC');
|
||||||
|
});
|
||||||
|
cy.getByTestId(toastContent)
|
||||||
|
.last()
|
||||||
|
.should('contain.text', 'Transaction confirmed')
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId('external-link').should('exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -202,26 +216,31 @@ context(
|
|||||||
const expectedErrorTxt = `You are connected in a view only state for public key: ${vegaWalletPubKey}. In order to send transactions you must connect to a real wallet.`;
|
const expectedErrorTxt = `You are connected in a view only state for public key: ${vegaWalletPubKey}. In order to send transactions you must connect to a real wallet.`;
|
||||||
|
|
||||||
// Disconnect vega wallet
|
// Disconnect vega wallet
|
||||||
cy.getByTestId('manage-vega-wallet').click();
|
cy.getByTestId('manage-vega-wallet').last().click();
|
||||||
cy.getByTestId('disconnect').click();
|
cy.getByTestId('disconnect').click();
|
||||||
|
|
||||||
cy.connectPublicKey(vegaWalletPubKey);
|
cy.connectPublicKey(vegaWalletPubKey);
|
||||||
cy.getByTestId(withdraw).should('be.visible').click();
|
cy.getByTestId(withdraw).should('be.visible').click();
|
||||||
cy.getByTestId(withdrawalForm).within(() => {
|
cy.getByTestId(withdrawalForm, txTimeout).within(() => {
|
||||||
cy.get('select').select(usdtSelectValue, { force: true });
|
cy.get('select').select(usdtSelectValue, { force: true });
|
||||||
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
cy.getByTestId(balanceAvailable, txTimeout).should('exist');
|
||||||
cy.getByTestId(amountInput).click().type('100');
|
cy.getByTestId(amountInput).click().type('100');
|
||||||
cy.getByTestId(submitWithdrawalButton).click();
|
cy.getByTestId(submitWithdrawalButton).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
cy.getByTestId('dialog-content').within(() => {
|
cy.getByTestId('dialog-content')
|
||||||
cy.get('h1').should('have.text', 'Transaction failed');
|
.last()
|
||||||
cy.getByTestId('Error').should('have.text', expectedErrorTxt);
|
.within(() => {
|
||||||
});
|
cy.get('h1').should('have.text', 'Transaction failed');
|
||||||
|
cy.getByTestId('Error').should('have.text', expectedErrorTxt);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function waitForAssetsDisplayed(expectedAsset: string) {
|
function waitForAssetsDisplayed(expectedAsset: string) {
|
||||||
cy.contains(expectedAsset, txTimeout).should('be.visible');
|
cy.getByTestId('currency-title', txTimeout).should(
|
||||||
|
'contain.text',
|
||||||
|
expectedAsset
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,15 +17,17 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
|
|
||||||
it('should display announcement banner', function () {
|
it('should display announcement banner', function () {
|
||||||
cy.getByTestId('app-announcement')
|
cy.getByTestId('app-announcement')
|
||||||
.should('be.visible')
|
.should('contain.text', 'TEST ANNOUNCEMENT!')
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId('external-link').should('exist');
|
cy.getByTestId('external-link')
|
||||||
|
.should('have.attr', 'href', 'https://fairground.wtf')
|
||||||
|
.and('have.text', 'CLICK LINK');
|
||||||
});
|
});
|
||||||
cy.getByTestId('app-announcement-close').should('be.visible').click();
|
cy.getByTestId('app-announcement-close').should('be.visible').click();
|
||||||
cy.getByTestId('app-announcement').should('not.exist');
|
cy.getByTestId('app-announcement').should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should show open or enacted proposals with proposal summary', function () {
|
it('should show open or enacted proposals without proposal summary', function () {
|
||||||
cy.get('body').then(($body) => {
|
cy.get('body').then(($body) => {
|
||||||
if (!$body.find('[data-testid="proposals-list-item"]').length) {
|
if (!$body.find('[data-testid="proposals-list-item"]').length) {
|
||||||
cy.createMarket();
|
cy.createMarket();
|
||||||
@@ -41,12 +43,6 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
.invoke('text')
|
.invoke('text')
|
||||||
.should('not.be.empty');
|
.should('not.be.empty');
|
||||||
cy.getByTestId('proposal-type').invoke('text').should('not.be.empty');
|
cy.getByTestId('proposal-type').invoke('text').should('not.be.empty');
|
||||||
cy.getByTestId('proposal-description')
|
|
||||||
.invoke('text')
|
|
||||||
.should('not.be.empty');
|
|
||||||
cy.getByTestId('proposal-details')
|
|
||||||
.invoke('text')
|
|
||||||
.should('not.be.empty');
|
|
||||||
cy.getByTestId('proposal-status')
|
cy.getByTestId('proposal-status')
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.should('not.be.empty');
|
.should('not.be.empty');
|
||||||
@@ -129,7 +125,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get('span')
|
cy.get('span')
|
||||||
.first()
|
.first()
|
||||||
.should('have.text', 'http://localhost:3028/query');
|
.should('have.text', 'http://localhost:3008/graphql');
|
||||||
cy.getByTestId('link').should('exist');
|
cy.getByTestId('link').should('exist');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,11 +3,14 @@ import {
|
|||||||
navigation,
|
navigation,
|
||||||
verifyPageHeader,
|
verifyPageHeader,
|
||||||
verifyTabHighlighted,
|
verifyTabHighlighted,
|
||||||
waitForSpinner,
|
|
||||||
} from '../../support/common.functions';
|
} from '../../support/common.functions';
|
||||||
|
import {
|
||||||
|
goToMakeNewProposal,
|
||||||
|
governanceProposalType,
|
||||||
|
} from '../../support/governance.functions';
|
||||||
|
import { mockNetworkUpgradeProposal } from '../../support/proposal.functions';
|
||||||
|
|
||||||
const proposalDocumentationLink = '[data-testid="proposal-documentation-link"]';
|
const proposalDocumentationLink = '[data-testid="proposal-documentation-link"]';
|
||||||
const newProposalButton = '[data-testid="new-proposal-link"]';
|
|
||||||
const newProposalLink = '[data-testid="new-proposal-link"]';
|
const newProposalLink = '[data-testid="new-proposal-link"]';
|
||||||
const governanceDocsUrl = 'https://vega.xyz/governance';
|
const governanceDocsUrl = 'https://vega.xyz/governance';
|
||||||
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
|
const connectToVegaWalletButton = '[data-testid="connect-to-vega-wallet-btn"]';
|
||||||
@@ -21,56 +24,140 @@ context(
|
|||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with no network change proposals', function () {
|
it('should have governance tab highlighted', function () {
|
||||||
it('should have governance tab highlighted', function () {
|
verifyTabHighlighted(navigation.proposals);
|
||||||
verifyTabHighlighted(navigation.proposals);
|
});
|
||||||
|
|
||||||
|
it('should have GOVERNANCE header visible', function () {
|
||||||
|
verifyPageHeader('Proposals');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to see a working link for - find out more about Vega governance', function () {
|
||||||
|
// 3001-VOTE-001
|
||||||
|
cy.get(proposalDocumentationLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Find out more about Vega governance')
|
||||||
|
.and('have.attr', 'href')
|
||||||
|
.and('equal', governanceDocsUrl);
|
||||||
|
|
||||||
|
// 3002-PROP-001
|
||||||
|
cy.request(governanceDocsUrl)
|
||||||
|
.its('body')
|
||||||
|
.then((body) => {
|
||||||
|
if (!body.includes('Govern the network')) {
|
||||||
|
assert.include(
|
||||||
|
body,
|
||||||
|
'Govern the network',
|
||||||
|
`Checking that governance link destination includes 'Govern the network' text`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to see button for - new proposal', function () {
|
||||||
|
// 3001-VOTE-002
|
||||||
|
cy.get(newProposalLink)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'New proposal')
|
||||||
|
.and('have.attr', 'href')
|
||||||
|
.and('equal', '/proposals/propose');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should be able to see a connect wallet button - if vega wallet disconnected and user is submitting new proposal', function () {
|
||||||
|
goToMakeNewProposal(governanceProposalType.NETWORK_PARAMETER);
|
||||||
|
cy.get(connectToVegaWalletButton)
|
||||||
|
.should('be.visible')
|
||||||
|
.and('have.text', 'Connect Vega wallet');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should see open network upgrade proposal on homepage', function () {
|
||||||
|
mockNetworkUpgradeProposal();
|
||||||
|
cy.visit('/');
|
||||||
|
cy.getByTestId('home-proposal-list').within(() => {
|
||||||
|
cy.getByTestId('protocol-upgrade-proposals-list-item').should('exist');
|
||||||
|
cy.getByTestId('protocol-upgrade-proposal-title').should(
|
||||||
|
'have.text',
|
||||||
|
'Vega release v1'
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
it('should have GOVERNANCE header visible', function () {
|
it('should see network upgrade proposals in proposals list', function () {
|
||||||
verifyPageHeader('Proposals');
|
mockNetworkUpgradeProposal();
|
||||||
});
|
navigateTo(navigation.proposals);
|
||||||
|
cy.getByTestId('open-proposals').within(() => {
|
||||||
it('should be able to see a working link for - find out more about Vega governance', function () {
|
cy.get('li')
|
||||||
// 3001-VOTE-001
|
.eq(0)
|
||||||
cy.get(proposalDocumentationLink)
|
.should(
|
||||||
.should('be.visible')
|
'have.attr',
|
||||||
.and('have.text', 'Find out more about Vega governance')
|
'data-testid',
|
||||||
.and('have.attr', 'href')
|
'protocol-upgrade-proposals-list-item'
|
||||||
.and('equal', governanceDocsUrl);
|
)
|
||||||
|
.within(() => {
|
||||||
// 3002-PROP-001
|
cy.get('h2').should('have.text', 'Vega release v1');
|
||||||
cy.request(governanceDocsUrl)
|
cy.getByTestId('protocol-upgrade-proposal-type').should(
|
||||||
.its('body')
|
'have.text',
|
||||||
.then((body) => {
|
'Network Upgrade'
|
||||||
if (!body.includes('Govern the network')) {
|
);
|
||||||
assert.include(
|
cy.getByTestId('protocol-upgrade-proposal-release-tag').should(
|
||||||
body,
|
'have.text',
|
||||||
'Govern the network',
|
'Vega release tag: v1'
|
||||||
`Checking that governance link destination includes 'Govern the network' text`
|
);
|
||||||
);
|
cy.getByTestId('protocol-upgrade-proposal-block-height').should(
|
||||||
}
|
'have.text',
|
||||||
|
'Upgrade block height: 2015942'
|
||||||
|
);
|
||||||
|
cy.getByTestId('protocol-upgrade-proposal-status').should(
|
||||||
|
'have.text',
|
||||||
|
'Approved '
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
cy.getByTestId('closed-proposals').within(() => {
|
||||||
it('should be able to see button for - new proposal', function () {
|
cy.getByTestId('protocol-upgrade-proposals-list-item').should(
|
||||||
// 3001-VOTE-002
|
'have.length',
|
||||||
cy.get(newProposalLink)
|
1
|
||||||
.should('be.visible')
|
);
|
||||||
.and('have.text', 'New proposal')
|
|
||||||
.and('have.attr', 'href')
|
|
||||||
.and('equal', '/proposals/propose');
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
// Skipping this test for now, the new proposal button no longer takes a user directly
|
it('should see details of network upgrade proposal', function () {
|
||||||
// to a proposal form, instead it takes them to a page where they can select a proposal type.
|
mockNetworkUpgradeProposal();
|
||||||
// Keeping this test here for now as it can be repurposed to test the new proposal forms.
|
navigateTo(navigation.proposals);
|
||||||
it.skip('should be able to see a connect wallet button - if vega wallet disconnected and new proposal button selected', function () {
|
cy.getByTestId('protocol-upgrade-proposals-list-item')
|
||||||
cy.get(newProposalButton).should('be.visible').click();
|
.first()
|
||||||
cy.get(connectToVegaWalletButton)
|
.find('[data-testid="view-proposal-btn"]')
|
||||||
.should('be.visible')
|
.click();
|
||||||
.and('have.text', 'Connect Vega wallet');
|
cy.getByTestId('protocol-upgrade-proposal').within(() => {
|
||||||
navigateTo(navigation.proposals);
|
cy.get('h1').should('have.text', 'Vega Release v1');
|
||||||
waitForSpinner();
|
cy.getByTestId('protocol-upgrade-block-height').should(
|
||||||
|
'have.text',
|
||||||
|
'2015942 (currently 2014133)'
|
||||||
|
);
|
||||||
|
cy.getByTestId('protocol-upgrade-state').should(
|
||||||
|
'have.text',
|
||||||
|
'Approved'
|
||||||
|
);
|
||||||
|
cy.getByTestId('protocol-upgrade-release-tag').should(
|
||||||
|
'have.text',
|
||||||
|
'v1'
|
||||||
|
);
|
||||||
|
cy.getByTestId('protocol-upgrade-approval-status')
|
||||||
|
.should('contain.text', '99.98% approval (% validator voting power)')
|
||||||
|
.and('contain.text', '(67% voting power required)');
|
||||||
|
cy.get('h2').should('contain.text', 'Approvers (4/4 validators)');
|
||||||
|
cy.getByTestId('validator-name')
|
||||||
|
.should('have.length', 4)
|
||||||
|
.each(($validator) => {
|
||||||
|
cy.wrap($validator).find('a').should('have.attr', 'href');
|
||||||
|
});
|
||||||
|
cy.getByTestId('validator-voting-power').each(
|
||||||
|
($validatorVotingPower) => {
|
||||||
|
cy.wrap($validatorVotingPower)
|
||||||
|
.invoke('text')
|
||||||
|
.should('contain', '%');
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,15 @@ const banner = 'view-banner';
|
|||||||
|
|
||||||
context('View functionality with public key', { tags: '@smoke' }, function () {
|
context('View functionality with public key', { tags: '@smoke' }, function () {
|
||||||
before('send asset to wallet', function () {
|
before('send asset to wallet', function () {
|
||||||
vegaWalletFaucetAssetsWithoutCheck('fUSDC', '1000000', vegaWalletPubKey);
|
vegaWalletFaucetAssetsWithoutCheck(
|
||||||
|
'816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc',
|
||||||
|
'1000000',
|
||||||
|
vegaWalletPubKey
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit home page', function () {
|
beforeEach('visit home page', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectPublicKey(vegaWalletPubKey);
|
cy.connectPublicKey(vegaWalletPubKey);
|
||||||
@@ -45,10 +50,12 @@ context('View functionality with public key', { tags: '@smoke' }, function () {
|
|||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
goToMakeNewProposal('Freeform');
|
goToMakeNewProposal('Freeform');
|
||||||
enterUniqueFreeFormProposalBody('50', 'pub key proposal test');
|
enterUniqueFreeFormProposalBody('50', 'pub key proposal test');
|
||||||
cy.getByTestId('dialog-content').within(() => {
|
cy.getByTestId('dialog-content')
|
||||||
cy.get('h1').should('have.text', 'Transaction failed');
|
.first()
|
||||||
cy.getByTestId('Error').should('have.text', expectedErrorTxt);
|
.within(() => {
|
||||||
});
|
cy.get('h1').should('have.text', 'Transaction failed');
|
||||||
|
cy.getByTestId('Error').should('have.text', expectedErrorTxt);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to disconnect via banner', function () {
|
it('Able to disconnect via banner', function () {
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {
|
|||||||
navigation,
|
navigation,
|
||||||
verifyPageHeader,
|
verifyPageHeader,
|
||||||
} from '../../support/common.functions';
|
} from '../../support/common.functions';
|
||||||
|
import { waitForBeginningOfEpoch } from '../../support/staking.functions';
|
||||||
|
|
||||||
const viewToggle = '[data-testid="epoch-reward-view-toggle-total"]';
|
const viewToggle = '[data-testid="epoch-reward-view-toggle-total"]';
|
||||||
const warning = '[data-testid="callout"]';
|
const warning = '[data-testid="callout"]';
|
||||||
@@ -12,6 +13,7 @@ context(
|
|||||||
{ tags: '@regression' },
|
{ tags: '@regression' },
|
||||||
function () {
|
function () {
|
||||||
before('navigate to rewards page', function () {
|
before('navigate to rewards page', function () {
|
||||||
|
cy.clearLocalStorage();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
navigateTo(navigation.rewards);
|
navigateTo(navigation.rewards);
|
||||||
});
|
});
|
||||||
@@ -37,6 +39,41 @@ context(
|
|||||||
it('should have toggle for seeing total vs individual rewards', function () {
|
it('should have toggle for seeing total vs individual rewards', function () {
|
||||||
cy.get(viewToggle).should('be.visible');
|
cy.get(viewToggle).should('be.visible');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Skipping due to bug #3471 causing flaky failuress
|
||||||
|
it.skip('should have option to view go to next and previous page', function () {
|
||||||
|
waitForBeginningOfEpoch();
|
||||||
|
cy.getByTestId('page-info')
|
||||||
|
.should('contain.text', 'Page ')
|
||||||
|
.invoke('text')
|
||||||
|
.then(($currentPage) => {
|
||||||
|
const currentPageNumber = Number($currentPage.slice(5));
|
||||||
|
cy.getByTestId('goto-next-page').click();
|
||||||
|
cy.getByTestId('page-info')
|
||||||
|
.invoke('text')
|
||||||
|
.then(($newPageNumber) => {
|
||||||
|
const newPageNumber = Number($newPageNumber.slice(5));
|
||||||
|
expect(newPageNumber).to.be.greaterThan(currentPageNumber);
|
||||||
|
cy.getByTestId('goto-previous-page').click();
|
||||||
|
cy.getByTestId('page-info').should(
|
||||||
|
'contain.text',
|
||||||
|
$currentPage
|
||||||
|
);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should have option to go to last and newest page', function () {
|
||||||
|
waitForBeginningOfEpoch();
|
||||||
|
cy.getByTestId('goto-last-page').click();
|
||||||
|
cy.getByTestId('epoch-total-rewards-table')
|
||||||
|
.last()
|
||||||
|
.find('h2')
|
||||||
|
.first()
|
||||||
|
.should('have.text', 'EPOCH 1');
|
||||||
|
cy.getByTestId('goto-first-page').click();
|
||||||
|
cy.get('h2').should('not.contain.text', 'EPOCH 1');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
/// <reference types="cypress" />
|
/// <reference types="cypress" />
|
||||||
|
|
||||||
import {
|
import {
|
||||||
navigateTo,
|
|
||||||
navigation,
|
navigation,
|
||||||
verifyPageHeader,
|
verifyPageHeader,
|
||||||
verifyTabHighlighted,
|
verifyTabHighlighted,
|
||||||
@@ -34,8 +33,8 @@ const stakeNumberRegex = /^\d*\.?\d*$/;
|
|||||||
|
|
||||||
context('Validators Page - verify elements on page', function () {
|
context('Validators Page - verify elements on page', function () {
|
||||||
before('navigate to validators page', function () {
|
before('navigate to validators page', function () {
|
||||||
cy.visit('/');
|
cy.clearAllLocalStorage();
|
||||||
navigateTo(navigation.validators);
|
cy.visit('/validators');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
||||||
|
|||||||
@@ -43,23 +43,25 @@ context(
|
|||||||
|
|
||||||
// 1005-VEST-020 1005-VEST-021
|
// 1005-VEST-020 1005-VEST-021
|
||||||
it('Tokens in vesting contract for eth wallet is displayed on wallet window', function () {
|
it('Tokens in vesting contract for eth wallet is displayed on wallet window', function () {
|
||||||
cy.getByTestId('vega-in-vesting-contract').within(() => {
|
cy.get('[data-testid="vega-in-vesting-contract"]:visible').within(
|
||||||
cy.getByTestId('currency-title')
|
() => {
|
||||||
.should('contain.text', 'VEGA')
|
cy.getByTestId('currency-title')
|
||||||
.and('contain.text', 'In vesting contract');
|
.should('contain.text', 'VEGA')
|
||||||
cy.get('[data-testid="currency-value"]:visible').should(
|
.and('contain.text', 'In vesting contract');
|
||||||
'have.text',
|
cy.get('[data-testid="currency-value"]:visible').should(
|
||||||
lockedTokensInVestingContract
|
'have.text',
|
||||||
);
|
lockedTokensInVestingContract
|
||||||
cy.get('[data-testid="currency-locked"]:visible').should(
|
);
|
||||||
'have.text',
|
cy.get('[data-testid="currency-locked"]:visible').should(
|
||||||
lockedTokensInVestingContract
|
'have.text',
|
||||||
);
|
lockedTokensInVestingContract
|
||||||
cy.get('[data-testid="currency-unlocked"]:visible').should(
|
);
|
||||||
'have.text',
|
cy.get('[data-testid="currency-unlocked"]:visible').should(
|
||||||
'0.00'
|
'have.text',
|
||||||
);
|
'0.00'
|
||||||
});
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
});
|
});
|
||||||
// 1005-VEST-022 1005-VEST-023
|
// 1005-VEST-022 1005-VEST-023
|
||||||
it('Tokens amount displayed in vesting page', function () {
|
it('Tokens amount displayed in vesting page', function () {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ const vegaInWallet = '[data-testid="vega-in-wallet"]:visible';
|
|||||||
const progressBar = '[data-testid="progress-bar"]:visible';
|
const progressBar = '[data-testid="progress-bar"]:visible';
|
||||||
const currencyLocked = '[data-testid="currency-locked"]:visible';
|
const currencyLocked = '[data-testid="currency-locked"]:visible';
|
||||||
const currencyUnlocked = '[data-testid="currency-unlocked"]:visible';
|
const currencyUnlocked = '[data-testid="currency-unlocked"]:visible';
|
||||||
const dialog = '[role="dialog"]';
|
const dialog = '[role="dialog"]:visible';
|
||||||
const dialogHeader = '[data-testid="dialog-title"]';
|
const dialogHeader = '[data-testid="dialog-title"]';
|
||||||
const dialogCloseBtn = '[data-testid="dialog-close"]';
|
const dialogCloseBtn = '[data-testid="dialog-close"]';
|
||||||
|
|
||||||
@@ -68,8 +68,10 @@ context(
|
|||||||
it('should have connector list visible', function () {
|
it('should have connector list visible', function () {
|
||||||
const connectList = [
|
const connectList = [
|
||||||
'Unknown',
|
'Unknown',
|
||||||
'MetaMask, Brave or other injected web wallet',
|
'MetaMask',
|
||||||
|
'Coinbase',
|
||||||
'WalletConnect',
|
'WalletConnect',
|
||||||
|
'WalletConnect Legacy',
|
||||||
];
|
];
|
||||||
cy.get(connectorList).within(() => {
|
cy.get(connectorList).within(() => {
|
||||||
cy.get('button').each(($btn, i) => {
|
cy.get('button').each(($btn, i) => {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const walletContainer = 'aside [data-testid="vega-wallet"]';
|
|||||||
const walletHeader = '[data-testid="wallet-header"] h1';
|
const walletHeader = '[data-testid="wallet-header"] h1';
|
||||||
const connectButton = '[data-testid="connect-vega-wallet"]';
|
const connectButton = '[data-testid="connect-vega-wallet"]';
|
||||||
const getVegaLink = '[data-testid="link"]';
|
const getVegaLink = '[data-testid="link"]';
|
||||||
const dialog = '[role="dialog"]';
|
const dialog = '[role="dialog"]:visible';
|
||||||
const dialogHeader = '[data-testid="dialog-title"]';
|
const dialogHeader = '[data-testid="dialog-title"]';
|
||||||
const walletDialogHeader = '[data-testid="wallet-dialog-title"]';
|
const walletDialogHeader = '[data-testid="wallet-dialog-title"]';
|
||||||
const connectorsList = '[data-testid="connectors-list"]';
|
const connectorsList = '[data-testid="connectors-list"]';
|
||||||
@@ -35,6 +35,7 @@ context(
|
|||||||
{ tags: '@regression' },
|
{ tags: '@regression' },
|
||||||
() => {
|
() => {
|
||||||
before('visit token home page', () => {
|
before('visit token home page', () => {
|
||||||
|
cy.clearAllLocalStorage();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
cy.get(walletContainer, { timeout: 60000 }).should('be.visible');
|
cy.get(walletContainer, { timeout: 60000 }).should('be.visible');
|
||||||
});
|
});
|
||||||
@@ -281,26 +282,30 @@ context(
|
|||||||
describe('Vega wallet with assets', function () {
|
describe('Vega wallet with assets', function () {
|
||||||
const assets = [
|
const assets = [
|
||||||
{
|
{
|
||||||
id: 'fUSDC',
|
id: '816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc',
|
||||||
name: 'USDC (fake)',
|
name: 'USDC (fake)',
|
||||||
|
symbol: 'fUSDC',
|
||||||
amount: '1000000',
|
amount: '1000000',
|
||||||
expectedAmount: '10.00',
|
expectedAmount: '10.00',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'fDAI',
|
id: '8566db7257222b5b7ef2886394ad28b938b28680a54a169bbc795027b89d6665',
|
||||||
name: 'DAI (fake)',
|
name: 'DAI (fake)',
|
||||||
|
symbol: 'fDAI',
|
||||||
amount: '200000',
|
amount: '200000',
|
||||||
expectedAmount: '2.00',
|
expectedAmount: '2.00',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'fBTC',
|
id: '73174a6fb1d5802ba0ac7bd7ab79e0a3a4837b262de0a4e80815a55442692bd0',
|
||||||
name: 'BTC (fake)',
|
name: 'BTC (fake)',
|
||||||
|
symbol: 'fBTC',
|
||||||
amount: '600000',
|
amount: '600000',
|
||||||
expectedAmount: '6.00',
|
expectedAmount: '6.00',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'fEURO',
|
id: 'e02d4c15d790d1d2dffaf2dcd1cf06a1fe656656cf4ed18c8ce99f9e83643567',
|
||||||
name: 'EURO (fake)',
|
name: 'EURO (fake)',
|
||||||
|
symbol: 'fEURO',
|
||||||
amount: '800000',
|
amount: '800000',
|
||||||
expectedAmount: '8.00',
|
expectedAmount: '8.00',
|
||||||
},
|
},
|
||||||
@@ -321,27 +326,25 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
for (const { id, name, expectedAmount } of assets) {
|
for (const { name, symbol, expectedAmount } of assets) {
|
||||||
it(`should see ${id} within vega wallet`, () => {
|
it(`should see ${name} within vega wallet`, () => {
|
||||||
cy.get(walletContainer).within(() => {
|
cy.get(walletContainer).within(() => {
|
||||||
cy.get(vegaWalletCurrencyTitle)
|
cy.get(vegaWalletCurrencyTitle)
|
||||||
.contains(id, txTimeout)
|
.contains(name, txTimeout)
|
||||||
.should('be.visible');
|
.should('be.visible');
|
||||||
|
|
||||||
cy.get(vegaWalletCurrencyTitle)
|
cy.get(vegaWalletCurrencyTitle)
|
||||||
.contains(id)
|
.contains(name)
|
||||||
.parent()
|
.parent()
|
||||||
.siblings()
|
.siblings()
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((el) => {
|
.then(parseFloat)
|
||||||
const value = parseFloat(el);
|
.should('be.gte', parseFloat(expectedAmount));
|
||||||
cy.wrap(value).should('be.gte', parseFloat(expectedAmount));
|
|
||||||
});
|
|
||||||
|
|
||||||
cy.get(vegaWalletCurrencyTitle)
|
cy.get(vegaWalletCurrencyTitle)
|
||||||
.contains(id)
|
.contains(name)
|
||||||
.parent()
|
.parent()
|
||||||
.contains(name);
|
.contains(symbol);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ context(
|
|||||||
{ tags: '@smoke' },
|
{ tags: '@smoke' },
|
||||||
function () {
|
function () {
|
||||||
before('navigate to withdrawals page', function () {
|
before('navigate to withdrawals page', function () {
|
||||||
|
cy.clearAllLocalStorage();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
navigateTo(navigation.withdraw);
|
navigateTo(navigation.withdraw);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -26,9 +26,11 @@ const topLevelRoutes = [
|
|||||||
export function navigateTo(page: navigation) {
|
export function navigateTo(page: navigation) {
|
||||||
if (!topLevelRoutes.includes(page)) {
|
if (!topLevelRoutes.includes(page)) {
|
||||||
cy.getByTestId(tokenDropDown, { timeout: 10000 }).eq(0).click();
|
cy.getByTestId(tokenDropDown, { timeout: 10000 }).eq(0).click();
|
||||||
cy.getByTestId('token-dropdown').within(() => {
|
cy.getByTestId('token-dropdown')
|
||||||
cy.get(page).eq(0).click();
|
.first()
|
||||||
});
|
.within(() => {
|
||||||
|
cy.get(page).eq(0).click();
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return cy.get(navigation.section, { timeout: 10000 }).within(() => {
|
return cy.get(navigation.section, { timeout: 10000 }).within(() => {
|
||||||
cy.get(page).eq(0).click();
|
cy.get(page).eq(0).click();
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { format } from 'date-fns';
|
||||||
import { closeDialog, navigateTo, navigation } from './common.functions';
|
import { closeDialog, navigateTo, navigation } from './common.functions';
|
||||||
import { ensureSpecifiedUnstakedTokensAreAssociated } from './staking.functions';
|
import { ensureSpecifiedUnstakedTokensAreAssociated } from './staking.functions';
|
||||||
|
|
||||||
@@ -15,35 +16,6 @@ const newProposalSubmitButton = '[data-testid="proposal-submit"]';
|
|||||||
const epochTimeout = Cypress.env('epochTimeout');
|
const epochTimeout = Cypress.env('epochTimeout');
|
||||||
const proposalTimeout = { timeout: 14000 };
|
const proposalTimeout = { timeout: 14000 };
|
||||||
|
|
||||||
export function convertUnixTimestampToDateformat(
|
|
||||||
unixTimestamp: number,
|
|
||||||
monthTextLength = 'longMonth'
|
|
||||||
) {
|
|
||||||
const dateSupplied = new Date(unixTimestamp * 1000);
|
|
||||||
const year = dateSupplied.getFullYear();
|
|
||||||
const months = [
|
|
||||||
'January',
|
|
||||||
'February',
|
|
||||||
'March',
|
|
||||||
'April',
|
|
||||||
'May',
|
|
||||||
'June',
|
|
||||||
'July',
|
|
||||||
'August',
|
|
||||||
'September',
|
|
||||||
'October',
|
|
||||||
'November',
|
|
||||||
'December',
|
|
||||||
];
|
|
||||||
const month = months[dateSupplied.getMonth()];
|
|
||||||
const shortMonth = months[dateSupplied.getMonth()].substring(0, 3),
|
|
||||||
date = dateSupplied.getDate();
|
|
||||||
|
|
||||||
if (monthTextLength === 'longMonth') {
|
|
||||||
return cy.wrap(`${date} ${month} ${year}`);
|
|
||||||
} else return cy.wrap(`${date} ${shortMonth} ${year}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function createTenDigitUnixTimeStampForSpecifiedDays(
|
export function createTenDigitUnixTimeStampForSpecifiedDays(
|
||||||
durationDays: number
|
durationDays: number
|
||||||
) {
|
) {
|
||||||
@@ -52,6 +24,13 @@ export function createTenDigitUnixTimeStampForSpecifiedDays(
|
|||||||
return (timestamp = Math.floor(timestamp / 1000));
|
return (timestamp = Math.floor(timestamp / 1000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function getDateFormatForSpecifiedDays(days: number) {
|
||||||
|
const date = new Date(
|
||||||
|
createTenDigitUnixTimeStampForSpecifiedDays(days) * 1000
|
||||||
|
);
|
||||||
|
return cy.wrap(format(date, 'dd MMM yyyy'));
|
||||||
|
}
|
||||||
|
|
||||||
export function enterRawProposalBody(timestamp: number) {
|
export function enterRawProposalBody(timestamp: number) {
|
||||||
cy.fixture('/proposals/raw.json').then((rawProposal) => {
|
cy.fixture('/proposals/raw.json').then((rawProposal) => {
|
||||||
rawProposal.terms.closingTimestamp = timestamp;
|
rawProposal.terms.closingTimestamp = timestamp;
|
||||||
@@ -90,6 +69,7 @@ export function getSubmittedProposalFromProposalList(proposalTitle: string) {
|
|||||||
export function getProposalIdFromList(proposalTitle: string) {
|
export function getProposalIdFromList(proposalTitle: string) {
|
||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil(proposalListItem)
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.get(proposalDetails)
|
cy.get(proposalDetails)
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
@@ -103,16 +83,6 @@ export function getProposalIdFromList(proposalTitle: string) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getGovernanceProposalDateFormatForSpecifiedDays(
|
|
||||||
days: number,
|
|
||||||
shortOrLong?: string
|
|
||||||
) {
|
|
||||||
return convertUnixTimestampToDateformat(
|
|
||||||
createTenDigitUnixTimeStampForSpecifiedDays(days),
|
|
||||||
shortOrLong
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getProposalInformationFromTable(heading: string) {
|
export function getProposalInformationFromTable(heading: string) {
|
||||||
return cy.get(proposalInformationTableRows).contains(heading).siblings();
|
return cy.get(proposalInformationTableRows).contains(heading).siblings();
|
||||||
}
|
}
|
||||||
@@ -133,7 +103,7 @@ export function waitForProposalSync() {
|
|||||||
// before proposal appears in the list - so rather than hard coded wait - we just wait on the
|
// before proposal appears in the list - so rather than hard coded wait - we just wait on the
|
||||||
// delegation checks that are performed on the governance page.
|
// delegation checks that are performed on the governance page.
|
||||||
|
|
||||||
cy.intercept('POST', '/query', (req) => {
|
cy.intercept('POST', '/graphql', (req) => {
|
||||||
if (req.body.operationName === 'Delegations') {
|
if (req.body.operationName === 'Delegations') {
|
||||||
req.alias = 'proposalDelegationsCompletion';
|
req.alias = 'proposalDelegationsCompletion';
|
||||||
}
|
}
|
||||||
@@ -143,29 +113,18 @@ export function waitForProposalSync() {
|
|||||||
cy.wait(['@proposalDelegationsCompletion', '@proposalDelegationsCompletion']);
|
cy.wait(['@proposalDelegationsCompletion', '@proposalDelegationsCompletion']);
|
||||||
|
|
||||||
// Turn off this intercept from here on in
|
// Turn off this intercept from here on in
|
||||||
cy.intercept('POST', '/query', (req) => {
|
cy.intercept('POST', '/graphql', (req) => {
|
||||||
if (req.body.operationName === 'Delegations') {
|
if (req.body.operationName === 'Delegations') {
|
||||||
req.continue();
|
req.continue();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getSortOrderOfSuppliedArray(suppliedArray: string[]) {
|
|
||||||
const tempArray = [];
|
|
||||||
for (let index = 1; index < suppliedArray.length; index++) {
|
|
||||||
tempArray.push(
|
|
||||||
suppliedArray[index - 1].localeCompare(suppliedArray[index])
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if (tempArray.every((n) => n <= 0)) return 'ascending';
|
|
||||||
else if (tempArray.every((n) => n >= 0)) return 'descending';
|
|
||||||
else return 'unsorted';
|
|
||||||
}
|
|
||||||
|
|
||||||
export function goToMakeNewProposal(proposalType: string) {
|
export function goToMakeNewProposal(proposalType: string) {
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
cy.get(newProposalButton).should('be.visible').click();
|
cy.get(newProposalButton).should('be.visible').click();
|
||||||
cy.url().should('include', '/proposals/propose');
|
cy.url().should('include', '/proposals/propose');
|
||||||
|
cy.get(navigation.pageSpinner, { timeout: 20000 }).should('not.exist');
|
||||||
cy.get('li').should('contain.text', proposalType).and('be.visible');
|
cy.get('li').should('contain.text', proposalType).and('be.visible');
|
||||||
cy.get('li').contains(proposalType).click();
|
cy.get('li').contains(proposalType).click();
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user