Compare commits
150
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d9ed7dfda | ||
|
|
570472b739 | ||
|
|
28f7bd36e7 | ||
|
|
0f3e5595ba | ||
|
|
d3dbdd2bd5 | ||
|
|
0767139712 | ||
|
|
250492a02c | ||
|
|
29f3374c61 | ||
|
|
ba7b574a07 | ||
|
|
afd8650657 | ||
|
|
78414b4429 | ||
|
|
e0a91b3850 | ||
|
|
80f7a08765 | ||
|
|
3e627ff849 | ||
|
|
d2854b6e90 | ||
|
|
6d130c9cfc | ||
|
|
ab4f4e9084 | ||
|
|
fa1825ca64 | ||
|
|
206c6c7207 | ||
|
|
5b0bd69710 | ||
|
|
546b710093 | ||
|
|
afbf62be84 | ||
|
|
ef26d03d36 | ||
|
|
7471116ebf | ||
|
|
7142fc956c | ||
|
|
611f8d7491 | ||
|
|
f3b72b894e | ||
|
|
140f16f637 | ||
|
|
cae1fc67a4 | ||
|
|
35e25d9a8f | ||
|
|
86e122389c | ||
|
|
6616aceebb | ||
|
|
c937a9df0c | ||
|
|
9fcf286e4b | ||
|
|
e3ed71bec4 | ||
|
|
809f149df9 | ||
|
|
e4eedf5ccd | ||
|
|
20cbcb8302 | ||
|
|
cd3acf8ff9 | ||
|
|
30735388e8 | ||
|
|
478c4f83bb | ||
|
|
431fab8824 | ||
|
|
83b6d3d295 | ||
|
|
98fd79bc35 | ||
|
|
39aa27f332 | ||
|
|
bf4fb29fe6 | ||
|
|
5ed1befc53 | ||
|
|
1b311a8b36 | ||
|
|
70c3bc8128 | ||
|
|
7e49836875 | ||
|
|
d624957e6d | ||
|
|
069b57d4ae | ||
|
|
6894fe1264 | ||
|
|
93e4b5fdb9 | ||
|
|
1566fc3984 | ||
|
|
39962a0246 | ||
|
|
8d31510d5e | ||
|
|
26d5a67604 | ||
|
|
9cc8f5a377 | ||
|
|
2e11cf4dfa | ||
|
|
9e4ba9f275 | ||
|
|
aac0c25d09 | ||
|
|
d20c2a08ae | ||
|
|
4e6ba5fe3d | ||
|
|
276d1d7c7b | ||
|
|
4990c5808d | ||
|
|
cdd91c24f2 | ||
|
|
e3eb13ca72 | ||
|
|
3f0ebbf33d | ||
|
|
026aa3964b | ||
|
|
aa4c5a4a57 | ||
|
|
0874314d2a | ||
|
|
a70a7bcc8e | ||
|
|
4461a6a497 | ||
|
|
1041864ad8 | ||
|
|
015e0188ec | ||
|
|
228236c152 | ||
|
|
cd6e906dc6 | ||
|
|
8a47a92dbd | ||
|
|
af14c27df9 | ||
|
|
38edcd88c0 | ||
|
|
a74cf02030 | ||
|
|
6686755763 | ||
|
|
79cf8163be | ||
|
|
1688e26f4b | ||
|
|
5e101a8eaf | ||
|
|
65071f57d0 | ||
|
|
b87c981a90 | ||
|
|
b509e5b347 | ||
|
|
bb9fce4831 | ||
|
|
918825aca8 | ||
|
|
74bf183fad | ||
|
|
674baa1ee3 | ||
|
|
d18a0c7e15 | ||
|
|
76a6005b77 | ||
|
|
79414614c2 | ||
|
|
fde49e5446 | ||
|
|
45283161aa | ||
|
|
375d447fa8 | ||
|
|
1dd97a2bce | ||
|
|
d4a1a9b193 | ||
|
|
376c5241a8 | ||
|
|
8e6d8517cf | ||
|
|
5f9ec222c1 | ||
|
|
8954c41c0a | ||
|
|
4414ab4f47 | ||
|
|
d1d4bacc68 | ||
|
|
f476688c7f | ||
|
|
8845222700 | ||
|
|
e64c464091 | ||
|
|
b2c2d0d7d6 | ||
|
|
1fb61d313c | ||
|
|
ccf5ff632c | ||
|
|
54d6aaf56f | ||
|
|
736b262947 | ||
|
|
6a07127185 | ||
|
|
45f0ba7c0e | ||
|
|
6f4ea68778 | ||
|
|
90dda20891 | ||
|
|
278eb01c2f | ||
|
|
c3157de146 | ||
|
|
d28db485c5 | ||
|
|
caa0076396 | ||
|
|
451da40ed2 | ||
|
|
47694e7b72 | ||
|
|
e01fb7f9ae | ||
|
|
ffcdfb6a6a | ||
|
|
86f0d013bb | ||
|
|
c12ac45890 | ||
|
|
47ce68455a | ||
|
|
c1675e4b49 | ||
|
|
f8c4d39b93 | ||
|
|
e55cf5ecc6 | ||
|
|
406cf22810 | ||
|
|
8ff46bab5b | ||
|
|
5f177785b6 | ||
|
|
06779f36ca | ||
|
|
29991015b5 | ||
|
|
071a6ff8bb | ||
|
|
5b8df4c414 | ||
|
|
ce6873fe54 | ||
|
|
d0e64364e3 | ||
|
|
737ffb4c35 | ||
|
|
53048ac8ef | ||
|
|
05ca1a09b9 | ||
|
|
94e398dd1c | ||
|
|
7c0a4f61e9 | ||
|
|
056d3215e8 | ||
|
|
a68b2093e4 | ||
|
|
f440f57be2 |
+2
-1
@@ -51,7 +51,8 @@
|
|||||||
"ul": ["list"],
|
"ul": ["list"],
|
||||||
"ol": ["list"]
|
"ol": ["list"]
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"no-console": ["error", { "allow": ["warn", "error"] }]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
name: Feature Epic
|
||||||
|
about: A template to capture and scope user requirements, high level process, and basic mockups for an upcoming feature as part of the initial core spec review process.
|
||||||
|
title: 'FEATURE EPIC: '
|
||||||
|
labels: feature-epic
|
||||||
|
---
|
||||||
|
|
||||||
|
## Core Feature
|
||||||
|
|
||||||
|
<Name>
|
||||||
|
|
||||||
|
## Tasks
|
||||||
|
|
||||||
|
- [ ] Define high level requirements
|
||||||
|
- [ ] Create basic mockups
|
||||||
|
- [ ] Update "API Requirements" in core spec
|
||||||
|
- [ ] Update "User-Interface Spec" in relevant front end repo
|
||||||
|
- [ ] Create detailed user stories using normal template
|
||||||
|
|
||||||
|
## High Level Requirements
|
||||||
|
|
||||||
|
## Basic Mockups
|
||||||
|
|
||||||
|
## Link to API Requirements in Core spec
|
||||||
|
|
||||||
|
## Link to User Interface Specs
|
||||||
|
|
||||||
|
## Linked User Stories
|
||||||
@@ -7,7 +7,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
after-release:
|
after-release:
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
timeout-minutes: 30
|
timeout-minutes: 45
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -30,18 +30,20 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Wait for publish to complete
|
||||||
|
uses: lewagon/wait-on-check-action@v1.3.1
|
||||||
|
with:
|
||||||
|
ref: ${{ github.event.release.tag_name }}
|
||||||
|
check-name: '(CD) publish dist / trading'
|
||||||
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
wait-interval: 10
|
||||||
|
|
||||||
- name: resolve ipfs hashes for release
|
- name: resolve ipfs hashes for release
|
||||||
run: |
|
run: |
|
||||||
echo "Name: ${{ github.event.release.name }}"
|
echo "Name: ${{ github.event.release.name }}"
|
||||||
echo "Description: ${{ github.event.release.body }}"
|
echo "Description: ${{ github.event.release.body }}"
|
||||||
echo "Tag: ${{ github.event.release.tag_name }}"
|
echo "Tag: ${{ github.event.release.tag_name }}"
|
||||||
commit="$(git rev-list -n 1 ${{ github.event.release.tag_name }})"
|
docker run --rm vegaprotocol/trading:mainnet cat /ipfs-hash > ipfs-hash
|
||||||
echo "Commit: $commit"
|
|
||||||
until docker pull vegaprotocol/trading:$commit; do
|
|
||||||
echo "Image not pushed yet, waiting 60 seconds"
|
|
||||||
sleep 60
|
|
||||||
done
|
|
||||||
docker run --rm vegaprotocol/trading:$commit cat /ipfs-hash > ipfs-hash
|
|
||||||
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
curl -L https://dist.ipfs.tech/kubo/v0.20.0/kubo_v0.20.0_linux-amd64.tar.gz -o kubo.tgz
|
||||||
tar -xzf kubo.tgz
|
tar -xzf kubo.tgz
|
||||||
export PATH="$PATH:$PWD/kubo"
|
export PATH="$PATH:$PWD/kubo"
|
||||||
|
|||||||
@@ -81,6 +81,22 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
main-branch-name: develop
|
main-branch-name: develop
|
||||||
|
|
||||||
|
# See affected apps
|
||||||
|
- name: See affected apps
|
||||||
|
run: |
|
||||||
|
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 )"
|
||||||
|
python3 tools/ci/check-affected.py --github-ref="${{ github.ref }}" --branch-slug="$branch_slug" --event-name="${{ github.event_name }}"
|
||||||
|
|
||||||
|
- name: Verify script result
|
||||||
|
run: |
|
||||||
|
echo "Check outputs from script"
|
||||||
|
echo "projects: ${{ env.PROJECTS }}"
|
||||||
|
echo "projects-e2e: ${{ env.PROJECTS_E2E }}"
|
||||||
|
echo "preview_governance: ${{ env.PREVIEW_GOVERNANCE }}"
|
||||||
|
echo "preview_trading: ${{ env.PREVIEW_TRADING }}"
|
||||||
|
echo "preview_explorer: ${{ env.PREVIEW_EXPLORER }}"
|
||||||
|
echo "preview_tools: ${{ env.PREVIEW_TOOLS }}"
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Check formatting
|
||||||
run: yarn nx format:check
|
run: yarn nx format:check
|
||||||
|
|
||||||
@@ -96,126 +112,6 @@ jobs:
|
|||||||
- name: Build affected
|
- name: Build affected
|
||||||
run: yarn nx affected:build || (yarn install && yarn nx affected:build)
|
run: yarn nx affected:build || (yarn install && yarn nx affected:build)
|
||||||
|
|
||||||
# See affected apps
|
|
||||||
- name: See affected apps
|
|
||||||
run: |
|
|
||||||
affected="$(yarn nx print-affected --base=${{ env.NX_BASE }} --head=${{ env.NX_HEAD }} --select=projects)"
|
|
||||||
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 )"
|
|
||||||
|
|
||||||
echo ">>>> debug"
|
|
||||||
echo "NX_BASE: ${{ env.NX_BASE }}"
|
|
||||||
echo "NX_HEAD: ${{ env.NX_HEAD }}"
|
|
||||||
echo "Affected: ${affected}"
|
|
||||||
echo "Branch slug: ${branch_slug}"
|
|
||||||
echo "Current ref: ${{ github.ref }}"
|
|
||||||
echo ">>>> eof debug"
|
|
||||||
|
|
||||||
projects_array=()
|
|
||||||
|
|
||||||
preview_governance="not deployed"
|
|
||||||
preview_trading="not deployed"
|
|
||||||
preview_explorer="not deployed"
|
|
||||||
preview_tools="not deployed"
|
|
||||||
|
|
||||||
# parse if affected is any of three main applications, if none - use all of them
|
|
||||||
if echo "$affected" | grep -q governance; then
|
|
||||||
echo "Governance is affected"
|
|
||||||
projects_array+=("governance")
|
|
||||||
preview_governance=$(printf "https://%s.%s.vega.rocks" "governance" "$branch_slug")
|
|
||||||
fi
|
|
||||||
if echo "$affected" | grep -q trading; then
|
|
||||||
echo "Trading is affected"
|
|
||||||
projects_array+=("trading")
|
|
||||||
preview_trading=$(printf "https://%s.%s.vega.rocks" "trading" "$branch_slug")
|
|
||||||
fi
|
|
||||||
if echo "$affected" | grep -q explorer; then
|
|
||||||
echo "Explorer is affected"
|
|
||||||
projects_array+=("explorer")
|
|
||||||
preview_explorer=$(printf "https://%s.%s.vega.rocks" "explorer" "$branch_slug")
|
|
||||||
fi
|
|
||||||
if [[ ${#projects_array[@]} -eq 0 ]]; then
|
|
||||||
projects_array=("governance" "trading" "explorer")
|
|
||||||
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")
|
|
||||||
fi
|
|
||||||
|
|
||||||
# applications parsed before this loop are applicable for running e2e-tests
|
|
||||||
projects_e2e_array=()
|
|
||||||
for project in "${projects_array[@]}"; do
|
|
||||||
projects_e2e_array+=("${project}-e2e")
|
|
||||||
done
|
|
||||||
# all applications below this loop are not applicable for running e2e-test
|
|
||||||
|
|
||||||
# check if pull request event to deploy tools
|
|
||||||
if [[ "${{ github.event_name }}" = "pull_request" ]]; then
|
|
||||||
if echo "$affected" | grep -q multisig-signer; then
|
|
||||||
echo "Tools are affected"
|
|
||||||
echo "Deploying tools on preview"
|
|
||||||
preview_tools=$(printf "https://%s.%s.vega.rocks" "tools" "$branch_slug")
|
|
||||||
|
|
||||||
projects_array+=("multisig-signer")
|
|
||||||
fi
|
|
||||||
# those apps deploy only from develop to mainnet
|
|
||||||
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
|
||||||
if echo "$affected" | grep -q multisig-signer; then
|
|
||||||
echo "Tools are affected"
|
|
||||||
echo "Deploying tools on s3"
|
|
||||||
|
|
||||||
projects_array+=("multisig-signer")
|
|
||||||
fi
|
|
||||||
if echo "$affected" | grep -q static; then
|
|
||||||
echo "static is affected"
|
|
||||||
echo "Deploying static on s3"
|
|
||||||
|
|
||||||
projects_array+=("static")
|
|
||||||
fi
|
|
||||||
if echo "$affected" | grep -q ui-toolkit; then
|
|
||||||
echo "ui-toolkit is affected"
|
|
||||||
echo "Deploying ui-toolkit on s3"
|
|
||||||
|
|
||||||
projects_array+=("ui-toolkit")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# if branch starts with release/ and ends with trading / governance or explorer - overwrite the array of affected projects with fixed single application
|
|
||||||
if [[ "${{ github.ref }}" == *release* ]]; then
|
|
||||||
echo ">> This is a relase branch"
|
|
||||||
case "${{ github.ref }}" in
|
|
||||||
*trading)
|
|
||||||
echo ">> Only trading will be deployed"
|
|
||||||
projects_array=(trading)
|
|
||||||
projects_e2e_array=(trading)
|
|
||||||
;;
|
|
||||||
*governance)
|
|
||||||
echo ">> Only governance will be deployed"
|
|
||||||
projects_array=(governance)
|
|
||||||
projects_e2e_array=(governance)
|
|
||||||
;;
|
|
||||||
*explorer)
|
|
||||||
echo ">> Only explorer will be deployed"
|
|
||||||
projects_array=(explorer)
|
|
||||||
projects_e2e_array=(explorer)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo ">> All apps will be deployed"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Projects: ${projects_array[@]}"
|
|
||||||
echo "Projects E2E: ${projects_e2e_array[@]}"
|
|
||||||
projects_json=$(jq -M --compact-output --null-input '$ARGS.positional' --args -- "${projects_array[@]}")
|
|
||||||
projects_e2e_json=$(jq -M --compact-output --null-input '$ARGS.positional' --args -- "${projects_e2e_array[@]}")
|
|
||||||
|
|
||||||
echo PROJECTS_E2E=$projects_e2e_json >> $GITHUB_ENV
|
|
||||||
echo PROJECTS=$projects_json >> $GITHUB_ENV
|
|
||||||
|
|
||||||
echo PREVIEW_GOVERNANCE=$preview_governance >> $GITHUB_ENV
|
|
||||||
echo PREVIEW_TRADING=$preview_trading >> $GITHUB_ENV
|
|
||||||
echo PREVIEW_EXPLORER=$preview_explorer >> $GITHUB_ENV
|
|
||||||
echo PREVIEW_TOOLS=$preview_tools >> $GITHUB_ENV
|
|
||||||
|
|
||||||
outputs:
|
outputs:
|
||||||
projects: ${{ env.PROJECTS }}
|
projects: ${{ env.PROJECTS }}
|
||||||
projects-e2e: ${{ env.PROJECTS_E2E }}
|
projects-e2e: ${{ env.PROJECTS_E2E }}
|
||||||
@@ -224,6 +120,15 @@ jobs:
|
|||||||
preview_explorer: ${{ env.PREVIEW_EXPLORER }}
|
preview_explorer: ${{ env.PREVIEW_EXPLORER }}
|
||||||
preview_tools: ${{ env.PREVIEW_TOOLS }}
|
preview_tools: ${{ env.PREVIEW_TOOLS }}
|
||||||
|
|
||||||
|
console-e2e:
|
||||||
|
needs: lint-test-build
|
||||||
|
name: '(CI) console python'
|
||||||
|
uses: ./.github/workflows/console-test-run.yml
|
||||||
|
secrets: inherit
|
||||||
|
if: ${{ contains(fromJSON(needs.lint-test-build.outputs.projects), 'trading') && github.event_name == 'pull_request' }}
|
||||||
|
with:
|
||||||
|
github-sha: ${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
|
|
||||||
cypress:
|
cypress:
|
||||||
needs: lint-test-build
|
needs: lint-test-build
|
||||||
name: '(CI) cypress'
|
name: '(CI) cypress'
|
||||||
@@ -232,7 +137,7 @@ jobs:
|
|||||||
secrets: inherit
|
secrets: inherit
|
||||||
with:
|
with:
|
||||||
projects: ${{ needs.lint-test-build.outputs.projects-e2e }}
|
projects: ${{ needs.lint-test-build.outputs.projects-e2e }}
|
||||||
tags: '@smoke @regression'
|
tags: '@smoke'
|
||||||
|
|
||||||
publish-dist:
|
publish-dist:
|
||||||
needs: lint-test-build
|
needs: lint-test-build
|
||||||
|
|||||||
@@ -1,55 +1,138 @@
|
|||||||
name: console-test-run
|
name: (CI) Console tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
github-sha:
|
github-sha:
|
||||||
required: true
|
required: true
|
||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
console-test:
|
run-tests:
|
||||||
timeout-minutes: 5
|
name: run-tests
|
||||||
runs-on: self-hosted-runner
|
runs-on: 8-cores
|
||||||
|
timeout-minutes: 20
|
||||||
steps:
|
steps:
|
||||||
|
#----------------------------------------------
|
||||||
|
# check-out frontend-monorepo
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Checkout console test repo
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.github-sha }}
|
||||||
|
#----------------------------------------------
|
||||||
|
# cache node modules
|
||||||
|
#----------------------------------------------
|
||||||
|
- 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-
|
||||||
|
#----------------------------------------------
|
||||||
|
# setup node
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Setup node
|
||||||
|
uses: actions/setup-node@v3
|
||||||
|
with:
|
||||||
|
node-version-file: '.nvmrc'
|
||||||
|
# https://stackoverflow.com/questions/61010294/how-to-cache-yarn-packages-in-github-actions
|
||||||
|
cache: yarn
|
||||||
|
#----------------------------------------------
|
||||||
|
# install deps if cache missing
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: yarn install
|
||||||
|
if: steps.cache.outputs.cache-hit != 'true'
|
||||||
|
run: yarn install --pure-lockfile
|
||||||
|
#----------------------------------------------
|
||||||
|
# build trading
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Build affected spec
|
||||||
|
run: |
|
||||||
|
yarn env-cmd -f ./apps/trading/.env.stagnet1 yarn nx export trading
|
||||||
|
#----------------------------------------------
|
||||||
|
# run trading server
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Run trading server
|
||||||
|
run: |
|
||||||
|
docker run -d -p 80:4200 -v $PWD/docker/nginx.conf:/etc/nginx/conf.d/default.conf -v $PWD/dist/apps/trading/exported:/usr/share/nginx/html nginx:1.23-alpine@sha256:6318314189b40e73145a48060bff4783a116c34cc7241532d0d94198fb2c9629
|
||||||
|
sleep 5
|
||||||
|
docker ps
|
||||||
|
#----------------------------------------------
|
||||||
|
# check if container persists between runs
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Check server
|
||||||
|
run: |
|
||||||
|
docker ps
|
||||||
|
#----------------------------------------------
|
||||||
|
# check-out tests repo
|
||||||
|
#----------------------------------------------
|
||||||
- name: Checkout console test repo
|
- name: Checkout console test repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
repository: vegaprotocol/console-test
|
repository: vegaprotocol/console-test
|
||||||
path: './console-test'
|
path: './console-test'
|
||||||
|
#----------------------------------------------
|
||||||
- name: Set up Python
|
# set-up python
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Set up python
|
||||||
|
id: setup-python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.10.11'
|
python-version: '3.10.11'
|
||||||
|
#----------------------------------------------
|
||||||
|
# ----- install & configure poetry -----
|
||||||
|
#----------------------------------------------
|
||||||
- name: Install Poetry
|
- name: Install Poetry
|
||||||
uses: snok/install-poetry@v1
|
uses: snok/install-poetry@v1
|
||||||
|
with:
|
||||||
|
virtualenvs-create: true
|
||||||
|
virtualenvs-in-project: true
|
||||||
|
virtualenvs-path: console-test/.venv
|
||||||
|
#----------------------------------------------
|
||||||
|
# load cached venv if cache exists
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Load cached venv
|
||||||
|
id: cached-poetry-dependencies
|
||||||
|
uses: actions/cache@v3
|
||||||
|
with:
|
||||||
|
path: console-test/.venv
|
||||||
|
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
|
||||||
|
#----------------------------------------------
|
||||||
|
# install dependencies if cache does not exist
|
||||||
|
#----------------------------------------------
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
|
||||||
poetry install --no-root
|
|
||||||
working-directory: ./console-test
|
working-directory: ./console-test
|
||||||
|
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
|
||||||
- name: load Binaries
|
run: poetry install --no-interaction --no-root
|
||||||
run: |
|
#----------------------------------------------
|
||||||
poetry run python -m vega_sim.tools.load_binaries
|
# install vega binaries
|
||||||
|
#----------------------------------------------
|
||||||
|
- name: Install vega binaries
|
||||||
working-directory: ./console-test
|
working-directory: ./console-test
|
||||||
|
run: poetry run python -m vega_sim.tools.load_binaries --force
|
||||||
- name: pull console
|
#----------------------------------------------
|
||||||
run: |
|
# install playwright
|
||||||
poetry run docker pull ghcr.io/vegaprotocol/frontend/trading:${{ inputs.github-sha }}
|
#----------------------------------------------
|
||||||
|
|
||||||
- name: Update container_name in config.py
|
|
||||||
run: |
|
|
||||||
sed -i "s/container_name = \".*\"/container_name = \"vegaprotocol\/frontend\/trading:${{ inputs.github-sha }}\"/g" config.py
|
|
||||||
|
|
||||||
- name: install playwright
|
- name: install playwright
|
||||||
run: poetry run playwright install
|
run: poetry run playwright install
|
||||||
working-directory: ./console-test
|
working-directory: ./console-test
|
||||||
|
#----------------------------------------------
|
||||||
- name: run tests
|
# run tests
|
||||||
run: poetry run pytest --numprocesses auto
|
#----------------------------------------------
|
||||||
|
- name: Run tests
|
||||||
working-directory: ./console-test
|
working-directory: ./console-test
|
||||||
|
run: poetry run pytest -s --numprocesses auto --dist loadfile
|
||||||
|
- name: Check files
|
||||||
|
run: |
|
||||||
|
ls -al .
|
||||||
|
ls -al console-test
|
||||||
|
#----------------------------------------------
|
||||||
|
# upload traces
|
||||||
|
#----------------------------------------------
|
||||||
- name: Upload Playwright Trace
|
- name: Upload Playwright Trace
|
||||||
uses: actions/upload-artifact@v3
|
uses: actions/upload-artifact@v3
|
||||||
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: 100
|
timeout-minutes: 120
|
||||||
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
|
||||||
|
|||||||
@@ -28,6 +28,13 @@ jobs:
|
|||||||
echo IS_MAINNET_RELEASE=false >> $GITHUB_ENV
|
echo IS_MAINNET_RELEASE=false >> $GITHUB_ENV
|
||||||
echo IS_TESTNET_RELEASE=false >> $GITHUB_ENV
|
echo IS_TESTNET_RELEASE=false >> $GITHUB_ENV
|
||||||
echo IS_IPFS_RELEASE=false >> $GITHUB_ENV
|
echo IS_IPFS_RELEASE=false >> $GITHUB_ENV
|
||||||
|
echo IS_S3_RELEASE=false >> $GITHUB_ENV
|
||||||
|
echo IS_DEV_IMAGE=false >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Is dev image
|
||||||
|
if: ${{ contains(github.ref, 'develop') && github.event_name == 'push' && matrix.app == 'trading' }}
|
||||||
|
run: |
|
||||||
|
echo IS_DEV_IMAGE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Is PR
|
- name: Is PR
|
||||||
if: ${{ github.event_name == 'pull_request' }}
|
if: ${{ github.event_name == 'pull_request' }}
|
||||||
@@ -35,7 +42,7 @@ jobs:
|
|||||||
echo IS_PR=true >> $GITHUB_ENV
|
echo IS_PR=true >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Is mainnet release
|
- name: Is mainnet release
|
||||||
if: ${{ contains(github.ref, 'release/mainnnet') && !contains(github.ref, 'mirror') }}
|
if: ${{ contains(github.ref, 'release/mainnet') && !contains(github.ref, 'mirror') }}
|
||||||
run: |
|
run: |
|
||||||
echo IS_MAINNET_RELEASE=true >> $GITHUB_ENV
|
echo IS_MAINNET_RELEASE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
@@ -49,6 +56,11 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
echo IS_IPFS_RELEASE=true >> $GITHUB_ENV
|
echo IS_IPFS_RELEASE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Is S3 Release
|
||||||
|
if: ${{ env.IS_IPFS_RELEASE == 'false' && github.event_name == 'push' }}
|
||||||
|
run: |
|
||||||
|
echo IS_S3_RELEASE=true >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
id: quemu
|
id: quemu
|
||||||
uses: docker/setup-qemu-action@v2
|
uses: docker/setup-qemu-action@v2
|
||||||
@@ -69,7 +81,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Log in to the Container registry (docker hub)
|
- name: Log in to the Container registry (docker hub)
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
if: ${{ env.IS_IPFS_RELEASE == 'true' }}
|
if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }}
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||||
@@ -91,52 +103,13 @@ jobs:
|
|||||||
- name: Define dist variables
|
- name: Define dist variables
|
||||||
if: ${{ github.event_name == 'push' }}
|
if: ${{ github.event_name == 'push' }}
|
||||||
run: |
|
run: |
|
||||||
envName=''
|
python3 tools/ci/define-dist-variables.py --github-ref="${{ github.ref }}" --app="${{ matrix.app }}"
|
||||||
domain="vega.rocks"
|
|
||||||
bucketName=''
|
|
||||||
|
|
||||||
if [[ "${{ github.ref }}" =~ .*release/.* ]]; then
|
- name: Verify script result
|
||||||
# remove prefixing release/ and take the first string limited by - which is supposed to be name of the environment for releasing (format: release/testnet-trading)
|
if: ${{ github.event_name == 'push' }}
|
||||||
envName="$(echo ${{ github.ref }} | sed -e "s|refs/heads/release/||" | cut -d '-' -f 1 )"
|
run: |
|
||||||
elif [[ "${{ github.ref }}" =~ .*develop$ ]]; then
|
echo "BUCKET_NAME=${{ env.BUCKET_NAME }}"
|
||||||
envName="stagnet1"
|
echo "ENV_NAME=${{ env.ENV_NAME }}"
|
||||||
if [[ "${{ matrix.app }}" = "multisig-signer" ]]; then
|
|
||||||
envName="mainnet"
|
|
||||||
bucketName="tools.vega.xyz"
|
|
||||||
fi
|
|
||||||
if [[ "${{ matrix.app }}" = "static" ]]; then
|
|
||||||
envName="mainnet"
|
|
||||||
bucketName="static.vega.xyz"
|
|
||||||
fi
|
|
||||||
if [[ "${{ matrix.app }}" = "ui-toolkit" ]]; then
|
|
||||||
envName="mainnet"
|
|
||||||
bucketName="ui.vega.rocks"
|
|
||||||
fi
|
|
||||||
elif [[ "${{ github.ref }}" =~ .*mainnet$ ]]; then
|
|
||||||
envName="mainnet"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${envName}" = "mainnet" ]]; then
|
|
||||||
domain="vega.xyz"
|
|
||||||
if [[ -z "${bucketName}" ]]; then
|
|
||||||
bucketName="${{ matrix.app }}.${domain}"
|
|
||||||
fi
|
|
||||||
elif [[ "${envName}" = "testnet" ]]; then
|
|
||||||
domain="fairground.wtf"
|
|
||||||
if [[ -z "${bucketName}" ]]; then
|
|
||||||
bucketName="${{ matrix.app }}.${domain}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${bucketName}" ]]; then
|
|
||||||
bucketName="${{ matrix.app }}.${envName}.${domain}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "bucket name: ${bucketName}"
|
|
||||||
echo "env name: ${envName}"
|
|
||||||
|
|
||||||
echo BUCKET_NAME=${bucketName} >> $GITHUB_ENV
|
|
||||||
echo ENV_NAME=${envName} >> $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Build local dist
|
- name: Build local dist
|
||||||
run: |
|
run: |
|
||||||
@@ -151,8 +124,12 @@ jobs:
|
|||||||
elif [ "${{ matrix.app }}" = "ui-toolkit" ]; then
|
elif [ "${{ matrix.app }}" = "ui-toolkit" ]; then
|
||||||
NODE_ENV=production yarn nx run ui-toolkit:build-storybook
|
NODE_ENV=production yarn nx run ui-toolkit:build-storybook
|
||||||
DIST_LOCATION=dist/storybook/ui-toolkit
|
DIST_LOCATION=dist/storybook/ui-toolkit
|
||||||
|
elif [ "${{ matrix.app }}" = "static" ]; then
|
||||||
|
yarn nx build static || (yarn install && yarn nx build static)
|
||||||
else
|
else
|
||||||
$envCmd yarn nx build ${{ matrix.app }} || (yarn install && $envCmd yarn nx build ${{ matrix.app }})
|
$envCmd yarn nx build ${{ matrix.app }} || (yarn install && $envCmd yarn nx build ${{ matrix.app }})
|
||||||
|
fi
|
||||||
|
if [[ -z "$DIST_LOCATION" ]]; then
|
||||||
DIST_LOCATION=dist/apps/${{ matrix.app }}
|
DIST_LOCATION=dist/apps/${{ matrix.app }}
|
||||||
fi
|
fi
|
||||||
mv $DIST_LOCATION dist-result
|
mv $DIST_LOCATION dist-result
|
||||||
@@ -202,7 +179,7 @@ jobs:
|
|||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
id: dockerhub-push
|
id: dockerhub-push
|
||||||
if: ${{ env.IS_IPFS_RELEASE == 'true' }}
|
if: ${{ env.IS_IPFS_RELEASE == 'true' || env.IS_DEV_IMAGE == 'true' }}
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: docker/node-outside-docker.Dockerfile
|
file: docker/node-outside-docker.Dockerfile
|
||||||
@@ -212,7 +189,7 @@ jobs:
|
|||||||
ENV_NAME=${{ env.ENV_NAME }}
|
ENV_NAME=${{ env.ENV_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
vegaprotocol/${{ matrix.app }}:${{ github.sha }}
|
vegaprotocol/${{ matrix.app }}:${{ github.sha }}
|
||||||
vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || '' }}
|
vegaprotocol/${{ matrix.app }}:${{ env.IS_MAINNET_RELEASE == 'true' && 'mainnet' || env.IS_TESTNET_RELEASE == 'true' && 'testnet' || env.IS_DEV_IMAGE == 'true' && 'develop' || '' }}
|
||||||
|
|
||||||
- name: Publish dist as docker image (ghcr - retry)
|
- name: Publish dist as docker image (ghcr - retry)
|
||||||
uses: docker/build-push-action@v3
|
uses: docker/build-push-action@v3
|
||||||
@@ -245,7 +222,7 @@ jobs:
|
|||||||
- name: Publish dist to s3
|
- name: Publish dist to s3
|
||||||
uses: jakejarvis/s3-sync-action@master
|
uses: jakejarvis/s3-sync-action@master
|
||||||
# s3 releases are not happening for trading on mainnet - it's IPFS
|
# s3 releases are not happening for trading on mainnet - it's IPFS
|
||||||
if: ${{ env.IS_IPFS_RELEASE == 'false' }}
|
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||||
with:
|
with:
|
||||||
args: --acl private --follow-symlinks --delete
|
args: --acl private --follow-symlinks --delete
|
||||||
env:
|
env:
|
||||||
@@ -256,11 +233,11 @@ jobs:
|
|||||||
SOURCE_DIR: 'dist-result'
|
SOURCE_DIR: 'dist-result'
|
||||||
|
|
||||||
- name: Install aws CLI
|
- name: Install aws CLI
|
||||||
if: ${{ env.IS_IPFS_RELEASE == 'false' }}
|
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||||
uses: unfor19/install-aws-cli-action@master
|
uses: unfor19/install-aws-cli-action@master
|
||||||
|
|
||||||
- name: Perform cache invalidation
|
- name: Perform cache invalidation
|
||||||
if: ${{ env.IS_IPFS_RELEASE == 'false' }}
|
if: ${{ env.IS_S3_RELEASE == 'true' }}
|
||||||
env:
|
env:
|
||||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
|
|||||||
@@ -16,5 +16,10 @@ NX_EXPLORER_NETWORK_PARAMETERS=1
|
|||||||
NX_EXPLORER_PARTIES=1
|
NX_EXPLORER_PARTIES=1
|
||||||
NX_EXPLORER_VALIDATORS=1
|
NX_EXPLORER_VALIDATORS=1
|
||||||
|
|
||||||
CYPRESS_VEGA_WALLET_API_TOKEN=
|
|
||||||
CYPRESS_VEGA_URL=http://localhost:3008/graphql
|
CYPRESS_VEGA_URL=http://localhost:3008/graphql
|
||||||
|
CYPRESS_ETH_WALLET_MNEMONIC=ozone access unlock valid olympic save include omit supply green clown session
|
||||||
|
CYPRESS_ETHEREUM_PROVIDER_URL=http://localhost:8545
|
||||||
|
CYPRESS_FAUCET_URL=http://localhost:1790/api/v1/mint
|
||||||
|
CYPRESS_VEGA_PUBLIC_KEY=02eceaba4df2bef76ea10caf728d8a099a2aa846cced25737cccaa9812342f65
|
||||||
|
CYPRESS_VEGA_WALLET_URL=http://localhost:1789
|
||||||
|
CYPRESS_VEGA_WALLET_API_TOKEN=
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ module.exports = defineConfig({
|
|||||||
viewportWidth: 1440,
|
viewportWidth: 1440,
|
||||||
viewportHeight: 900,
|
viewportHeight: 900,
|
||||||
testIsolation: false,
|
testIsolation: false,
|
||||||
|
experimentalMemoryManagement: true,
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
environment: 'CUSTOM',
|
environment: 'CUSTOM',
|
||||||
|
|||||||
@@ -1,19 +1,174 @@
|
|||||||
//Tests set to skip until market bug for capsule checkpoint is fixed
|
import { createSuccessorMarketProposal } from '../support/governance.functions';
|
||||||
context.skip('Market page', { tags: '@regression' }, function () {
|
|
||||||
describe('Verify elements on page', function () {
|
|
||||||
const marketHeaders = '[data-testid="markets-header"]';
|
|
||||||
const marketNavigation = 'a[href="/markets"]';
|
|
||||||
|
|
||||||
it('Markets page is displayed', function () {
|
context('Market page', { tags: '@regression' }, function () {
|
||||||
|
describe('Verify elements on page', function () {
|
||||||
|
const marketHeaders = 'markets-heading';
|
||||||
|
|
||||||
|
before('Create market', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
cy.get(marketNavigation).click();
|
cy.createMarket();
|
||||||
cy.common_validate_blocks_data_displayed(marketHeaders);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Markets page displayed on mobile', function () {
|
beforeEach('Get market id', function () {
|
||||||
|
cy.navigate_to('markets');
|
||||||
|
cy.get('[col-id="id"]').last().invoke('text').as('createdMarketId');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Market displayed on market page', function () {
|
||||||
|
cy.navigate_to('markets');
|
||||||
|
cy.getByTestId(marketHeaders).should('be.visible');
|
||||||
|
cy.get(`[row-id="${this.createdMarketId}"]`)
|
||||||
|
.should('be.visible')
|
||||||
|
.within(() => {
|
||||||
|
cy.get_element_by_col_id('code').should('have.text', 'TEST.24h');
|
||||||
|
cy.get_element_by_col_id('name').should('have.text', 'Test market 1');
|
||||||
|
cy.get_element_by_col_id('state').should('have.text', 'Pending');
|
||||||
|
cy.get_element_by_col_id('asset').should('have.text', 'fUSDC');
|
||||||
|
cy.get_element_by_col_id('id').should(
|
||||||
|
'have.text',
|
||||||
|
this.createdMarketId
|
||||||
|
);
|
||||||
|
cy.get_element_by_col_id('actions')
|
||||||
|
.find('a')
|
||||||
|
.should('have.attr', 'href', `/markets/${this.createdMarketId}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Able to go to market details page', function () {
|
||||||
|
cy.navigate_to('markets');
|
||||||
|
cy.get_element_by_col_id('actions').eq(1).click();
|
||||||
|
cy.getByTestId(marketHeaders).should('have.text', 'Test market 1');
|
||||||
|
cy.validate_element_from_table('Name', 'Test market 1');
|
||||||
|
cy.validate_element_from_table('Market ID', this.createdMarketId);
|
||||||
|
cy.validate_element_from_table('Trading Mode', 'Opening auction');
|
||||||
|
cy.validate_element_from_table('Market Decimal Places', '5');
|
||||||
|
cy.validate_element_from_table('Position Decimal Places', '5');
|
||||||
|
cy.validate_element_from_table('Settlement Asset Decimal Places', '5');
|
||||||
|
// Instrument
|
||||||
|
cy.validate_element_from_table('Market Name', 'Test market 1');
|
||||||
|
cy.validate_element_from_table('Code', 'TEST.24h');
|
||||||
|
cy.validate_element_from_table('Product Type', 'Future');
|
||||||
|
cy.validate_element_from_table('Quote Name', 'fUSDC');
|
||||||
|
// Settlement Asset
|
||||||
|
cy.validate_element_from_table('Quote Name', 'fUSDC');
|
||||||
|
cy.validate_element_from_table('Symbol', 'fUSDC');
|
||||||
|
cy.validate_element_from_table('Decimals', '5');
|
||||||
|
cy.validate_element_from_table('Quantum', '0.00');
|
||||||
|
cy.validate_element_from_table('Status', 'Enabled');
|
||||||
|
cy.validate_element_from_table('Max faucet amount', '10,000,000.00');
|
||||||
|
cy.validate_element_from_table(
|
||||||
|
'Infrastructure fee account balance',
|
||||||
|
'0.00'
|
||||||
|
);
|
||||||
|
cy.validate_element_from_table(
|
||||||
|
'Global reward pool account balance',
|
||||||
|
'0.00'
|
||||||
|
);
|
||||||
|
// Metadata
|
||||||
|
cy.validate_element_from_table('Sector', 'tech');
|
||||||
|
cy.validate_element_from_table('Source', 'docs.vega.xyz');
|
||||||
|
// Risk model
|
||||||
|
cy.validate_element_from_table('Tau', '0.0001140771161');
|
||||||
|
cy.validate_element_from_table('Risk Aversion Parameter', '0.01');
|
||||||
|
// Risk parameters
|
||||||
|
// cy.validate_element_from_table('R', '0.016')
|
||||||
|
cy.validate_element_from_table('Sigma', '0.5');
|
||||||
|
// Risk factors
|
||||||
|
cy.validate_element_from_table('Short', '0.0143218738374871');
|
||||||
|
cy.validate_element_from_table('Long', '0.0141450471498822');
|
||||||
|
// Price monitoring settings 1
|
||||||
|
cy.validate_element_from_table('Horizon Secs', '43,200');
|
||||||
|
cy.validate_element_from_table('Probability', '1');
|
||||||
|
cy.validate_element_from_table('Auction Extension Secs', '600');
|
||||||
|
// Liquidity Monitoring
|
||||||
|
cy.validate_element_from_table('Triggering Ratio', '0.7');
|
||||||
|
cy.validate_element_from_table('Time Window', '3,600');
|
||||||
|
cy.validate_element_from_table('Scaling Factor', '10');
|
||||||
|
// Liquidity
|
||||||
|
cy.validate_element_from_table('Target Stake', '0.00 fUSDC');
|
||||||
|
cy.validate_element_from_table('Supplied Stake', '0.00 fUSDC');
|
||||||
|
cy.validate_element_from_table('Market Value Proxy', '0.00 fUSDC');
|
||||||
|
// Liquidity price range
|
||||||
|
cy.validate_element_from_table(
|
||||||
|
'Liquidity Price Range',
|
||||||
|
'1,000.00% of mid price'
|
||||||
|
);
|
||||||
|
cy.validate_element_from_table('Lowest Price', '0.00 fUSDC');
|
||||||
|
cy.validate_element_from_table('Highest Price', '0.00 fUSDC');
|
||||||
|
|
||||||
|
cy.getByTestId('oracle-spec-links')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and(
|
||||||
|
'contain',
|
||||||
|
'/oracles/bf242aa5c9f64fcbb77808aa8582e73711519f4b35264eb797a80f1803590a24'
|
||||||
|
);
|
||||||
|
|
||||||
|
// Able to view Json
|
||||||
|
cy.contains('View JSON').click();
|
||||||
|
cy.get('.language-json').should('exist');
|
||||||
|
cy.getByTestId('icon-cross').click();
|
||||||
|
});
|
||||||
|
|
||||||
|
// Skipping due to resize observer loop limit error
|
||||||
|
it.skip('Markets page displayed on mobile', function () {
|
||||||
cy.common_switch_to_mobile_and_click_toggle();
|
cy.common_switch_to_mobile_and_click_toggle();
|
||||||
cy.get(marketNavigation).click();
|
cy.navigate_to('markets', true);
|
||||||
cy.common_validate_blocks_data_displayed(marketHeaders);
|
cy.getByTestId(marketHeaders).should('be.visible');
|
||||||
|
cy.get(`[row-id="${this.createdMarketId}"]`)
|
||||||
|
.should('be.visible')
|
||||||
|
.within(() => {
|
||||||
|
cy.get_element_by_col_id('code').should('have.text', 'TEST.24h');
|
||||||
|
cy.get_element_by_col_id('name').should('have.text', 'Test market 1');
|
||||||
|
cy.get_element_by_col_id('state').should('have.text', 'Pending');
|
||||||
|
cy.get_element_by_col_id('asset').should('have.text', 'fUSDC');
|
||||||
|
cy.get_element_by_col_id('id').should(
|
||||||
|
'have.text',
|
||||||
|
this.createdMarketId
|
||||||
|
);
|
||||||
|
cy.get_element_by_col_id('actions')
|
||||||
|
.find('a')
|
||||||
|
.should('have.attr', 'href', `/markets/${this.createdMarketId}`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Able to go to market details page for successor market', function () {
|
||||||
|
const successionLineItem = 'succession-line-item';
|
||||||
|
const successionLineMarketId = 'succession-line-item-market-id';
|
||||||
|
|
||||||
|
createSuccessorMarketProposal(this.createdMarketId);
|
||||||
|
cy.navigate_to('markets');
|
||||||
|
cy.reload();
|
||||||
|
cy.contains('Token test market', { timeout: 8000 }).should('be.visible');
|
||||||
|
cy.get('[row-index="0"]')
|
||||||
|
.invoke('attr', 'row-id')
|
||||||
|
.as('successorMarketId');
|
||||||
|
cy.contains('Token test market').click();
|
||||||
|
cy.getByTestId(marketHeaders).should('have.text', 'Token test market');
|
||||||
|
cy.validate_proposal_change_type('Triggering Ratio', 'Added');
|
||||||
|
cy.validate_element_from_table('Triggering Ratio', '0.7');
|
||||||
|
cy.validate_proposal_change_type('Time Window', 'Added');
|
||||||
|
cy.validate_element_from_table('Time Window', '3,600');
|
||||||
|
cy.validate_proposal_change_type('Scaling Factor', 'Added');
|
||||||
|
cy.validate_element_from_table('Scaling Factor', '10');
|
||||||
|
|
||||||
|
cy.getByTestId(successionLineItem)
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.contains('Test market 1');
|
||||||
|
cy.getByTestId(successionLineMarketId).should(
|
||||||
|
'have.text',
|
||||||
|
this.createdMarketId
|
||||||
|
);
|
||||||
|
});
|
||||||
|
cy.getByTestId(successionLineItem)
|
||||||
|
.eq(1)
|
||||||
|
.within(() => {
|
||||||
|
cy.contains('Token test market');
|
||||||
|
cy.getByTestId(successionLineMarketId).should(
|
||||||
|
'have.text',
|
||||||
|
this.successorMarketId
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,49 @@
|
|||||||
|
context('Proposal page', { tags: '@smoke' }, function () {
|
||||||
|
describe('Verify elements on page', function () {
|
||||||
|
const proposalHeading = 'proposals-heading';
|
||||||
|
const dateTimeRegex =
|
||||||
|
/(\d{1,2})\/(\d{1,2})\/(\d{4}), (\d{1,2}):(\d{1,2}):(\d{1,2})/gm;
|
||||||
|
const proposalTitle = 'Add Lorem Ipsum market';
|
||||||
|
|
||||||
|
before('Create market proposal', function () {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.createMarket();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Able to view proposal', function () {
|
||||||
|
cy.navigate_to('governanceProposals');
|
||||||
|
cy.getByTestId(proposalHeading).should('be.visible');
|
||||||
|
cy.contains(proposalTitle)
|
||||||
|
.parent()
|
||||||
|
.parent()
|
||||||
|
.parent()
|
||||||
|
.within(() => {
|
||||||
|
cy.get_element_by_col_id('title').should('have.text', proposalTitle);
|
||||||
|
cy.get_element_by_col_id('type').should('have.text', 'NewMarket');
|
||||||
|
cy.get_element_by_col_id('state').should('have.text', 'Enacted');
|
||||||
|
cy.getByTestId('vote-progress').should('be.visible');
|
||||||
|
cy.get('[col-id="cDate"]')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', dateTimeRegex);
|
||||||
|
cy.get('[col-id="eDate"]')
|
||||||
|
.invoke('text')
|
||||||
|
.should('match', dateTimeRegex);
|
||||||
|
cy.getByTestId('external-link')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and('contains', 'https://governance.fairground.wtf/proposals/');
|
||||||
|
cy.contains('View terms').should('exist').click();
|
||||||
|
});
|
||||||
|
cy.getByTestId('dialog-title').should('have.text', proposalTitle);
|
||||||
|
cy.get('.language-json').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
|
it.skip('Proposal page displayed on mobile', function () {
|
||||||
|
cy.common_switch_to_mobile_and_click_toggle();
|
||||||
|
cy.navigate_to('governanceProposals', true);
|
||||||
|
cy.getByTestId(proposalHeading).should('be.visible');
|
||||||
|
cy.get('[row-index="0"]').within(() => {
|
||||||
|
cy.get_element_by_col_id('title').should('have.text', proposalTitle);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -40,7 +40,7 @@ context.skip('Transactions page', function () {
|
|||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
} else {
|
} else {
|
||||||
cy.slack('Unable to find any transactions on page');
|
cy.log('Unable to find any transactions on page');
|
||||||
cy.screenshot();
|
cy.screenshot();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -78,7 +78,7 @@ context.skip('Transactions page', function () {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
cy.slack('Unable to find any transactions on page');
|
cy.log('Unable to find any transactions on page');
|
||||||
cy.screenshot();
|
cy.screenshot();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,7 +7,11 @@ context('Validator page', { tags: '@smoke' }, function () {
|
|||||||
it('should be able to see validator tiles', function () {
|
it('should be able to see validator tiles', function () {
|
||||||
cy.getNodes().then((nodes) => {
|
cy.getNodes().then((nodes) => {
|
||||||
nodes.forEach((node) => {
|
nodes.forEach((node) => {
|
||||||
cy.get(`[validator-id="${node.id}"]`).should('be.visible');
|
if (node.rankingScore.performanceScore > 0) {
|
||||||
|
cy.get(`[validator-id="${node.id}"]`).should('be.visible');
|
||||||
|
} else {
|
||||||
|
cy.get(`[validator-id="${node.id}"]`).should('not.exist');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Cypress.Commands.add('switchToMobile', () => {
|
|||||||
Cypress.Commands.add('common_switch_to_mobile_and_click_toggle', function () {
|
Cypress.Commands.add('common_switch_to_mobile_and_click_toggle', function () {
|
||||||
cy.viewport('iphone-x');
|
cy.viewport('iphone-x');
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
cy.get('[data-testid="open-menu"]').click();
|
cy.get('[data-testid="button-menu-drawer"]').click();
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add('monitor_clipboard', () => {
|
Cypress.Commands.add('monitor_clipboard', () => {
|
||||||
@@ -88,3 +88,49 @@ Cypress.Commands.add('convert_number_to_max_four_decimal', (number) => {
|
|||||||
maximumFractionDigits: 4,
|
maximumFractionDigits: 4,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('navigate_to', (page, mobileView = false) => {
|
||||||
|
const navigation = {
|
||||||
|
transactions: '/txs',
|
||||||
|
blocks: '/blocks',
|
||||||
|
oracles: '/oracles',
|
||||||
|
validators: '/validators',
|
||||||
|
parties: '/parties',
|
||||||
|
assets: '/assets',
|
||||||
|
markets: '/markets',
|
||||||
|
governanceProposals: '/governance',
|
||||||
|
networkParameters: '/network-parameters',
|
||||||
|
genesisParameters: '/genesis',
|
||||||
|
};
|
||||||
|
|
||||||
|
const topLevelRoutes = ['transactions', 'blocks', 'oracles', 'validators'];
|
||||||
|
|
||||||
|
cy.getByTestId('navigation').within(() => {
|
||||||
|
if (!topLevelRoutes.includes(page) && mobileView === false) {
|
||||||
|
cy.getByTestId('other').first().click();
|
||||||
|
}
|
||||||
|
cy.get(`[href="${navigation[page]}"]`).first().click();
|
||||||
|
});
|
||||||
|
cy.url().should('include', navigation[page]);
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('get_element_by_col_id', (elementName) => {
|
||||||
|
cy.get(`[col-id="${elementName}"]`);
|
||||||
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add(
|
||||||
|
'validate_element_from_table',
|
||||||
|
(tableRowName, tableRowValue) => {
|
||||||
|
cy.contains(tableRowName)
|
||||||
|
.parentsUntil("[data-testid='key-value-table-row']")
|
||||||
|
.siblings()
|
||||||
|
.should('have.text', tableRowValue);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
Cypress.Commands.add(
|
||||||
|
'validate_proposal_change_type',
|
||||||
|
(tableRowName, changeType) => {
|
||||||
|
cy.contains(tableRowName).siblings().should('have.text', changeType);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|||||||
@@ -0,0 +1,130 @@
|
|||||||
|
export function createSuccessorMarketProposal(parentMarketId) {
|
||||||
|
cy.VegaWalletSubmitProposal(getSuccessorTxBody(parentMarketId));
|
||||||
|
}
|
||||||
|
|
||||||
|
function getSuccessorTxBody(parentMarketId) {
|
||||||
|
return {
|
||||||
|
proposalSubmission: {
|
||||||
|
rationale: {
|
||||||
|
title: 'Test successor market proposal details',
|
||||||
|
description: 'E2E test for successor market',
|
||||||
|
},
|
||||||
|
terms: {
|
||||||
|
newMarket: {
|
||||||
|
changes: {
|
||||||
|
decimalPlaces: '5',
|
||||||
|
positionDecimalPlaces: '5',
|
||||||
|
linearSlippageFactor: '0.001',
|
||||||
|
quadraticSlippageFactor: '0',
|
||||||
|
lpPriceRange: '10',
|
||||||
|
instrument: {
|
||||||
|
name: 'Token test market',
|
||||||
|
code: 'TEST.24h',
|
||||||
|
future: {
|
||||||
|
settlementAsset:
|
||||||
|
'816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc',
|
||||||
|
quoteName: 'fUSDC',
|
||||||
|
dataSourceSpecForSettlementData: {
|
||||||
|
external: {
|
||||||
|
oracle: {
|
||||||
|
signers: [
|
||||||
|
{
|
||||||
|
pubKey: {
|
||||||
|
key: '70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
key: {
|
||||||
|
name: 'prices.BTC.value',
|
||||||
|
type: 'TYPE_INTEGER',
|
||||||
|
numberDecimalPlaces: '0',
|
||||||
|
},
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
operator: 'OPERATOR_GREATER_THAN',
|
||||||
|
value: '0',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dataSourceSpecForTradingTermination: {
|
||||||
|
external: {
|
||||||
|
oracle: {
|
||||||
|
signers: [
|
||||||
|
{
|
||||||
|
pubKey: {
|
||||||
|
key: '70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
key: {
|
||||||
|
name: 'trading.terminated.ETH5',
|
||||||
|
type: 'TYPE_BOOLEAN',
|
||||||
|
},
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
operator: 'OPERATOR_EQUALS',
|
||||||
|
value: 'true',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dataSourceSpecBinding: {
|
||||||
|
settlementDataProperty: 'prices.BTC.value',
|
||||||
|
tradingTerminationProperty: 'trading.terminated.ETH5',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
metadata: [
|
||||||
|
'sector:food',
|
||||||
|
'sector:materials',
|
||||||
|
'source:docs.vega.xyz',
|
||||||
|
],
|
||||||
|
priceMonitoringParameters: {
|
||||||
|
triggers: [
|
||||||
|
{
|
||||||
|
horizon: '43200',
|
||||||
|
probability: '0.9999999',
|
||||||
|
auctionExtension: '600',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
liquidityMonitoringParameters: {
|
||||||
|
targetStakeParameters: {
|
||||||
|
timeWindow: '3600',
|
||||||
|
scalingFactor: 10,
|
||||||
|
},
|
||||||
|
triggeringRatio: '0.7',
|
||||||
|
auctionExtension: '1',
|
||||||
|
},
|
||||||
|
logNormal: {
|
||||||
|
tau: 0.0001140771161,
|
||||||
|
riskAversionParameter: 0.01,
|
||||||
|
params: {
|
||||||
|
mu: 0,
|
||||||
|
r: 0.016,
|
||||||
|
sigma: 0.5,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
successor: {
|
||||||
|
parentMarketId: parentMarketId,
|
||||||
|
insurancePoolFraction: '0.75',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
closingTimestamp: 1695666618,
|
||||||
|
enactmentTimestamp: 1695666618,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -1,6 +1,4 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=http://localhost:26617
|
|
||||||
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/test/announcements.json
|
NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/test/announcements.json
|
||||||
@@ -8,3 +6,6 @@ NX_VEGA_EXPLORER_URL=/
|
|||||||
|
|
||||||
# App flags
|
# App flags
|
||||||
NX_EXPLORER_TXS_LIST=0
|
NX_EXPLORER_TXS_LIST=0
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=http://localhost:26617
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=https://tm.be.devnet1.vega.xyz/
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.devnet1.vega.xyz/websocket
|
|
||||||
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_VEGA_ENV=DEVNET
|
NX_VEGA_ENV=DEVNET
|
||||||
NX_BLOCK_EXPLORER=https://be.devnet1.vega.xyz/rest
|
NX_BLOCK_EXPLORER=https://be.devnet1.vega.xyz/rest
|
||||||
@@ -10,3 +8,6 @@ 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=/
|
NX_VEGA_EXPLORER_URL=/
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.devnet1.vega.xyz/
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.devnet1.vega.xyz/websocket
|
||||||
|
|||||||
@@ -1,6 +1,4 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=https://be.vega.community
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket
|
|
||||||
NX_SENTRY_DSN=https://b3a56b03eda842faad731f3ea9dfd1bc@o286262.ingest.sentry.io/6242427
|
NX_SENTRY_DSN=https://b3a56b03eda842faad731f3ea9dfd1bc@o286262.ingest.sentry.io/6242427
|
||||||
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_URL=https://api.vega.community/graphql
|
NX_VEGA_URL=https://api.vega.community/graphql
|
||||||
@@ -11,3 +9,6 @@ NX_VEGA_GOVERNANCE_URL=https://governance.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/
|
NX_VEGA_EXPLORER_URL=https://explorer.vega.xyz/
|
||||||
NX_VEGA_CONSOLE_URL=https://console.vega.xyz
|
NX_VEGA_CONSOLE_URL=https://console.vega.xyz
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://be.vega.community
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=https://be.mainnet-mirror.vega.rocks
|
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.mainnet-mirror.vega.rocks/websocket
|
|
||||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
||||||
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
||||||
NX_VEGA_ENV=MAINNET-MIRROR
|
NX_VEGA_ENV=MAINNET_MIRROR
|
||||||
NX_BLOCK_EXPLORER=https://be.mainnet-mirror.vega.rocks/rest
|
NX_BLOCK_EXPLORER=https://be.mainnet-mirror.vega.rocks/rest
|
||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
NX_VEGA_GOVERNANCE_URL=https://governance.mainnet-mirror.vega.rocks
|
NX_VEGA_GOVERNANCE_URL=https://governance.mainnet-mirror.vega.rocks
|
||||||
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.mainnet-mirror.vega.rocks/
|
NX_VEGA_EXPLORER_URL=https://explorer.mainnet-mirror.vega.rocks/
|
||||||
NX_VEGA_CONSOLE_URL=https://console.mainnet-mirror.vega.rocks
|
NX_VEGA_CONSOLE_URL=https://console.mainnet-mirror.vega.rocks
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://be.mainnet-mirror.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.mainnet-mirror.vega.rocks/websocket
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_TENDERMINT_URL=https://tm.be.testnet.vega.xyz
|
|
||||||
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
|
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.testnet.vega.xyz/websocket
|
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/fairground/vegawallet-fairground.toml
|
||||||
NX_VEGA_ENV=TESTNET
|
NX_VEGA_ENV=TESTNET
|
||||||
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
|
NX_VEGA_URL=https://api.n07.testnet.vega.xyz/graphql
|
||||||
@@ -11,3 +9,6 @@ NX_VEGA_GOVERNANCE_URL=https://governance.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
|
NX_VEGA_EXPLORER_URL=https://explorer.fairground.wtf
|
||||||
NX_VEGA_CONSOLE_URL=https://console.fairground.wtf
|
NX_VEGA_CONSOLE_URL=https://console.fairground.wtf
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.testnet.vega.xyz
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.testnet.vega.xyz/websocket
|
||||||
|
|||||||
@@ -7,9 +7,10 @@ NX_ETHEREUM_PROVIDER_URL=https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9
|
|||||||
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
|
||||||
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_TENDERMINT_URL=https://tm.be.validators-testnet.vega.rocks
|
|
||||||
NX_BLOCK_EXPLORER=https://be.validators-testnet.vega.rocks/rest
|
NX_BLOCK_EXPLORER=https://be.validators-testnet.vega.rocks/rest
|
||||||
NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega.xyz/websocket
|
|
||||||
NX_VEGA_GOVERNANCE_URL=https://governance.validators-testnet.vega.rocks
|
NX_VEGA_GOVERNANCE_URL=https://governance.validators-testnet.vega.rocks
|
||||||
NX_VEGA_EXPLORER_URL=https://explorer.validators-testnet.vega.rocks/
|
NX_VEGA_EXPLORER_URL=https://explorer.validators-testnet.vega.rocks/
|
||||||
NX_VEGA_CONSOLE_URL=https://trading.validators-testnet.vega.rocks/
|
NX_VEGA_CONSOLE_URL=https://trading.validators-testnet.vega.rocks/
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.validators-testnet.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega.xyz/websocket
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ export const Footer = () => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="grid grid-rows-2 lg:grid-cols-[1fr_auto] text-xs md:text-md lg:flex md:col-span-2 px-4 py-2 gap-4 border-t border-vega-light-200 dark:border-vega-dark-200">
|
<footer className="grid grid-cols-[1fr_auto] items-center text-xs md:text-md lg:flex md:col-span-2 px-4 pt-2 pb-3 gap-4 border-t border-vega-light-200 dark:border-vega-dark-200">
|
||||||
<div className="flex justify-between gap-2 align-middle">
|
<div className="flex justify-between gap-2 align-middle">
|
||||||
{GIT_COMMIT_HASH && (
|
{GIT_COMMIT_HASH && (
|
||||||
<div className="content-center flex border-r border-neutral-700 dark:border-neutral-300 pr-4">
|
<div className="content-center flex border-r border-neutral-700 dark:border-neutral-300 pr-4">
|
||||||
@@ -43,9 +43,12 @@ export const Footer = () => {
|
|||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<div className="content-center flex pl-2 md:border-r border-neutral-700 dark:border-neutral-300 pr-4">
|
<div className="content-center flex pr-4 md:border-r border-neutral-700 dark:border-neutral-300">
|
||||||
{VEGA_URL && <NodeUrl url={VEGA_URL} />}
|
<span className="pr-2">{VEGA_URL && <NodeUrl url={VEGA_URL} />}</span>
|
||||||
<Link className="ml-2" onClick={() => setNodeSwitcherOpen(true)}>
|
<Link
|
||||||
|
className="ml-2 underline-offset-4"
|
||||||
|
onClick={() => setNodeSwitcherOpen(true)}
|
||||||
|
>
|
||||||
{t('Change')}
|
{t('Change')}
|
||||||
</Link>
|
</Link>
|
||||||
</div>
|
</div>
|
||||||
@@ -59,7 +62,10 @@ export const Footer = () => {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="pl-2 align-center lg:align-right lg:flex lg:justify-end gap-2 align-middle lg:max-w-xs lg:ml-auto">
|
<div className="pl-2 align-center lg:align-right lg:flex lg:justify-end gap-2 align-middle lg:max-w-xs lg:ml-auto">
|
||||||
<RouteLink to={`/${Routes.DISCLAIMER}`} className="underline">
|
<RouteLink
|
||||||
|
to={`/${Routes.DISCLAIMER}`}
|
||||||
|
className="underline underline-offset-4"
|
||||||
|
>
|
||||||
Disclaimer
|
Disclaimer
|
||||||
</RouteLink>
|
</RouteLink>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -95,7 +95,10 @@ export const Header = () => {
|
|||||||
{mainItems.map(routeToNavigationItem)}
|
{mainItems.map(routeToNavigationItem)}
|
||||||
{groupedItems && groupedItems.length > 0 && (
|
{groupedItems && groupedItems.length > 0 && (
|
||||||
<NavigationItem>
|
<NavigationItem>
|
||||||
<NavigationTrigger isActive={Boolean(isOnOther)}>
|
<NavigationTrigger
|
||||||
|
isActive={Boolean(isOnOther)}
|
||||||
|
data-testid="other"
|
||||||
|
>
|
||||||
{t('Other')}
|
{t('Other')}
|
||||||
</NavigationTrigger>
|
</NavigationTrigger>
|
||||||
<NavigationContent>
|
<NavigationContent>
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import type { MarketInfoWithData } from '@vegaprotocol/markets';
|
import type { MarketInfoWithData } from '@vegaprotocol/markets';
|
||||||
import { PriceMonitoringBoundsInfoPanel } from '@vegaprotocol/markets';
|
import {
|
||||||
|
PriceMonitoringBoundsInfoPanel,
|
||||||
|
SuccessionLineInfoPanel,
|
||||||
|
} from '@vegaprotocol/markets';
|
||||||
import {
|
import {
|
||||||
LiquidityInfoPanel,
|
LiquidityInfoPanel,
|
||||||
LiquidityMonitoringParametersInfoPanel,
|
LiquidityMonitoringParametersInfoPanel,
|
||||||
@@ -103,6 +106,8 @@ export const MarketDetails = ({ market }: { market: MarketInfoWithData }) => {
|
|||||||
<OracleInfoPanel market={market} type="settlementData" />
|
<OracleInfoPanel market={market} type="settlementData" />
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
<h2 className={`${headerClassName} mb-4`}>{t('Succession line')}</h2>
|
||||||
|
<SuccessionLineInfoPanel market={market} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ export const ProposalsTable = ({ data }: ProposalsTableProps) => {
|
|||||||
hide: window.innerWidth <= BREAKPOINT_MD,
|
hide: window.innerWidth <= BREAKPOINT_MD,
|
||||||
headerName: t('Enactment date'),
|
headerName: t('Enactment date'),
|
||||||
field: 'terms.enactmentDatetime',
|
field: 'terms.enactmentDatetime',
|
||||||
valueFormatte: ({
|
valueFormatter: ({
|
||||||
value,
|
value,
|
||||||
}: VegaValueFormatterParams<
|
}: VegaValueFormatterParams<
|
||||||
ProposalListFieldsFragment,
|
ProposalListFieldsFragment,
|
||||||
|
|||||||
@@ -0,0 +1,52 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import type { components } from '../../../../../types/explorer';
|
||||||
|
import { Tooltip } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
|
export interface TxDetailsOrderIcebergDetailsProps {
|
||||||
|
iceberg: components['schemas']['v1IcebergOpts'];
|
||||||
|
size: components['schemas']['v1OrderSubmission']['size'];
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
.iceberg .sub {
|
||||||
|
vertical-align: bottom;
|
||||||
|
color: #954F01;
|
||||||
|
}
|
||||||
|
|
||||||
|
.iceberg .sup {
|
||||||
|
vertical-align: top;
|
||||||
|
color: #515E1E;
|
||||||
|
}
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Visualises the iceberg details of an order, showing the minimum visible size,
|
||||||
|
* the full size and the peak size.
|
||||||
|
*/
|
||||||
|
export const TxOrderIcebergDetails = ({
|
||||||
|
iceberg,
|
||||||
|
size,
|
||||||
|
}: TxDetailsOrderIcebergDetailsProps) => {
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
className="inline-block iceberg bg-vega-blue-300 border-vega-blue-350 border-[1px] text-[70%] font-mono py-[2px] pl-2 pr-3 height-[1em] leading-[1em] cursor-pointer"
|
||||||
|
style={{ clipPath: 'polygon(10% 0%, 100% 0%, 90% 100%, 0% 100%)' }}
|
||||||
|
>
|
||||||
|
<Tooltip description={t('Iceberg: Minimum visible size')}>
|
||||||
|
<span className="align-bottom text-vega-orange-650">
|
||||||
|
{iceberg.minimumVisibleSize || '-'}
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip description={t('Iceberg: Total size')}>
|
||||||
|
<span className="text-sm text-vega-blue-600 mx-3">{size}</span>
|
||||||
|
</Tooltip>
|
||||||
|
<Tooltip description={t('Iceberg: Visible peak')}>
|
||||||
|
<span className="align-top text-vega-yellow-600">
|
||||||
|
{iceberg.peakSize || '-'}
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -11,6 +11,7 @@ import { TxDetailsBatch } from './tx-batch';
|
|||||||
import { TxDetailsChainEvent } from './tx-chain-event';
|
import { TxDetailsChainEvent } from './tx-chain-event';
|
||||||
import { TxDetailsNodeVote } from './tx-node-vote';
|
import { TxDetailsNodeVote } from './tx-node-vote';
|
||||||
import { TxDetailsOrderCancel } from './tx-order-cancel';
|
import { TxDetailsOrderCancel } from './tx-order-cancel';
|
||||||
|
import { TxDetailsStopOrderCancel } from './tx-stop-order-cancel';
|
||||||
import { TxDetailsOrderAmend } from './tx-order-amend';
|
import { TxDetailsOrderAmend } from './tx-order-amend';
|
||||||
import { TxDetailsWithdrawSubmission } from './tx-withdraw-submission';
|
import { TxDetailsWithdrawSubmission } from './tx-withdraw-submission';
|
||||||
import { TxDetailsDelegate } from './tx-delegation';
|
import { TxDetailsDelegate } from './tx-delegation';
|
||||||
@@ -85,6 +86,8 @@ function getTransactionComponent(txData?: BlockExplorerTransactionResult) {
|
|||||||
return TxDetailsProtocolUpgrade;
|
return TxDetailsProtocolUpgrade;
|
||||||
case 'Cancel Order':
|
case 'Cancel Order':
|
||||||
return TxDetailsOrderCancel;
|
return TxDetailsOrderCancel;
|
||||||
|
case 'Stop Orders Cancellation':
|
||||||
|
return TxDetailsStopOrderCancel;
|
||||||
case 'Amend Order':
|
case 'Amend Order':
|
||||||
return TxDetailsOrderAmend;
|
return TxDetailsOrderAmend;
|
||||||
case 'Validator Heartbeat':
|
case 'Validator Heartbeat':
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { txSignatureToDeterministicId } from '../lib/deterministic-ids';
|
|||||||
import DeterministicOrderDetails from '../../order-details/deterministic-order-details';
|
import DeterministicOrderDetails from '../../order-details/deterministic-order-details';
|
||||||
import Hash from '../../links/hash';
|
import Hash from '../../links/hash';
|
||||||
import { TxOrderPeggedReferenceRow } from './order/tx-order-peg';
|
import { TxOrderPeggedReferenceRow } from './order/tx-order-peg';
|
||||||
|
import { TxOrderIcebergDetails } from './order/tx-order-iceberg';
|
||||||
|
|
||||||
interface TxDetailsOrderProps {
|
interface TxDetailsOrderProps {
|
||||||
txData: BlockExplorerTransactionResult | undefined;
|
txData: BlockExplorerTransactionResult | undefined;
|
||||||
@@ -32,6 +33,8 @@ export const TxDetailsOrder = ({
|
|||||||
const marketId = txData.command.orderSubmission.marketId || '-';
|
const marketId = txData.command.orderSubmission.marketId || '-';
|
||||||
const reference = txData.command.orderSubmission.peggedOrder;
|
const reference = txData.command.orderSubmission.peggedOrder;
|
||||||
const side = txData.command.orderSubmission.side;
|
const side = txData.command.orderSubmission.side;
|
||||||
|
const iceberg = txData.command.orderSubmission.icebergOpts;
|
||||||
|
const size = txData.command.orderSubmission.size;
|
||||||
|
|
||||||
let deterministicId = '';
|
let deterministicId = '';
|
||||||
|
|
||||||
@@ -74,6 +77,14 @@ export const TxDetailsOrder = ({
|
|||||||
marketId={marketId}
|
marketId={marketId}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
|
{iceberg ? (
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Iceberg details')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<TxOrderIcebergDetails iceberg={iceberg} size={size} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
</TableWithTbody>
|
</TableWithTbody>
|
||||||
|
|
||||||
{deterministicId.length > 0 ? (
|
{deterministicId.length > 0 ? (
|
||||||
|
|||||||
@@ -10,6 +10,8 @@ import Hash from '../../links/hash';
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { ProposalSignatureBundleNewAsset } from './proposal/signature-bundle-new';
|
import { ProposalSignatureBundleNewAsset } from './proposal/signature-bundle-new';
|
||||||
import { ProposalSignatureBundleUpdateAsset } from './proposal/signature-bundle-update';
|
import { ProposalSignatureBundleUpdateAsset } from './proposal/signature-bundle-update';
|
||||||
|
import { MarketLink } from '../../links';
|
||||||
|
import { formatNumber } from '@vegaprotocol/utils';
|
||||||
|
|
||||||
export type Proposal = components['schemas']['v1ProposalSubmission'];
|
export type Proposal = components['schemas']['v1ProposalSubmission'];
|
||||||
export type ProposalTerms = components['schemas']['vegaProposalTerms'];
|
export type ProposalTerms = components['schemas']['vegaProposalTerms'];
|
||||||
@@ -53,7 +55,11 @@ export function proposalTypeLabel(terms?: ProposalTerms): string {
|
|||||||
} else if (has(terms, 'updateAsset')) {
|
} else if (has(terms, 'updateAsset')) {
|
||||||
return t('Update asset proposal');
|
return t('Update asset proposal');
|
||||||
} else if (has(terms, 'newMarket')) {
|
} else if (has(terms, 'newMarket')) {
|
||||||
return t('New market proposal');
|
if (terms?.newMarket?.changes?.successor) {
|
||||||
|
return t('Successor market proposal');
|
||||||
|
} else {
|
||||||
|
return t('New market proposal');
|
||||||
|
}
|
||||||
} else if (has(terms, 'updateMarket')) {
|
} else if (has(terms, 'updateMarket')) {
|
||||||
return t('Update market proposal');
|
return t('Update market proposal');
|
||||||
} else if (has(terms, 'updateNetworkParameter')) {
|
} else if (has(terms, 'updateNetworkParameter')) {
|
||||||
@@ -85,6 +91,13 @@ export const TxProposal = ({ txData, pubKey, blockData }: TxProposalProps) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const tx = proposal.terms?.newAsset || proposal.terms?.updateAsset;
|
const tx = proposal.terms?.newAsset || proposal.terms?.updateAsset;
|
||||||
|
const isSuccessorMarketProposal =
|
||||||
|
proposal?.terms?.newMarket?.changes?.successor;
|
||||||
|
const parentMarketId =
|
||||||
|
isSuccessorMarketProposal &&
|
||||||
|
proposal?.terms.newMarket?.changes?.successor?.parentMarketId;
|
||||||
|
const insurancePoolFraction =
|
||||||
|
proposal?.terms?.newMarket?.changes?.successor?.insurancePoolFraction;
|
||||||
|
|
||||||
// This component is not rendered if no bundle is required
|
// This component is not rendered if no bundle is required
|
||||||
const SignatureBundleComponent = proposal.terms?.newAsset
|
const SignatureBundleComponent = proposal.terms?.newAsset
|
||||||
@@ -111,6 +124,30 @@ export const TxProposal = ({ txData, pubKey, blockData }: TxProposalProps) => {
|
|||||||
<Hash text={deterministicId} />
|
<Hash text={deterministicId} />
|
||||||
</TableCell>
|
</TableCell>
|
||||||
</TableRow>
|
</TableRow>
|
||||||
|
{isSuccessorMarketProposal ? (
|
||||||
|
<>
|
||||||
|
{parentMarketId ? (
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Previous market')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<MarketLink
|
||||||
|
id={
|
||||||
|
proposal.terms?.newMarket.changes.successor.parentMarketId
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
|
{insurancePoolFraction ? (
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Insurance pool fraction')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
{formatNumber(Number(insurancePoolFraction) * 100, 0)}%
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
</TableWithTbody>
|
</TableWithTbody>
|
||||||
<ProposalSummary
|
<ProposalSummary
|
||||||
id={deterministicId}
|
id={deterministicId}
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
import { t } from '@vegaprotocol/i18n';
|
||||||
|
import type { BlockExplorerTransactionResult } from '../../../routes/types/block-explorer-response';
|
||||||
|
import { MarketLink } from '../../links/';
|
||||||
|
import type { TendermintBlocksResponse } from '../../../routes/blocks/tendermint-blocks-response';
|
||||||
|
import { TxDetailsShared } from './shared/tx-details-shared';
|
||||||
|
import { TableCell, TableRow, TableWithTbody } from '../../table';
|
||||||
|
import { CancelSummary } from '../../order-summary/order-cancellation';
|
||||||
|
import Hash from '../../links/hash';
|
||||||
|
import type { components } from '../../../../types/explorer';
|
||||||
|
|
||||||
|
export type StopOrderCancellationTransaction =
|
||||||
|
components['schemas']['v1StopOrdersCancellation'];
|
||||||
|
|
||||||
|
interface TxDetailsStopOrderCancelProps {
|
||||||
|
txData: BlockExplorerTransactionResult | undefined;
|
||||||
|
pubKey: string | undefined;
|
||||||
|
blockData: TendermintBlocksResponse | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Someone cancelled a stop order
|
||||||
|
*/
|
||||||
|
export const TxDetailsStopOrderCancel = ({
|
||||||
|
txData,
|
||||||
|
pubKey,
|
||||||
|
blockData,
|
||||||
|
}: TxDetailsStopOrderCancelProps) => {
|
||||||
|
if (!txData || !txData.command) {
|
||||||
|
return <>{t('Awaiting Block Explorer transaction details')}</>;
|
||||||
|
}
|
||||||
|
|
||||||
|
const command: StopOrderCancellationTransaction =
|
||||||
|
txData.command.stopOrdersCancellation;
|
||||||
|
|
||||||
|
const { marketId, stopOrderId } = command;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<TableWithTbody className="mb-8" allowWrap={true}>
|
||||||
|
<TxDetailsShared txData={txData} pubKey={pubKey} blockData={blockData} />
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Cancel stop order')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
{stopOrderId ? (
|
||||||
|
<Hash text={stopOrderId} />
|
||||||
|
) : (
|
||||||
|
<CancelSummary orderId={stopOrderId} marketId={marketId} />
|
||||||
|
)}
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
{marketId ? (
|
||||||
|
<TableRow modifier="bordered">
|
||||||
|
<TableCell>{t('Market')}</TableCell>
|
||||||
|
<TableCell>
|
||||||
|
<MarketLink id={marketId} />
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
) : null}
|
||||||
|
</TableWithTbody>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -10,7 +10,6 @@ import {
|
|||||||
DropdownMenuTrigger,
|
DropdownMenuTrigger,
|
||||||
DropdownMenuSubContent,
|
DropdownMenuSubContent,
|
||||||
Icon,
|
Icon,
|
||||||
Button,
|
|
||||||
} from '@vegaprotocol/ui-toolkit';
|
} from '@vegaprotocol/ui-toolkit';
|
||||||
import type { Dispatch, SetStateAction } from 'react';
|
import type { Dispatch, SetStateAction } from 'react';
|
||||||
import { FilterLabel } from './tx-filter-label';
|
import { FilterLabel } from './tx-filter-label';
|
||||||
@@ -35,6 +34,7 @@ export type FilterOption =
|
|||||||
| 'Protocol Upgrade'
|
| 'Protocol Upgrade'
|
||||||
| 'Register new Node'
|
| 'Register new Node'
|
||||||
| 'State Variable Proposal'
|
| 'State Variable Proposal'
|
||||||
|
| 'Stop Orders Cancellation'
|
||||||
| 'Submit Oracle Data'
|
| 'Submit Oracle Data'
|
||||||
| 'Submit Order'
|
| 'Submit Order'
|
||||||
| 'Transfer Funds'
|
| 'Transfer Funds'
|
||||||
@@ -54,6 +54,7 @@ export const PrimaryFilterOptions: FilterOption[] = [
|
|||||||
'Delegate',
|
'Delegate',
|
||||||
'Liquidity Provision Order',
|
'Liquidity Provision Order',
|
||||||
'Proposal',
|
'Proposal',
|
||||||
|
'Stop Orders Cancellation',
|
||||||
'Submit Oracle Data',
|
'Submit Oracle Data',
|
||||||
'Submit Order',
|
'Submit Order',
|
||||||
'Transfer Funds',
|
'Transfer Funds',
|
||||||
@@ -100,15 +101,13 @@ export const TxsFilter = ({ filters, setFilters }: TxFilterProps) => {
|
|||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
modal={false}
|
modal={false}
|
||||||
trigger={
|
trigger={
|
||||||
<DropdownMenuTrigger className="ml-0">
|
<DropdownMenuTrigger>
|
||||||
<Button size="xs" data-testid="filter-trigger">
|
<FilterLabel filters={filters} />
|
||||||
<FilterLabel filters={filters} />
|
|
||||||
</Button>
|
|
||||||
</DropdownMenuTrigger>
|
</DropdownMenuTrigger>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<DropdownMenuContent>
|
<DropdownMenuContent>
|
||||||
{filters.size > 0 ? null : (
|
{filters.size > 1 ? null : (
|
||||||
<>
|
<>
|
||||||
<DropdownMenuCheckboxItem
|
<DropdownMenuCheckboxItem
|
||||||
onCheckedChange={() => setFilters(new Set(AllFilterOptions))}
|
onCheckedChange={() => setFilters(new Set(AllFilterOptions))}
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const TxsListNavigation = ({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
size="xs"
|
size="xs"
|
||||||
disabled={!hasMoreTxs || loading}
|
disabled={!hasMoreTxs}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
nextPage();
|
nextPage();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -78,7 +78,11 @@ export function getLabelForProposal(
|
|||||||
} else if (proposal.terms?.updateAsset) {
|
} else if (proposal.terms?.updateAsset) {
|
||||||
return t('Proposal: Update asset');
|
return t('Proposal: Update asset');
|
||||||
} else if (proposal.terms?.newMarket) {
|
} else if (proposal.terms?.newMarket) {
|
||||||
return t('Proposal: New market');
|
if (proposal.terms?.newMarket.changes?.successor) {
|
||||||
|
return t('Proposal: Successor market');
|
||||||
|
} else {
|
||||||
|
return t('Proposal: New market');
|
||||||
|
}
|
||||||
} else if (proposal.terms?.updateMarket) {
|
} else if (proposal.terms?.updateMarket) {
|
||||||
return t('Proposal: Update market');
|
return t('Proposal: Update market');
|
||||||
} else if (proposal.terms?.updateNetworkParameter) {
|
} else if (proposal.terms?.updateNetworkParameter) {
|
||||||
@@ -166,6 +170,7 @@ export const TxOrderType = ({ orderType, command }: TxOrderTypeProps) => {
|
|||||||
'text-white dark:text-white bg-vega-dark-150 dark:bg-vega-dark-250';
|
'text-white dark:text-white bg-vega-dark-150 dark:bg-vega-dark-250';
|
||||||
|
|
||||||
// This will get unwieldy and should probably produce a different colour of tag
|
// This will get unwieldy and should probably produce a different colour of tag
|
||||||
|
// Note that colours are currently arbitrary
|
||||||
if (type === 'Chain Event' && !!command?.chainEvent) {
|
if (type === 'Chain Event' && !!command?.chainEvent) {
|
||||||
type = getLabelForChainEvent(command.chainEvent);
|
type = getLabelForChainEvent(command.chainEvent);
|
||||||
colours = 'text-white dark-text-white bg-vega-pink dark:bg-vega-pink';
|
colours = 'text-white dark-text-white bg-vega-pink dark:bg-vega-pink';
|
||||||
@@ -177,6 +182,9 @@ export const TxOrderType = ({ orderType, command }: TxOrderTypeProps) => {
|
|||||||
type = getLabelForProposal(command.proposalSubmission);
|
type = getLabelForProposal(command.proposalSubmission);
|
||||||
}
|
}
|
||||||
colours = 'text-black bg-vega-yellow';
|
colours = 'text-black bg-vega-yellow';
|
||||||
|
} else if (type === 'Order' && command) {
|
||||||
|
type = getLabelForOrderType(orderType, command);
|
||||||
|
colours = 'text-white dark-text-white bg-vega-blue dark:bg-vega-blue';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (type === 'Vote on Proposal') {
|
if (type === 'Vote on Proposal') {
|
||||||
|
|||||||
@@ -86,14 +86,18 @@ describe('Txs infinite list item', () => {
|
|||||||
render(
|
render(
|
||||||
<MockedProvider>
|
<MockedProvider>
|
||||||
<MemoryRouter>
|
<MemoryRouter>
|
||||||
<TxsInfiniteListItem
|
<table>
|
||||||
type="testType"
|
<tbody>
|
||||||
submitter="testPubKey"
|
<TxsInfiniteListItem
|
||||||
hash="testTxHash"
|
type="testType"
|
||||||
block="1"
|
submitter="testPubKey"
|
||||||
code={0}
|
hash="testTxHash"
|
||||||
command={{}}
|
block="1"
|
||||||
/>
|
code={0}
|
||||||
|
command={{}}
|
||||||
|
/>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
</MemoryRouter>
|
</MemoryRouter>
|
||||||
</MockedProvider>
|
</MockedProvider>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -14,9 +14,9 @@ const DEFAULT_TRUNCATE_LENGTH = 7;
|
|||||||
|
|
||||||
export function getIdTruncateLength(screen: Screen): number {
|
export function getIdTruncateLength(screen: Screen): number {
|
||||||
if (['xxxl', 'xxl'].includes(screen)) {
|
if (['xxxl', 'xxl'].includes(screen)) {
|
||||||
return 64;
|
|
||||||
} else if (['xl', 'lg', 'md'].includes(screen)) {
|
|
||||||
return 32;
|
return 32;
|
||||||
|
} else if (['xl', 'lg', 'md'].includes(screen)) {
|
||||||
|
return 16;
|
||||||
}
|
}
|
||||||
return DEFAULT_TRUNCATE_LENGTH;
|
return DEFAULT_TRUNCATE_LENGTH;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,11 +5,17 @@ import type { BlockExplorerTransactionResult } from '../../routes/types/block-ex
|
|||||||
import { Side } from '@vegaprotocol/types';
|
import { Side } from '@vegaprotocol/types';
|
||||||
import { MockedProvider } from '@apollo/client/testing';
|
import { MockedProvider } from '@apollo/client/testing';
|
||||||
|
|
||||||
|
const generateHash = (): string =>
|
||||||
|
Array.from(
|
||||||
|
{ length: 64 },
|
||||||
|
() => '0123456789ABCDEF'[Math.floor(Math.random() * 16)]
|
||||||
|
).join('');
|
||||||
|
|
||||||
const generateTxs = (number: number): BlockExplorerTransactionResult[] => {
|
const generateTxs = (number: number): BlockExplorerTransactionResult[] => {
|
||||||
return Array.from(Array(number)).map((_) => ({
|
return Array.from(Array(number)).map((_) => ({
|
||||||
block: '87901',
|
block: '87901',
|
||||||
index: 2,
|
index: 2,
|
||||||
hash: '0F8B98DA0923A50786B852D9CA11E051CACC4C733E1DB93D535C7D81DBD10F6F',
|
hash: generateHash(),
|
||||||
submitter:
|
submitter:
|
||||||
'4b782482f587d291e8614219eb9a5ee9280fa2c58982dee71d976782a9be1964',
|
'4b782482f587d291e8614219eb9a5ee9280fa2c58982dee71d976782a9be1964',
|
||||||
type: 'Submit Order',
|
type: 'Submit Order',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Table, TableRow } from '../table';
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
import { useFetch } from '@vegaprotocol/react-helpers';
|
||||||
import type { BlockExplorerTransactions } from '../../routes/types/block-explorer-response';
|
import type { BlockExplorerTransactions } from '../../routes/types/block-explorer-response';
|
||||||
import { getTxsDataUrl } from '../../hooks/use-txs-data';
|
import { getTxsDataUrl } from '../../hooks/get-txs-data-url';
|
||||||
import { AsyncRenderer, 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';
|
||||||
import { TxsInfiniteListItem } from './txs-infinite-list-item';
|
import { TxsInfiniteListItem } from './txs-infinite-list-item';
|
||||||
@@ -14,7 +14,7 @@ interface TxsPerBlockProps {
|
|||||||
|
|
||||||
export const TxsPerBlock = ({ blockHeight, txCount }: TxsPerBlockProps) => {
|
export const TxsPerBlock = ({ blockHeight, txCount }: TxsPerBlockProps) => {
|
||||||
const filters = `filters[block.height]=${blockHeight}`;
|
const filters = `filters[block.height]=${blockHeight}`;
|
||||||
const url = getTxsDataUrl({ limit: txCount.toString(), filters });
|
const url = getTxsDataUrl({ filters, count: txCount });
|
||||||
const {
|
const {
|
||||||
state: { data, loading, error },
|
state: { data, loading, error },
|
||||||
} = useFetch<BlockExplorerTransactions>(url);
|
} = useFetch<BlockExplorerTransactions>(url);
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ const windowOrDefault = (key: string) => {
|
|||||||
return (process.env[key] as string) || '';
|
return (process.env[key] as string) || '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const truthy = ['1', 'true'];
|
|
||||||
|
|
||||||
export const ENV = {
|
export const ENV = {
|
||||||
// Data sources
|
// Data sources
|
||||||
// Environment
|
// Environment
|
||||||
@@ -20,19 +18,6 @@ export const ENV = {
|
|||||||
governanceUrl: windowOrDefault('NX_VEGA_GOVERNANCE_URL'),
|
governanceUrl: windowOrDefault('NX_VEGA_GOVERNANCE_URL'),
|
||||||
vegaRepoUrl: windowOrDefault('NX_VEGA_REPO_URL'),
|
vegaRepoUrl: windowOrDefault('NX_VEGA_REPO_URL'),
|
||||||
},
|
},
|
||||||
flags: {
|
|
||||||
assets: truthy.includes(windowOrDefault('NX_EXPLORER_ASSETS')),
|
|
||||||
genesis: truthy.includes(windowOrDefault('NX_EXPLORER_GENESIS')),
|
|
||||||
governance: truthy.includes(windowOrDefault('NX_EXPLORER_GOVERNANCE')),
|
|
||||||
markets: truthy.includes(windowOrDefault('NX_EXPLORER_MARKETS')),
|
|
||||||
oracles: truthy.includes(windowOrDefault('NX_EXPLORER_ORACLES')),
|
|
||||||
txsList: truthy.includes(windowOrDefault('NX_EXPLORER_TXS_LIST')),
|
|
||||||
networkParameters: truthy.includes(
|
|
||||||
windowOrDefault('NX_EXPLORER_NETWORK_PARAMETERS')
|
|
||||||
),
|
|
||||||
parties: truthy.includes(windowOrDefault('NX_EXPLORER_PARTIES')),
|
|
||||||
validators: truthy.includes(windowOrDefault('NX_EXPLORER_VALIDATORS')),
|
|
||||||
},
|
|
||||||
addresses: {
|
addresses: {
|
||||||
feedback: windowOrDefault('NX_GITHUB_FEEDBACK_URL'),
|
feedback: windowOrDefault('NX_GITHUB_FEEDBACK_URL'),
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import { ENV } from './env';
|
|
||||||
|
|
||||||
export default {
|
|
||||||
...ENV.flags,
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,59 @@
|
|||||||
|
import { DATA_SOURCES } from '../config';
|
||||||
|
|
||||||
|
type IGetTxsDataFirstPage = {
|
||||||
|
baseUrl?: string;
|
||||||
|
count?: number;
|
||||||
|
party?: string;
|
||||||
|
filters?: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
interface IGetTxsDataPrevious extends IGetTxsDataFirstPage {
|
||||||
|
before: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IGetTxsDataNext extends IGetTxsDataFirstPage {
|
||||||
|
after: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
type IGetTxsDataUrl =
|
||||||
|
| IGetTxsDataPrevious
|
||||||
|
| IGetTxsDataNext
|
||||||
|
| IGetTxsDataFirstPage;
|
||||||
|
|
||||||
|
export const BE_TXS_PER_REQUEST = 25;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Properly encodes the filters and parameters for a request to the block explorer
|
||||||
|
* API for transactions. As the API uses a slightly less common format for encoding
|
||||||
|
* filters, some of it is more manual than you might expect.
|
||||||
|
*
|
||||||
|
* @param params An object containing the pagination and filters
|
||||||
|
* @returns string URL to call
|
||||||
|
*/
|
||||||
|
export const getTxsDataUrl = (params: IGetTxsDataUrl) => {
|
||||||
|
const baseUrl =
|
||||||
|
params.baseUrl || `${DATA_SOURCES.blockExplorerUrl}/transactions`;
|
||||||
|
const url = new URL(baseUrl);
|
||||||
|
const count = `${params.count || BE_TXS_PER_REQUEST}`;
|
||||||
|
|
||||||
|
if ('before' in params && params.before?.length > 0) {
|
||||||
|
url.searchParams.append('last', count);
|
||||||
|
url.searchParams.append('before', params.before);
|
||||||
|
} else if ('after' in params && params.after?.length > 0) {
|
||||||
|
url.searchParams.append('first', count);
|
||||||
|
url.searchParams.append('after', params.after);
|
||||||
|
} else {
|
||||||
|
url.searchParams.append('first', count);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hacky fix for param as array
|
||||||
|
let urlAsString = url.toString();
|
||||||
|
if (params.filters && params.filters?.length > 0) {
|
||||||
|
urlAsString += '&' + params.filters.replaceAll(' ', '%20');
|
||||||
|
}
|
||||||
|
if (params.party && params.party?.length > 0) {
|
||||||
|
urlAsString += `&filters[tx.submitter]=${params.party}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return urlAsString;
|
||||||
|
};
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
import { getTxsDataUrl } from './get-txs-data-url'; // import the function to be tested
|
||||||
|
|
||||||
|
describe('getTxsDataUrl', () => {
|
||||||
|
it('should return the correct URL without filters and party', () => {
|
||||||
|
const params = {
|
||||||
|
count: 10,
|
||||||
|
baseUrl: 'https://example.com/transactions',
|
||||||
|
};
|
||||||
|
const expectedUrl = 'https://example.com/transactions?first=10';
|
||||||
|
|
||||||
|
expect(getTxsDataUrl(params)).toEqual(expectedUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct URL with "before" in params', () => {
|
||||||
|
const params = {
|
||||||
|
count: 5,
|
||||||
|
before: '100.1',
|
||||||
|
baseUrl: 'https://example.com/transactions',
|
||||||
|
};
|
||||||
|
const expectedUrl = 'https://example.com/transactions?last=5&before=100.1';
|
||||||
|
|
||||||
|
expect(getTxsDataUrl(params)).toEqual(expectedUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct URL with "after" in params', () => {
|
||||||
|
const params = {
|
||||||
|
count: 5,
|
||||||
|
after: '222.1',
|
||||||
|
baseUrl: 'https://example.com/transactions',
|
||||||
|
};
|
||||||
|
const expectedUrl = 'https://example.com/transactions?first=5&after=222.1';
|
||||||
|
|
||||||
|
expect(getTxsDataUrl(params)).toEqual(expectedUrl);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should return the correct URL with filters and party', () => {
|
||||||
|
const params = {
|
||||||
|
count: 10,
|
||||||
|
filters: 'filters[cmd.type]=Made Up Transaction',
|
||||||
|
party: '1234',
|
||||||
|
baseUrl: 'https://example.com/transactions',
|
||||||
|
};
|
||||||
|
const expectedUrl =
|
||||||
|
'https://example.com/transactions?first=10&filters[cmd.type]=Made%20Up%20Transaction&filters[tx.submitter]=1234';
|
||||||
|
|
||||||
|
expect(getTxsDataUrl(params)).toEqual(expectedUrl);
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -1,130 +1,141 @@
|
|||||||
import { useCallback, useEffect, useState } from 'react';
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
import type { URLSearchParamsInit } from 'react-router-dom';
|
||||||
|
import { useCallback } from 'react';
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
import { useFetch } from '@vegaprotocol/react-helpers';
|
||||||
import type {
|
import type {
|
||||||
BlockExplorerTransactionResult,
|
BlockExplorerTransactionResult,
|
||||||
BlockExplorerTransactions,
|
BlockExplorerTransactions,
|
||||||
} from '../routes/types/block-explorer-response';
|
} from '../routes/types/block-explorer-response';
|
||||||
import { DATA_SOURCES } from '../config';
|
|
||||||
import isNumber from 'lodash/isNumber';
|
import isNumber from 'lodash/isNumber';
|
||||||
|
import { AllFilterOptions } from '../components/txs/tx-filter';
|
||||||
|
import type { FilterOption } from '../components/txs/tx-filter';
|
||||||
|
import { BE_TXS_PER_REQUEST, getTxsDataUrl } from './get-txs-data-url';
|
||||||
|
|
||||||
export interface TxsStateProps {
|
export function getTypeFilters(filters?: Set<FilterOption>) {
|
||||||
txsData: BlockExplorerTransactionResult[];
|
if (!filters) {
|
||||||
hasMoreTxs: boolean;
|
return '';
|
||||||
cursor: string;
|
} else if (filters.size > 1) {
|
||||||
previousCursors: string[];
|
return '';
|
||||||
hasPreviousPage: boolean;
|
}
|
||||||
|
|
||||||
|
const forcedSingleFilter = Array.from(filters)[0];
|
||||||
|
return `filters[cmd.type]=${forcedSingleFilter}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface IUseTxsData {
|
export interface IUseTxsData {
|
||||||
limit: number;
|
count?: number;
|
||||||
filters?: string;
|
before?: string;
|
||||||
|
after?: string;
|
||||||
|
party?: string;
|
||||||
|
filters?: Set<FilterOption>;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IGetTxsDataUrl {
|
export const useTxsData = ({
|
||||||
limit: string;
|
count = 25,
|
||||||
filters?: string;
|
before,
|
||||||
}
|
after,
|
||||||
|
filters,
|
||||||
|
party,
|
||||||
|
}: IUseTxsData) => {
|
||||||
|
const [, setSearchParams] = useSearchParams();
|
||||||
|
let hasMoreTxs = true;
|
||||||
|
let txsData: BlockExplorerTransactionResult[] = [];
|
||||||
|
|
||||||
export const getTxsDataUrl = ({ limit, filters }: IGetTxsDataUrl) => {
|
const url = getTxsDataUrl({
|
||||||
const url = new URL(`${DATA_SOURCES.blockExplorerUrl}/transactions`);
|
filters: getTypeFilters(filters),
|
||||||
|
count,
|
||||||
if (limit) {
|
before,
|
||||||
url.searchParams.append('limit', limit);
|
after,
|
||||||
}
|
party,
|
||||||
|
|
||||||
// Hacky fix for param as array
|
|
||||||
let urlAsString = url.toString();
|
|
||||||
if (filters) {
|
|
||||||
urlAsString += '&' + filters.replace(' ', '%20');
|
|
||||||
}
|
|
||||||
|
|
||||||
return urlAsString;
|
|
||||||
};
|
|
||||||
|
|
||||||
export const useTxsData = ({ limit, filters }: IUseTxsData) => {
|
|
||||||
const [
|
|
||||||
{ txsData, hasMoreTxs, cursor, previousCursors, hasPreviousPage },
|
|
||||||
setTxsState,
|
|
||||||
] = useState<TxsStateProps>({
|
|
||||||
txsData: [],
|
|
||||||
hasMoreTxs: false,
|
|
||||||
previousCursors: [],
|
|
||||||
cursor: '',
|
|
||||||
hasPreviousPage: false,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const url = getTxsDataUrl({ limit: limit.toString(), filters });
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
state: { data, error, loading },
|
state: { data, error, loading },
|
||||||
refetch,
|
refetch,
|
||||||
} = useFetch<BlockExplorerTransactions>(url, {}, true);
|
} = useFetch<BlockExplorerTransactions>(url, {}, true);
|
||||||
|
|
||||||
useEffect(() => {
|
if (!loading && data && isNumber(data.transactions.length)) {
|
||||||
if (!loading && data && isNumber(data.transactions.length)) {
|
hasMoreTxs = data.transactions.length >= count;
|
||||||
setTxsState((prev) => {
|
txsData = data.transactions;
|
||||||
return {
|
}
|
||||||
...prev,
|
|
||||||
txsData: data.transactions,
|
|
||||||
hasMoreTxs: data.transactions.length >= limit,
|
|
||||||
cursor: data?.transactions.at(-1)?.cursor || '',
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [loading, setTxsState, data, limit]);
|
|
||||||
|
|
||||||
const nextPage = useCallback(() => {
|
const nextPage = useCallback(() => {
|
||||||
const c = data?.transactions.at(0)?.cursor;
|
const after = data?.transactions.at(-1)?.cursor || '';
|
||||||
const newPreviousCursors = c ? [...previousCursors, c] : previousCursors;
|
const params: URLSearchParamsInit = { after };
|
||||||
|
if (filters) {
|
||||||
setTxsState((prev) => ({
|
params.filters = Array.from(filters).join(',');
|
||||||
...prev,
|
}
|
||||||
hasPreviousPage: true,
|
setSearchParams(params);
|
||||||
previousCursors: newPreviousCursors,
|
}, [filters, data, setSearchParams]);
|
||||||
}));
|
|
||||||
|
|
||||||
return refetch({
|
|
||||||
limit,
|
|
||||||
before: cursor,
|
|
||||||
});
|
|
||||||
}, [data, previousCursors, cursor, limit, refetch]);
|
|
||||||
|
|
||||||
const previousPage = useCallback(() => {
|
const previousPage = useCallback(() => {
|
||||||
const previousCursor = [...previousCursors].pop();
|
const before = data?.transactions[0]?.cursor || '';
|
||||||
const newPreviousCursors = previousCursors.slice(0, -1);
|
const params: URLSearchParamsInit = { before };
|
||||||
setTxsState((prev) => ({
|
if (filters && filters.size > 0 && filters.size === 1) {
|
||||||
...prev,
|
params.filters = Array.from(filters)[0];
|
||||||
hasPreviousPage: newPreviousCursors.length > 0,
|
}
|
||||||
previousCursors: newPreviousCursors,
|
setSearchParams(params);
|
||||||
}));
|
}, [filters, data, setSearchParams]);
|
||||||
return refetch({
|
|
||||||
limit,
|
|
||||||
before: previousCursor,
|
|
||||||
});
|
|
||||||
}, [previousCursors, limit, refetch]);
|
|
||||||
|
|
||||||
const refreshTxs = useCallback(async () => {
|
const refreshTxs = useCallback(async () => {
|
||||||
setTxsState(() => ({
|
const params: URLSearchParamsInit = {};
|
||||||
txsData: [],
|
if (filters && filters.size > 0 && filters.size === 1) {
|
||||||
cursor: '',
|
params.filters = Array.from(filters)[0];
|
||||||
previousCursors: [],
|
}
|
||||||
hasMoreTxs: false,
|
setSearchParams(params);
|
||||||
hasPreviousPage: false,
|
|
||||||
}));
|
|
||||||
|
|
||||||
refetch({ limit });
|
refetch({ count: BE_TXS_PER_REQUEST });
|
||||||
}, [setTxsState, limit, refetch, filters]); // eslint-disable-line react-hooks/exhaustive-deps
|
}, [setSearchParams, refetch, filters]);
|
||||||
|
|
||||||
|
const updateFilters = useCallback(
|
||||||
|
(newFilters: Set<FilterOption>) => {
|
||||||
|
const params: URLSearchParamsInit = {};
|
||||||
|
if (newFilters && newFilters.size === 1) {
|
||||||
|
params.filters = Array.from(newFilters)[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
setSearchParams(params);
|
||||||
|
},
|
||||||
|
[setSearchParams]
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
updateFilters,
|
||||||
txsData,
|
txsData,
|
||||||
loading,
|
loading,
|
||||||
error,
|
error,
|
||||||
hasMoreTxs,
|
hasMoreTxs,
|
||||||
hasPreviousPage,
|
|
||||||
previousCursors,
|
|
||||||
cursor,
|
|
||||||
refreshTxs,
|
refreshTxs,
|
||||||
nextPage,
|
nextPage,
|
||||||
previousPage,
|
previousPage,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a Set of filters based on the URLSearchParams, or
|
||||||
|
* defaults to all.
|
||||||
|
* @param params
|
||||||
|
* @returns Set
|
||||||
|
*/
|
||||||
|
export function getInitialFilters(params: URLSearchParams): Set<FilterOption> {
|
||||||
|
const defaultFilters = new Set(AllFilterOptions);
|
||||||
|
|
||||||
|
const p = params.get('filters');
|
||||||
|
|
||||||
|
if (!p) {
|
||||||
|
return defaultFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
const filters = new Set<FilterOption>();
|
||||||
|
p.split(',').forEach((f) => {
|
||||||
|
if (AllFilterOptions.includes(f as FilterOption)) {
|
||||||
|
filters.add(f as FilterOption);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (filters.size === 0) {
|
||||||
|
return defaultFilters;
|
||||||
|
}
|
||||||
|
|
||||||
|
return filters;
|
||||||
|
}
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ describe('Block', () => {
|
|||||||
(useFetch as jest.Mock).mockReturnValue({
|
(useFetch as jest.Mock).mockReturnValue({
|
||||||
state: { data: createBlockResponse(1), loading: false, error: null },
|
state: { data: createBlockResponse(1), loading: false, error: null },
|
||||||
});
|
});
|
||||||
|
|
||||||
render(renderComponent(1));
|
render(renderComponent(1));
|
||||||
await waitFor(() => screen.getByTestId('block-header'));
|
await waitFor(() => screen.getByTestId('block-header'));
|
||||||
expect(screen.getByTestId('previous-block-button')).toHaveAttribute(
|
expect(screen.getByTestId('previous-block-button')).toHaveAttribute(
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
import { Link, useParams } from 'react-router-dom';
|
import { Link, useParams } from 'react-router-dom';
|
||||||
import { DATA_SOURCES } from '../../../config';
|
|
||||||
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
import { getDateTimeFormat } from '@vegaprotocol/utils';
|
||||||
import type { TendermintBlocksResponse } from '../tendermint-blocks-response';
|
|
||||||
import { RouteTitle } from '../../../components/route-title';
|
import { RouteTitle } from '../../../components/route-title';
|
||||||
import { TimeAgo } from '../../../components/time-ago';
|
import { TimeAgo } from '../../../components/time-ago';
|
||||||
import {
|
import {
|
||||||
@@ -14,7 +12,7 @@ import { TxsPerBlock } from '../../../components/txs/txs-per-block';
|
|||||||
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
import { AsyncRenderer, Button } from '@vegaprotocol/ui-toolkit';
|
||||||
import { Routes } from '../../route-names';
|
import { Routes } from '../../route-names';
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { useFetch } from '@vegaprotocol/react-helpers';
|
import { useBlockInfo } from '@vegaprotocol/tendermint';
|
||||||
import { NodeLink } from '../../../components/links';
|
import { NodeLink } from '../../../components/links';
|
||||||
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
||||||
import EmptyList from '../../../components/empty-list/empty-list';
|
import EmptyList from '../../../components/empty-list/empty-list';
|
||||||
@@ -24,10 +22,7 @@ const Block = () => {
|
|||||||
useDocumentTitle(['Blocks', `Block #${block}`]);
|
useDocumentTitle(['Blocks', `Block #${block}`]);
|
||||||
const {
|
const {
|
||||||
state: { data: blockData, loading, error },
|
state: { data: blockData, loading, error },
|
||||||
} = useFetch<TendermintBlocksResponse>(
|
} = useBlockInfo(Number(block));
|
||||||
`${DATA_SOURCES.tendermintUrl}/block?height=${block}`,
|
|
||||||
{ cache: 'force-cache' }
|
|
||||||
);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
|
|||||||
@@ -22,6 +22,11 @@ import { Footer } from '../components/footer/footer';
|
|||||||
import { Header } from '../components/header';
|
import { Header } from '../components/header';
|
||||||
import { Routes } from './route-names';
|
import { Routes } from './route-names';
|
||||||
import { useExplorerNodeNamesLazyQuery } from './validators/__generated__/NodeNames';
|
import { useExplorerNodeNamesLazyQuery } from './validators/__generated__/NodeNames';
|
||||||
|
import {
|
||||||
|
ProtocolUpgradeCountdownMode,
|
||||||
|
ProtocolUpgradeInProgressNotification,
|
||||||
|
ProtocolUpgradeProposalNotification,
|
||||||
|
} from '@vegaprotocol/proposals';
|
||||||
|
|
||||||
const DialogsContainer = () => {
|
const DialogsContainer = () => {
|
||||||
const { isOpen, id, trigger, asJson, setOpen } = useAssetDetailsDialogStore();
|
const { isOpen, id, trigger, asJson, setOpen } = useAssetDetailsDialogStore();
|
||||||
@@ -62,6 +67,10 @@ export const Layout = () => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Header />
|
<Header />
|
||||||
|
<ProtocolUpgradeProposalNotification
|
||||||
|
mode={ProtocolUpgradeCountdownMode.IN_ESTIMATED_TIME_REMAINING}
|
||||||
|
/>
|
||||||
|
<ProtocolUpgradeInProgressNotification />
|
||||||
</div>
|
</div>
|
||||||
<div className={fixedWidthClasses}>
|
<div className={fixedWidthClasses}>
|
||||||
<main className="p-4">
|
<main className="p-4">
|
||||||
|
|||||||
@@ -48,9 +48,11 @@ query ExplorerPartyAssets($partyId: ID!) {
|
|||||||
}
|
}
|
||||||
stakingSummary {
|
stakingSummary {
|
||||||
currentStakeAvailable
|
currentStakeAvailable
|
||||||
linkings(pagination: { first: 100 }) {
|
linkings(pagination: { last: 100 }) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
|
type
|
||||||
|
status
|
||||||
amount
|
amount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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, 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 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', type: Types.StakeLinkingType, status: Types.StakeLinkingStatus, 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,9 +64,11 @@ export const ExplorerPartyAssetsDocument = gql`
|
|||||||
}
|
}
|
||||||
stakingSummary {
|
stakingSummary {
|
||||||
currentStakeAvailable
|
currentStakeAvailable
|
||||||
linkings(pagination: {first: 100}) {
|
linkings(pagination: {last: 100}) {
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
|
type
|
||||||
|
status
|
||||||
amount
|
amount
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,15 @@ export const PartyBlockStake = ({
|
|||||||
linkedLength && linkedLength > 0
|
linkedLength && linkedLength > 0
|
||||||
? p?.stakingSummary?.linkings?.edges
|
? p?.stakingSummary?.linkings?.edges
|
||||||
?.reduce((total, e) => {
|
?.reduce((total, e) => {
|
||||||
return new BigNumber(total).plus(
|
const accumulator = new BigNumber(total);
|
||||||
new BigNumber(e?.node.amount || 0)
|
const diff = new BigNumber(e?.node.amount || 0);
|
||||||
);
|
if (e?.node.type === 'TYPE_LINK') {
|
||||||
|
return accumulator.plus(diff);
|
||||||
|
} else if (e?.node.type === 'TYPE_UNLINK') {
|
||||||
|
return accumulator.minus(diff);
|
||||||
|
} else {
|
||||||
|
return accumulator;
|
||||||
|
}
|
||||||
}, new BigNumber(0))
|
}, new BigNumber(0))
|
||||||
.toString()
|
.toString()
|
||||||
: '0';
|
: '0';
|
||||||
@@ -54,7 +60,7 @@ export const PartyBlockStake = ({
|
|||||||
{p?.stakingSummary.currentStakeAvailable ? (
|
{p?.stakingSummary.currentStakeAvailable ? (
|
||||||
<KeyValueTable>
|
<KeyValueTable>
|
||||||
<KeyValueTableRow noBorder={true}>
|
<KeyValueTableRow noBorder={true}>
|
||||||
<div>{t('Available stake')}</div>
|
<div>{t('Associated to key')}</div>
|
||||||
<div>
|
<div>
|
||||||
<GovernanceAssetBalance
|
<GovernanceAssetBalance
|
||||||
price={p.stakingSummary.currentStakeAvailable}
|
price={p.stakingSummary.currentStakeAvailable}
|
||||||
@@ -62,7 +68,7 @@ export const PartyBlockStake = ({
|
|||||||
</div>
|
</div>
|
||||||
</KeyValueTableRow>
|
</KeyValueTableRow>
|
||||||
<KeyValueTableRow noBorder={true}>
|
<KeyValueTableRow noBorder={true}>
|
||||||
<div>{t('Active stake')}</div>
|
<div>{t('Staked to validator')}</div>
|
||||||
<div>
|
<div>
|
||||||
<GovernanceAssetBalance price={linkedStake || '0'} />
|
<GovernanceAssetBalance price={linkedStake || '0'} />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -15,9 +15,13 @@ import { PartyBlockAccounts } from './components/party-block-accounts';
|
|||||||
import { isValidPartyId } from './components/party-id-error';
|
import { isValidPartyId } from './components/party-id-error';
|
||||||
import { useDataProvider } from '@vegaprotocol/data-provider';
|
import { useDataProvider } from '@vegaprotocol/data-provider';
|
||||||
import { TxsListNavigation } from '../../../components/txs/tx-list-navigation';
|
import { TxsListNavigation } from '../../../components/txs/tx-list-navigation';
|
||||||
|
import type { FilterOption } from '../../../components/txs/tx-filter';
|
||||||
import { AllFilterOptions, TxsFilter } from '../../../components/txs/tx-filter';
|
import { AllFilterOptions, TxsFilter } from '../../../components/txs/tx-filter';
|
||||||
|
import { useSearchParams } from 'react-router-dom';
|
||||||
|
|
||||||
const Party = () => {
|
const Party = () => {
|
||||||
|
const [params] = useSearchParams();
|
||||||
|
|
||||||
const [filters, setFilters] = useState(new Set(AllFilterOptions));
|
const [filters, setFilters] = useState(new Set(AllFilterOptions));
|
||||||
const { party } = useParams<{ party: string }>();
|
const { party } = useParams<{ party: string }>();
|
||||||
|
|
||||||
@@ -27,24 +31,21 @@ const Party = () => {
|
|||||||
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]);
|
||||||
const baseFilters = `filters[tx.submitter]=${partyId}`;
|
|
||||||
const f =
|
|
||||||
filters && filters.size === 1
|
|
||||||
? `${baseFilters}&filters[cmd.type]=${Array.from(filters)[0]}`
|
|
||||||
: baseFilters;
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
hasMoreTxs,
|
|
||||||
nextPage,
|
nextPage,
|
||||||
|
refreshTxs,
|
||||||
previousPage,
|
previousPage,
|
||||||
error,
|
error,
|
||||||
refreshTxs,
|
|
||||||
loading,
|
loading,
|
||||||
txsData,
|
txsData,
|
||||||
hasPreviousPage,
|
hasMoreTxs,
|
||||||
|
updateFilters,
|
||||||
} = useTxsData({
|
} = useTxsData({
|
||||||
limit: 25,
|
filters: filters.size === 1 ? filters : undefined,
|
||||||
filters: f,
|
before: params.get('before') || undefined,
|
||||||
|
after: !params.get('before') ? params.get('after') || undefined : undefined,
|
||||||
|
party: partyId,
|
||||||
});
|
});
|
||||||
|
|
||||||
const variables = useMemo(() => ({ partyId }), [partyId]);
|
const variables = useMemo(() => ({ partyId }), [partyId]);
|
||||||
@@ -67,7 +68,7 @@ const Party = () => {
|
|||||||
text: t('Go back'),
|
text: t('Go back'),
|
||||||
action: () => navigate(-1),
|
action: () => navigate(-1),
|
||||||
className: 'py-1',
|
className: 'py-1',
|
||||||
size: 'sm',
|
size: 'small',
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
@@ -102,15 +103,21 @@ const Party = () => {
|
|||||||
refreshTxs={refreshTxs}
|
refreshTxs={refreshTxs}
|
||||||
nextPage={nextPage}
|
nextPage={nextPage}
|
||||||
previousPage={previousPage}
|
previousPage={previousPage}
|
||||||
hasPreviousPage={hasPreviousPage}
|
hasPreviousPage={true}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
hasMoreTxs={hasMoreTxs}
|
hasMoreTxs={hasMoreTxs}
|
||||||
>
|
>
|
||||||
<TxsFilter filters={filters} setFilters={setFilters} />
|
<TxsFilter
|
||||||
|
filters={filters}
|
||||||
|
setFilters={(f) => {
|
||||||
|
setFilters(f);
|
||||||
|
updateFilters(f as Set<FilterOption>);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</TxsListNavigation>
|
</TxsListNavigation>
|
||||||
{!error && txsData ? (
|
{!error && txsData ? (
|
||||||
<TxsInfiniteList
|
<TxsInfiniteList
|
||||||
hasMoreTxs={hasMoreTxs}
|
hasMoreTxs={true}
|
||||||
areTxsLoading={loading}
|
areTxsLoading={loading}
|
||||||
txs={txsData}
|
txs={txsData}
|
||||||
loadMoreTxs={nextPage}
|
loadMoreTxs={nextPage}
|
||||||
|
|||||||
@@ -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 flags from '../config/flags';
|
|
||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { Routes } from './route-names';
|
import { Routes } from './route-names';
|
||||||
import { NetworkParameters } from './network-parameters';
|
import { NetworkParameters } from './network-parameters';
|
||||||
@@ -30,6 +29,7 @@ import { truncateMiddle } from '@vegaprotocol/ui-toolkit';
|
|||||||
import { remove0x } from '@vegaprotocol/utils';
|
import { remove0x } from '@vegaprotocol/utils';
|
||||||
import { PartyAccountsByAsset } from './parties/id/accounts';
|
import { PartyAccountsByAsset } from './parties/id/accounts';
|
||||||
import { Disclaimer } from './pages/disclaimer';
|
import { Disclaimer } from './pages/disclaimer';
|
||||||
|
import { FLAGS } from '@vegaprotocol/environment';
|
||||||
|
|
||||||
export type Navigable = {
|
export type Navigable = {
|
||||||
path: string;
|
path: string;
|
||||||
@@ -59,7 +59,7 @@ type Route = RouteItem & {
|
|||||||
children?: RouteItem[];
|
children?: RouteItem[];
|
||||||
};
|
};
|
||||||
|
|
||||||
const partiesRoutes: Route[] = flags.parties
|
const partiesRoutes: Route[] = FLAGS.EXPLORER_PARTIES
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.PARTIES,
|
path: Routes.PARTIES,
|
||||||
@@ -119,7 +119,7 @@ const partiesRoutes: Route[] = flags.parties
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const assetsRoutes: Route[] = flags.assets
|
const assetsRoutes: Route[] = FLAGS.EXPLORER_ASSETS
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.ASSETS,
|
path: Routes.ASSETS,
|
||||||
@@ -147,7 +147,7 @@ const assetsRoutes: Route[] = flags.assets
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const genesisRoutes: Route[] = flags.genesis
|
const genesisRoutes: Route[] = FLAGS.EXPLORER_GENESIS
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.GENESIS,
|
path: Routes.GENESIS,
|
||||||
@@ -163,7 +163,7 @@ const genesisRoutes: Route[] = flags.genesis
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const governanceRoutes: Route[] = flags.governance
|
const governanceRoutes: Route[] = FLAGS.EXPLORER_GOVERNANCE
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.GOVERNANCE,
|
path: Routes.GOVERNANCE,
|
||||||
@@ -179,7 +179,7 @@ const governanceRoutes: Route[] = flags.governance
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const marketsRoutes: Route[] = flags.markets
|
const marketsRoutes: Route[] = FLAGS.EXPLORER_MARKETS
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.MARKETS,
|
path: Routes.MARKETS,
|
||||||
@@ -207,7 +207,7 @@ const marketsRoutes: Route[] = flags.markets
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const networkParametersRoutes: Route[] = flags.networkParameters
|
const networkParametersRoutes: Route[] = FLAGS.EXPLORER_NETWORK_PARAMETERS
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.NETWORK_PARAMETERS,
|
path: Routes.NETWORK_PARAMETERS,
|
||||||
@@ -225,7 +225,7 @@ const networkParametersRoutes: Route[] = flags.networkParameters
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const validators: Route[] = flags.validators
|
const validators: Route[] = FLAGS.EXPLORER_VALIDATORS
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
path: Routes.VALIDATORS,
|
path: Routes.VALIDATORS,
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import { t } from '@vegaprotocol/i18n';
|
import { t } from '@vegaprotocol/i18n';
|
||||||
import { RouteTitle } from '../../../components/route-title';
|
import { RouteTitle } from '../../../components/route-title';
|
||||||
import { TxsInfiniteList } from '../../../components/txs';
|
import { TxsInfiniteList } from '../../../components/txs';
|
||||||
import { useTxsData } from '../../../hooks/use-txs-data';
|
import { useTxsData, getInitialFilters } from '../../../hooks/use-txs-data';
|
||||||
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
import { useDocumentTitle } from '../../../hooks/use-document-title';
|
||||||
|
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { AllFilterOptions, TxsFilter } from '../../../components/txs/tx-filter';
|
import { TxsFilter } from '../../../components/txs/tx-filter';
|
||||||
|
import type { FilterOption } from '../../../components/txs/tx-filter';
|
||||||
import { TxsListNavigation } from '../../../components/txs/tx-list-navigation';
|
import { TxsListNavigation } from '../../../components/txs/tx-list-navigation';
|
||||||
|
import { useSearchParams } from 'react-router-dom';
|
||||||
const BE_TXS_PER_REQUEST = 25;
|
|
||||||
|
|
||||||
export const TxsList = () => {
|
export const TxsList = () => {
|
||||||
useDocumentTitle(['Transactions']);
|
useDocumentTitle(['Transactions']);
|
||||||
@@ -27,25 +27,22 @@ export const TxsList = () => {
|
|||||||
* @returns {JSX.Element} Transaction List and controls
|
* @returns {JSX.Element} Transaction List and controls
|
||||||
*/
|
*/
|
||||||
export const TxsListFiltered = () => {
|
export const TxsListFiltered = () => {
|
||||||
const [filters, setFilters] = useState(new Set(AllFilterOptions));
|
const [params] = useSearchParams();
|
||||||
|
const [filters, setFilters] = useState(getInitialFilters(params));
|
||||||
const f =
|
|
||||||
filters && filters.size === 1
|
|
||||||
? `filters[cmd.type]=${Array.from(filters)[0]}`
|
|
||||||
: '';
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
hasMoreTxs,
|
|
||||||
nextPage,
|
nextPage,
|
||||||
previousPage,
|
previousPage,
|
||||||
error,
|
error,
|
||||||
refreshTxs,
|
refreshTxs,
|
||||||
loading,
|
loading,
|
||||||
txsData,
|
txsData,
|
||||||
hasPreviousPage,
|
hasMoreTxs,
|
||||||
|
updateFilters,
|
||||||
} = useTxsData({
|
} = useTxsData({
|
||||||
limit: BE_TXS_PER_REQUEST,
|
filters: filters.size === 1 ? filters : undefined,
|
||||||
filters: f,
|
before: params.get('before') || undefined,
|
||||||
|
after: !params.get('before') ? params.get('after') || undefined : undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -54,11 +51,17 @@ export const TxsListFiltered = () => {
|
|||||||
refreshTxs={refreshTxs}
|
refreshTxs={refreshTxs}
|
||||||
nextPage={nextPage}
|
nextPage={nextPage}
|
||||||
previousPage={previousPage}
|
previousPage={previousPage}
|
||||||
hasPreviousPage={hasPreviousPage}
|
hasPreviousPage={true}
|
||||||
loading={loading}
|
loading={loading}
|
||||||
hasMoreTxs={hasMoreTxs}
|
hasMoreTxs={hasMoreTxs}
|
||||||
>
|
>
|
||||||
<TxsFilter filters={filters} setFilters={setFilters} />
|
<TxsFilter
|
||||||
|
filters={filters}
|
||||||
|
setFilters={(f) => {
|
||||||
|
setFilters(f);
|
||||||
|
updateFilters(f as Set<FilterOption>);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</TxsListNavigation>
|
</TxsListNavigation>
|
||||||
<TxsInfiniteList
|
<TxsInfiniteList
|
||||||
hasFilters={filters.size > 0}
|
hasFilters={filters.size > 0}
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ query ExplorerNodes {
|
|||||||
stakedByDelegates
|
stakedByDelegates
|
||||||
stakedTotal
|
stakedTotal
|
||||||
pendingStake
|
pendingStake
|
||||||
|
rankingScore {
|
||||||
|
performanceScore
|
||||||
|
}
|
||||||
epochData {
|
epochData {
|
||||||
total
|
total
|
||||||
offline
|
offline
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ const defaultOptions = {} as const;
|
|||||||
export type ExplorerNodesQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
export type ExplorerNodesQueryVariables = Types.Exact<{ [key: string]: never; }>;
|
||||||
|
|
||||||
|
|
||||||
export type ExplorerNodesQuery = { __typename?: 'Query', nodesConnection: { __typename?: 'NodesConnection', edges?: Array<{ __typename?: 'NodeEdge', node: { __typename?: 'Node', id: string, name: string, infoUrl: string, avatarUrl?: string | null, pubkey: string, tmPubkey: string, ethereumAddress: string, location: string, status: Types.NodeStatus, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null } } | null> | null } };
|
export type ExplorerNodesQuery = { __typename?: 'Query', nodesConnection: { __typename?: 'NodesConnection', edges?: Array<{ __typename?: 'NodeEdge', node: { __typename?: 'Node', id: string, name: string, infoUrl: string, avatarUrl?: string | null, pubkey: string, tmPubkey: string, ethereumAddress: string, location: string, status: Types.NodeStatus, stakedByOperator: string, stakedByDelegates: string, stakedTotal: string, pendingStake: string, rankingScore: { __typename?: 'RankingScore', performanceScore: string }, epochData?: { __typename?: 'EpochData', total: number, offline: number, online: number } | null } } | null> | null } };
|
||||||
|
|
||||||
|
|
||||||
export const ExplorerNodesDocument = gql`
|
export const ExplorerNodesDocument = gql`
|
||||||
@@ -27,6 +27,9 @@ export const ExplorerNodesDocument = gql`
|
|||||||
stakedByDelegates
|
stakedByDelegates
|
||||||
stakedTotal
|
stakedTotal
|
||||||
pendingStake
|
pendingStake
|
||||||
|
rankingScore {
|
||||||
|
performanceScore
|
||||||
|
}
|
||||||
epochData {
|
epochData {
|
||||||
total
|
total
|
||||||
offline
|
offline
|
||||||
|
|||||||
@@ -91,7 +91,15 @@ export const ValidatorsPage = () => {
|
|||||||
const { data: tmData } = useTendermintValidators(5000);
|
const { data: tmData } = useTendermintValidators(5000);
|
||||||
const { data, loading, error, refetch } = useExplorerNodesQuery();
|
const { data, loading, error, refetch } = useExplorerNodesQuery();
|
||||||
|
|
||||||
const validators = compact(data?.nodesConnection.edges?.map((e) => e?.node));
|
const validators = compact(
|
||||||
|
data?.nodesConnection.edges
|
||||||
|
?.map((e) => e?.node)
|
||||||
|
.filter(
|
||||||
|
(node) =>
|
||||||
|
node?.rankingScore?.performanceScore &&
|
||||||
|
new BigNumber(node.rankingScore.performanceScore).isGreaterThan(0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
// voting power
|
// voting power
|
||||||
const powers = compact(tmData?.result.validators).map(
|
const powers = compact(tmData?.result.validators).map(
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 547 B |
Binary file not shown.
|
After Width: | Height: | Size: 1.5 KiB |
@@ -0,0 +1,20 @@
|
|||||||
|
{
|
||||||
|
"short_name": "Mainnet Stats",
|
||||||
|
"name": "Vega Mainnet statistics",
|
||||||
|
"icons": [
|
||||||
|
{
|
||||||
|
"src": "favicon.ico",
|
||||||
|
"sizes": "64x64 32x32 24x24 16x16",
|
||||||
|
"type": "image/x-icon"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"src": "logo192.png",
|
||||||
|
"type": "image/png",
|
||||||
|
"sizes": "192x192"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"start_url": ".",
|
||||||
|
"display": "standalone",
|
||||||
|
"theme_color": "#000000",
|
||||||
|
"background_color": "#ffffff"
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# https://www.robotstxt.org/robotstxt.html
|
||||||
|
User-agent: *
|
||||||
|
Disallow:
|
||||||
@@ -1,23 +1,39 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
|
||||||
<title>Explorer</title>
|
|
||||||
<base href="/" />
|
|
||||||
<link
|
|
||||||
rel="preload"
|
|
||||||
href="https://static.vega.xyz/AlphaLyrae-Medium.woff2"
|
|
||||||
as="font"
|
|
||||||
type="font/woff2"
|
|
||||||
crossorigin="anonymous"
|
|
||||||
/>
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta charset="utf-8" />
|
||||||
<link
|
<link
|
||||||
rel="icon"
|
rel="icon"
|
||||||
type="image/x-icon"
|
type="image/x-icon"
|
||||||
href="https://static.vega.xyz/favicon.ico"
|
href="https://static.vega.xyz/favicon.ico"
|
||||||
/>
|
/>
|
||||||
<link rel="stylesheet" href="https://static.vega.xyz/fonts.css" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
|
<meta name="theme-color" content="#000000" />
|
||||||
|
<meta name="description" content="Vega Protocol - VEGA Explorer" />
|
||||||
|
<meta name="og:type" content="website" />
|
||||||
|
<meta name="og:url" content="https://explorer.vega.xyz/" />
|
||||||
|
<meta name="og:title" content="Vega Protocol - Explorer" />
|
||||||
|
<meta name="og:site_name" content="Vega Protocol - Explorer" />
|
||||||
|
<meta name="og:image" content="https://static.vega.xyz/favicon.ico" />
|
||||||
|
|
||||||
|
<meta name="twitter:card" content="https://static.vega.xyz/favicon.ico" />
|
||||||
|
<meta name="twitter:title" content="Vega Protocol - Explorer" />
|
||||||
|
<meta name="twitter:description" content="Vega Protocol - Explorer" />
|
||||||
|
<meta name="twitter:image" content="https://static.vega.xyz/favicon.ico" />
|
||||||
|
<meta name="twitter:image:alt" content="VEGA logo" />
|
||||||
|
<meta name="twitter:site" content="@vegaprotocol" />
|
||||||
|
|
||||||
|
<meta name="description" content="Vega Protocol - Explorer" />
|
||||||
|
<link rel="apple-touch-icon" href="assets/apple-touch-icon.png" />
|
||||||
|
<link rel="manifest" href="assets/manifest.json" />
|
||||||
|
<link
|
||||||
|
rel="preload"
|
||||||
|
href="https://static.vega.xyz/AlphaLyrae-Medium.woff2"
|
||||||
|
as="font"
|
||||||
|
type="font/woff2"
|
||||||
|
/>
|
||||||
|
<title>VEGA Explorer</title>
|
||||||
<script src="./assets/env-config.js"></script>
|
<script src="./assets/env-config.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body class="dark:bg-black h-full w-full">
|
<body class="dark:bg-black h-full w-full">
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/annou
|
|||||||
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
|
NX_WALLETCONNECT_PROJECT_ID=fe8091dc35738863e509fc4947525c72
|
||||||
NX_VEGA_REST_URL=http://localhost:3008/api/v2/
|
NX_VEGA_REST_URL=http://localhost:3008/api/v2/
|
||||||
|
NX_SUCCESSOR_MARKETS=true
|
||||||
|
|
||||||
#Test configuration variables
|
#Test configuration variables
|
||||||
CYPRESS_FAIRGROUND=false
|
CYPRESS_FAIRGROUND=false
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ module.exports = defineConfig({
|
|||||||
numTestsKeptInMemory: 5,
|
numTestsKeptInMemory: 5,
|
||||||
downloadsFolder: 'cypress/downloads',
|
downloadsFolder: 'cypress/downloads',
|
||||||
testIsolation: false,
|
testIsolation: false,
|
||||||
|
experimentalMemoryManagement: true,
|
||||||
},
|
},
|
||||||
env: {
|
env: {
|
||||||
ethProviderUrl: 'http://localhost:8545/',
|
ethProviderUrl: 'http://localhost:8545/',
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
{
|
||||||
|
"changes": {
|
||||||
|
"decimalPlaces": "5",
|
||||||
|
"positionDecimalPlaces": "5",
|
||||||
|
"linearSlippageFactor": "0.001",
|
||||||
|
"quadraticSlippageFactor": "0",
|
||||||
|
"lpPriceRange": "10",
|
||||||
|
"instrument": {
|
||||||
|
"name": "Token test market",
|
||||||
|
"code": "Token.24h",
|
||||||
|
"future": {
|
||||||
|
"settlementAsset": "816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc",
|
||||||
|
"quoteName": "fUSDC",
|
||||||
|
"dataSourceSpecForSettlementData": {
|
||||||
|
"external": {
|
||||||
|
"oracle": {
|
||||||
|
"signers": [
|
||||||
|
{
|
||||||
|
"pubKey": {
|
||||||
|
"key": "70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"name": "prices.BTC.value",
|
||||||
|
"type": "TYPE_INTEGER",
|
||||||
|
"numberDecimalPlaces": "0"
|
||||||
|
},
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"operator": "OPERATOR_GREATER_THAN",
|
||||||
|
"value": "0"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dataSourceSpecForTradingTermination": {
|
||||||
|
"external": {
|
||||||
|
"oracle": {
|
||||||
|
"signers": [
|
||||||
|
{
|
||||||
|
"pubKey": {
|
||||||
|
"key": "70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"key": {
|
||||||
|
"name": "trading.terminated.ETH5",
|
||||||
|
"type": "TYPE_BOOLEAN"
|
||||||
|
},
|
||||||
|
"conditions": [
|
||||||
|
{
|
||||||
|
"operator": "OPERATOR_EQUALS",
|
||||||
|
"value": "true"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dataSourceSpecBinding": {
|
||||||
|
"settlementDataProperty": "prices.BTC.value",
|
||||||
|
"tradingTerminationProperty": "trading.terminated.ETH5"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"metadata": ["sector:food", "sector:materials", "source:docs.vega.xyz"],
|
||||||
|
"priceMonitoringParameters": {
|
||||||
|
"triggers": [
|
||||||
|
{
|
||||||
|
"horizon": "43200",
|
||||||
|
"probability": "0.9999999",
|
||||||
|
"auctionExtension": "600"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"liquidityMonitoringParameters": {
|
||||||
|
"targetStakeParameters": {
|
||||||
|
"timeWindow": "3600",
|
||||||
|
"scalingFactor": 10
|
||||||
|
},
|
||||||
|
"triggeringRatio": "0.7",
|
||||||
|
"auctionExtension": "1"
|
||||||
|
},
|
||||||
|
"logNormal": {
|
||||||
|
"tau": 0.0001140771161,
|
||||||
|
"riskAversionParameter": 0.001,
|
||||||
|
"params": {
|
||||||
|
"mu": 0,
|
||||||
|
"r": 0.016,
|
||||||
|
"sigma": 0.8
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"successor": {
|
||||||
|
"parentMarketId": "",
|
||||||
|
"insurancePoolFraction": "0.75"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,7 +11,9 @@ import {
|
|||||||
getDateFormatForSpecifiedDays,
|
getDateFormatForSpecifiedDays,
|
||||||
getProposalFromTitle,
|
getProposalFromTitle,
|
||||||
getProposalInformationFromTable,
|
getProposalInformationFromTable,
|
||||||
|
proposalChangeType,
|
||||||
submitUniqueRawProposal,
|
submitUniqueRawProposal,
|
||||||
|
validateProposalDetailsDiff,
|
||||||
voteForProposal,
|
voteForProposal,
|
||||||
} from '../../../../governance-e2e/src/support/governance.functions';
|
} from '../../../../governance-e2e/src/support/governance.functions';
|
||||||
import {
|
import {
|
||||||
@@ -26,7 +28,9 @@ import {
|
|||||||
} from '../../support/wallet-functions';
|
} from '../../support/wallet-functions';
|
||||||
import type { testFreeformProposal } from '../../support/common-interfaces';
|
import type { testFreeformProposal } from '../../support/common-interfaces';
|
||||||
import { formatDateWithLocalTimezone } from '@vegaprotocol/utils';
|
import { formatDateWithLocalTimezone } from '@vegaprotocol/utils';
|
||||||
|
import { createSuccessorMarketProposalTxBody } from '../../support/proposal.functions';
|
||||||
|
|
||||||
|
const proposalListItem = '[data-testid="proposals-list-item"]';
|
||||||
const proposalVoteProgressForPercentage =
|
const proposalVoteProgressForPercentage =
|
||||||
'vote-progress-indicator-percentage-for';
|
'vote-progress-indicator-percentage-for';
|
||||||
const proposalVoteProgressAgainstPercentage =
|
const proposalVoteProgressAgainstPercentage =
|
||||||
@@ -42,6 +46,7 @@ const viewProposalButton = 'view-proposal-btn';
|
|||||||
const proposalDescriptionToggle = 'proposal-description-toggle';
|
const proposalDescriptionToggle = 'proposal-description-toggle';
|
||||||
const voteBreakdownToggle = 'vote-breakdown-toggle';
|
const voteBreakdownToggle = 'vote-breakdown-toggle';
|
||||||
const proposalTermsToggle = 'proposal-json-toggle';
|
const proposalTermsToggle = 'proposal-json-toggle';
|
||||||
|
const marketDataToggle = 'proposal-market-data-toggle';
|
||||||
|
|
||||||
describe(
|
describe(
|
||||||
'Governance flow for proposal details',
|
'Governance flow for proposal details',
|
||||||
@@ -50,12 +55,12 @@ describe(
|
|||||||
before('connect wallets and set approval limit', function () {
|
before('connect wallets and set approval limit', function () {
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
// cy.associateTokensToVegaWallet('1');
|
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach('visit proposals tab', function () {
|
beforeEach('visit proposals tab', function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -215,20 +220,37 @@ describe(
|
|||||||
cy.getByTestId(changeVoteButton).should('be.visible').click();
|
cy.getByTestId(changeVoteButton).should('be.visible').click();
|
||||||
voteForProposal('for');
|
voteForProposal('for');
|
||||||
// 3001-VOTE-064
|
// 3001-VOTE-064
|
||||||
|
cy.getByTestId('user-voted-yes').should('exist');
|
||||||
getProposalInformationFromTable('Tokens for proposal')
|
getProposalInformationFromTable('Tokens for proposal')
|
||||||
.should('have.text', (1).toFixed(2))
|
.should('have.text', (1).toFixed(2))
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
|
getProposalFromTitle(rawProposal.rationale.title).within(() => {
|
||||||
|
// 3002-PROP-021
|
||||||
|
cy.getByTestId('user-voted-yes').should('exist');
|
||||||
|
cy.getByTestId(viewProposalButton).click();
|
||||||
|
});
|
||||||
|
});
|
||||||
cy.getByTestId(changeVoteButton).should('be.visible').click();
|
cy.getByTestId(changeVoteButton).should('be.visible').click();
|
||||||
voteForProposal('against');
|
voteForProposal('against');
|
||||||
cy.getByTestId(proposalVoteProgressAgainstPercentage)
|
cy.getByTestId(proposalVoteProgressAgainstPercentage)
|
||||||
.contains('100.00%')
|
.contains('100.00%')
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
|
cy.getByTestId(voteBreakdownToggle).click();
|
||||||
getProposalInformationFromTable('Tokens against proposal')
|
getProposalInformationFromTable('Tokens against proposal')
|
||||||
.should('have.text', (1).toFixed(2))
|
.should('have.text', (1).toFixed(2))
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
getProposalInformationFromTable('Number of voting parties')
|
getProposalInformationFromTable('Number of voting parties')
|
||||||
.should('have.text', '1')
|
.should('have.text', '1')
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
|
getProposalFromTitle(rawProposal.rationale.title).within(() => {
|
||||||
|
cy.getByTestId('user-voted-no').should('exist');
|
||||||
|
cy.getByTestId(viewProposalButton).click();
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 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
|
||||||
@@ -338,5 +360,126 @@ describe(
|
|||||||
switchVegaWalletPubKey();
|
switchVegaWalletPubKey();
|
||||||
stakingPageDisassociateAllTokens();
|
stakingPageDisassociateAllTokens();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Error message should be displayed if error returned from wallet when voting', function () {
|
||||||
|
const errorMsg =
|
||||||
|
'Application error: party has already submitted the maximum number of transactions of this type per epoch (3)';
|
||||||
|
|
||||||
|
createRawProposal();
|
||||||
|
cy.get<testFreeformProposal>('@rawProposal').then((rawProposal) => {
|
||||||
|
getProposalFromTitle(rawProposal.rationale.title).within(() =>
|
||||||
|
cy.getByTestId(viewProposalButton).click()
|
||||||
|
);
|
||||||
|
cy.intercept('POST', '/api/v2/requests', {
|
||||||
|
jsonrpc: '2.0',
|
||||||
|
error: {
|
||||||
|
code: 2001,
|
||||||
|
message: 'Application error',
|
||||||
|
data: 'party has already submitted the maximum number of transactions of this type per epoch (3)',
|
||||||
|
},
|
||||||
|
id: '-PK5EGmErnjLhAmzMeclC',
|
||||||
|
});
|
||||||
|
cy.contains('Vote breakdown').should('be.visible', { timeout: 10000 });
|
||||||
|
cy.getByTestId('vote-buttons').contains('for').click();
|
||||||
|
cy.getByTestId('dialog-title').should(
|
||||||
|
'have.text',
|
||||||
|
'Transaction failed'
|
||||||
|
);
|
||||||
|
cy.getByTestId('Error').should('have.text', errorMsg);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Able to see successor market details with new and updated values', function () {
|
||||||
|
cy.createMarket();
|
||||||
|
cy.reload();
|
||||||
|
waitForSpinner();
|
||||||
|
cy.getByTestId('closed-proposals').within(() => {
|
||||||
|
cy.contains('Add Lorem Ipsum market')
|
||||||
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId(viewProposalButton).click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getProposalInformationFromTable('ID')
|
||||||
|
.invoke('text')
|
||||||
|
.as('parentMarketId')
|
||||||
|
.then(() => {
|
||||||
|
cy.VegaWalletSubmitProposal(
|
||||||
|
createSuccessorMarketProposalTxBody(this.parentMarketId)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
cy.reload();
|
||||||
|
getProposalFromTitle('Test successor market proposal details').within(
|
||||||
|
() => cy.getByTestId(viewProposalButton).click()
|
||||||
|
);
|
||||||
|
// #3003-PMAN-010
|
||||||
|
cy.getByTestId(proposalTermsToggle).click();
|
||||||
|
cy.get('.language-json').within(() => {
|
||||||
|
cy.get('.hljs-attr').should('contain.text', 'parentMarketId');
|
||||||
|
cy.get('.hljs-string').should('contain.text', this.parentMarketId);
|
||||||
|
cy.get('.hljs-attr').should('contain.text', 'insurancePoolFraction');
|
||||||
|
cy.get('.hljs-string').should('contain.text', '0.75');
|
||||||
|
});
|
||||||
|
// 3003-PMAN-011 3003-PMAN-012
|
||||||
|
cy.getByTestId(marketDataToggle).click();
|
||||||
|
cy.getByTestId('proposal-market-data').within(() => {
|
||||||
|
cy.contains('Key details').click();
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Name',
|
||||||
|
proposalChangeType.UPDATED,
|
||||||
|
'Token test market',
|
||||||
|
'Test market 1'
|
||||||
|
);
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Parent Market ID',
|
||||||
|
proposalChangeType.ADDED,
|
||||||
|
this.parentMarketId
|
||||||
|
);
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Insurance Pool Fraction',
|
||||||
|
proposalChangeType.ADDED,
|
||||||
|
'0.75'
|
||||||
|
);
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Trading Mode',
|
||||||
|
proposalChangeType.UPDATED,
|
||||||
|
'No trading',
|
||||||
|
'Opening auction'
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.contains('Instrument').click();
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Market Name',
|
||||||
|
proposalChangeType.UPDATED,
|
||||||
|
'Token test market',
|
||||||
|
'Test market 1'
|
||||||
|
);
|
||||||
|
|
||||||
|
cy.contains('Metadata').click();
|
||||||
|
validateProposalDetailsDiff(
|
||||||
|
'Sector',
|
||||||
|
proposalChangeType.UPDATED,
|
||||||
|
'materials',
|
||||||
|
'tech'
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 3003-PMAN-011
|
||||||
|
cy.get('.underline').contains('Parent Market ID').realHover();
|
||||||
|
cy.getByTestId('tooltip-content', { timeout: 8000 }).should(
|
||||||
|
'contain.text',
|
||||||
|
'The ID of the market this market succeeds.'
|
||||||
|
);
|
||||||
|
cy.get('.underline')
|
||||||
|
.contains('Insurance Pool Fraction')
|
||||||
|
.realMouseUp()
|
||||||
|
.realHover();
|
||||||
|
cy.getByTestId('tooltip-content', { timeout: 8000 }).should(
|
||||||
|
'contain.text',
|
||||||
|
'The fraction of the insurance pool balance that is carried over from the parent market to the successor.'
|
||||||
|
);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ const votesTable = 'votes-table';
|
|||||||
const openProposals = 'open-proposals';
|
const openProposals = 'open-proposals';
|
||||||
const proposalVoteProgressForPercentage =
|
const proposalVoteProgressForPercentage =
|
||||||
'vote-progress-indicator-percentage-for';
|
'vote-progress-indicator-percentage-for';
|
||||||
|
const majorityVoteReached = 'majority-reached';
|
||||||
|
const minParticipationReached = 'participation-reached';
|
||||||
const proposalTimeout = { timeout: 8000 };
|
const proposalTimeout = { timeout: 8000 };
|
||||||
|
|
||||||
context(
|
context(
|
||||||
@@ -40,6 +42,7 @@ context(
|
|||||||
beforeEach('visit proposals', function () {
|
beforeEach('visit proposals', function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -72,7 +75,7 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3001-VOTE-046 3001-VOTE-044 3001-VOTE-074 3001-VOTE-074
|
// 3001-VOTE-020 3001-VOTE-021 3001-VOTE-046 3001-VOTE-044 3001-VOTE-074 3001-VOTE-074
|
||||||
it('Able to enact proposal by voting', function () {
|
it('Able to enact proposal by voting', function () {
|
||||||
const proposalTitle = 'Add New proposal with short enactment';
|
const proposalTitle = 'Add New proposal with short enactment';
|
||||||
const proposalTx = createUpdateNetworkProposalTxBody();
|
const proposalTx = createUpdateNetworkProposalTxBody();
|
||||||
@@ -85,10 +88,18 @@ context(
|
|||||||
cy.contains(proposalTitle)
|
cy.contains(proposalTitle)
|
||||||
.parentsUntil(proposalListItem)
|
.parentsUntil(proposalListItem)
|
||||||
.last()
|
.last()
|
||||||
.within(() => cy.getByTestId(viewProposalButton).click());
|
.within(() => {
|
||||||
|
// 3001-VOTE-019 time to vote is highlighted red
|
||||||
|
cy.getByTestId('vote-details')
|
||||||
|
.find('span')
|
||||||
|
.should('have.class', 'text-vega-pink');
|
||||||
|
cy.getByTestId(viewProposalButton).click();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
cy.getByTestId(proposalStatus).should('have.text', 'Open');
|
cy.getByTestId(proposalStatus).should('have.text', 'Open');
|
||||||
voteForProposal('for');
|
voteForProposal('for');
|
||||||
|
cy.getByTestId(majorityVoteReached).should('exist');
|
||||||
|
cy.getByTestId(minParticipationReached).should('exist');
|
||||||
cy.getByTestId(proposalStatus, proposalTimeout)
|
cy.getByTestId(proposalStatus, proposalTimeout)
|
||||||
.should('have.text', 'Passed')
|
.should('have.text', 'Passed')
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@@ -104,6 +115,14 @@ context(
|
|||||||
cy.getByTestId(proposalVoteProgressForPercentage)
|
cy.getByTestId(proposalVoteProgressForPercentage)
|
||||||
.contains('100.00%')
|
.contains('100.00%')
|
||||||
.and('be.visible');
|
.and('be.visible');
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
cy.contains(proposalTitle)
|
||||||
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId(majorityVoteReached).should('exist');
|
||||||
|
cy.getByTestId(minParticipationReached).should('exist');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 3001-VOTE-047
|
// 3001-VOTE-047
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ context(
|
|||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
cy.mockChainId();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ context(
|
|||||||
beforeEach('visit governance tab', function () {
|
beforeEach('visit governance tab', function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -220,7 +221,7 @@ context(
|
|||||||
function () {
|
function () {
|
||||||
const proposalTitle = 'Test new market proposal';
|
const proposalTitle = 'Test new market proposal';
|
||||||
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
|
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
|
||||||
cy.getByTestId(newProposalTitle).type('Test new market proposal');
|
cy.getByTestId(newProposalTitle).type(proposalTitle);
|
||||||
cy.getByTestId(newProposalDescription).type('E2E test for proposals');
|
cy.getByTestId(newProposalDescription).type('E2E test for proposals');
|
||||||
cy.fixture('/proposals/new-market').then((newMarketProposal) => {
|
cy.fixture('/proposals/new-market').then((newMarketProposal) => {
|
||||||
const newMarketPayload = JSON.stringify(newMarketProposal);
|
const newMarketPayload = JSON.stringify(newMarketProposal);
|
||||||
@@ -606,6 +607,57 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('able to submit successor market proposal', function () {
|
||||||
|
const proposalTitle = 'Test successor market proposal';
|
||||||
|
|
||||||
|
cy.createMarket();
|
||||||
|
cy.reload();
|
||||||
|
waitForSpinner();
|
||||||
|
cy.getByTestId('closed-proposals').within(() => {
|
||||||
|
cy.contains('Add Lorem Ipsum market')
|
||||||
|
.parentsUntil(proposalListItem)
|
||||||
|
.last()
|
||||||
|
.within(() => {
|
||||||
|
cy.getByTestId(viewProposalBtn).click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
getProposalInformationFromTable('ID').invoke('text').as('parentMarketId');
|
||||||
|
goToMakeNewProposal(governanceProposalType.NEW_MARKET);
|
||||||
|
cy.getByTestId(newProposalTitle).type(proposalTitle);
|
||||||
|
cy.getByTestId(newProposalDescription).type(
|
||||||
|
'E2E test for successor market'
|
||||||
|
);
|
||||||
|
cy.fixture('/proposals/successor-market').then((newMarketProposal) => {
|
||||||
|
newMarketProposal.changes.successor.parentMarketId =
|
||||||
|
this.parentMarketId;
|
||||||
|
const newMarketPayload = JSON.stringify(newMarketProposal);
|
||||||
|
cy.getByTestId(newProposalTerms).type(newMarketPayload, {
|
||||||
|
parseSpecialCharSequences: false,
|
||||||
|
delay: 2,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
cy.getByTestId(proposalDownloadBtn)
|
||||||
|
.should('be.visible')
|
||||||
|
.click()
|
||||||
|
.then(() => {
|
||||||
|
cy.wrap(
|
||||||
|
getDownloadedProposalJsonPath('vega-new-market-proposal-')
|
||||||
|
).then((filePath) => {
|
||||||
|
goToMakeNewProposal(governanceProposalType.RAW);
|
||||||
|
submitUniqueRawProposal({ proposalBody: filePath });
|
||||||
|
});
|
||||||
|
});
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
getProposalFromTitle(proposalTitle).within(() => {
|
||||||
|
// 3003-PMAN-008
|
||||||
|
cy.getByTestId('proposal-successor-info')
|
||||||
|
.should('have.text', 'Successor market to: TEST.24h')
|
||||||
|
.find('a')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and('contain', this.parentMarketId);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
after('Disassociate from second wallet key if present', function () {
|
after('Disassociate from second wallet key if present', function () {
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
@@ -642,6 +694,7 @@ context(
|
|||||||
.getByTestId('key-value-table-row')
|
.getByTestId('key-value-table-row')
|
||||||
.contains(heading)
|
.contains(heading)
|
||||||
.parent()
|
.parent()
|
||||||
|
.parent()
|
||||||
.siblings();
|
.siblings();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
|
cy.mockChainId();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
@@ -49,8 +50,8 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 3001-VOTE-018
|
||||||
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 () {
|
||||||
// 3001-VOTE-005
|
|
||||||
const proposalDays = [364, 50, 2];
|
const proposalDays = [364, 50, 2];
|
||||||
for (let index = 0; index < proposalDays.length; index++) {
|
for (let index = 0; index < proposalDays.length; index++) {
|
||||||
goToMakeNewProposal(governanceProposalType.RAW);
|
goToMakeNewProposal(governanceProposalType.RAW);
|
||||||
@@ -120,16 +121,24 @@ describe('Governance flow for proposal list', { tags: '@slow' }, function () {
|
|||||||
submitUniqueRawProposal({ proposalTitle: proposalTitle });
|
submitUniqueRawProposal({ proposalTitle: proposalTitle });
|
||||||
getProposalFromTitle(proposalTitle).within(() => {
|
getProposalFromTitle(proposalTitle).within(() => {
|
||||||
// 3001-VOTE-039
|
// 3001-VOTE-039
|
||||||
cy.getByTestId(voteStatus).should(
|
cy.getByTestId('participation-not-reached').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
'Participation not reached'
|
'Min. participation not reached'
|
||||||
);
|
);
|
||||||
cy.getByTestId(viewProposalButton).click();
|
cy.getByTestId(viewProposalButton).click();
|
||||||
});
|
});
|
||||||
voteForProposal('for');
|
voteForProposal('for');
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
getProposalFromTitle(proposalTitle).within(() => {
|
getProposalFromTitle(proposalTitle).within(() => {
|
||||||
cy.getByTestId(voteStatus).should('have.text', 'Set to pass');
|
cy.getByTestId(voteStatus).should(
|
||||||
|
'have.text',
|
||||||
|
'Currently expected to pass'
|
||||||
|
);
|
||||||
|
cy.getByTestId('user-voted-yes').should('exist');
|
||||||
|
cy.getByTestId('participation-reached').should(
|
||||||
|
'have.text',
|
||||||
|
'Min. participation reached'
|
||||||
|
);
|
||||||
cy.getByTestId(viewProposalButton).click();
|
cy.getByTestId(viewProposalButton).click();
|
||||||
});
|
});
|
||||||
cy.getByTestId(voteBreakDownToggle).click();
|
cy.getByTestId(voteBreakDownToggle).click();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ 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.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
@@ -96,12 +97,14 @@ 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', rewardsTimeOut)
|
cy.getByTestId('ACCOUNT_TYPE_GLOBAL_REWARD', rewardsTimeOut).should(
|
||||||
.should('contain.text', '0.4415')
|
'contain.text',
|
||||||
.and('contain.text', '(44.15%)');
|
'0.4415'
|
||||||
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE')
|
);
|
||||||
.should('contain.text', '0.0004')
|
cy.getByTestId('ACCOUNT_TYPE_FEES_INFRASTRUCTURE').should(
|
||||||
.and('contain.text', '(44.15%)');
|
'contain.text',
|
||||||
|
'0.0004'
|
||||||
|
);
|
||||||
cy.getByTestId('total').should('have.text', '0.4419');
|
cy.getByTestId('total').should('have.text', '0.4419');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ import {
|
|||||||
vegaWalletSetSpecifiedApprovalAmount,
|
vegaWalletSetSpecifiedApprovalAmount,
|
||||||
vegaWalletTeardown,
|
vegaWalletTeardown,
|
||||||
} from '../../support/wallet-functions';
|
} from '../../support/wallet-functions';
|
||||||
|
|
||||||
const stakeValidatorListTotalStake = 'total-stake';
|
const stakeValidatorListTotalStake = 'total-stake';
|
||||||
const stakeValidatorListTotalShare = 'total-stake-share';
|
const stakeValidatorListTotalShare = 'total-stake-share';
|
||||||
const stakeValidatorListStakePercentage = 'stake-percentage';
|
const stakeValidatorListStakePercentage = 'stake-percentage';
|
||||||
@@ -67,6 +68,7 @@ context(
|
|||||||
function () {
|
function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
// Go to homepage to allow wallet teardown without epoch timer refreshing page
|
// Go to homepage to allow wallet teardown without epoch timer refreshing page
|
||||||
navigateTo(navigation.home);
|
navigateTo(navigation.home);
|
||||||
vegaWalletTeardown();
|
vegaWalletTeardown();
|
||||||
@@ -144,7 +146,7 @@ context(
|
|||||||
closeStakingDialog();
|
closeStakingDialog();
|
||||||
navigateTo(navigation.validators);
|
navigateTo(navigation.validators);
|
||||||
cy.getByTestId(viewStakedByMeToggle).click();
|
cy.getByTestId(viewStakedByMeToggle).click();
|
||||||
cy.getByTestId(userStakeBtn).should('have.length', 2);
|
cy.getByTestId(userStakeBtn, epochTimeout).should('have.length', 2);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('Able to stake against a validator - using vega from vesting contract', function () {
|
it('Able to stake against a validator - using vega from vesting contract', function () {
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ context(
|
|||||||
function () {
|
function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
@@ -351,6 +352,12 @@ context(
|
|||||||
);
|
);
|
||||||
stakingPageDisassociateAllTokens();
|
stakingPageDisassociateAllTokens();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('Able to associate over 1 million tokens', function () {
|
||||||
|
cy.get(ethWalletAssociateButton).click();
|
||||||
|
stakingPageAssociateTokens('2000000', { approve: true });
|
||||||
|
stakingPageDisassociateAllTokens();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ const toastPanel = 'toast-panel';
|
|||||||
const toastClose = 'toast-close';
|
const toastClose = 'toast-close';
|
||||||
const withdrawalDialogContent = 'dialog-content';
|
const withdrawalDialogContent = 'dialog-content';
|
||||||
const toastCompleteWithdrawal = 'toast-complete-withdrawal';
|
const toastCompleteWithdrawal = 'toast-complete-withdrawal';
|
||||||
|
const scrollBar = '.ag-body-horizontal-scroll-viewport';
|
||||||
const usdtName = 'USDC (local)';
|
const usdtName = 'USDC (local)';
|
||||||
const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0';
|
const usdcEthAddress = '0x1b8a1B6CBE5c93609b46D1829Cc7f3Cb8eeE23a0';
|
||||||
const usdcSymbol = 'tUSDC';
|
const usdcSymbol = 'tUSDC';
|
||||||
@@ -50,6 +51,7 @@ context(
|
|||||||
beforeEach('Navigate to withdrawal page', function () {
|
beforeEach('Navigate to withdrawal page', function () {
|
||||||
cy.clearLocalStorage();
|
cy.clearLocalStorage();
|
||||||
turnTelemetryOff();
|
turnTelemetryOff();
|
||||||
|
cy.mockChainId();
|
||||||
cy.reload();
|
cy.reload();
|
||||||
waitForSpinner();
|
waitForSpinner();
|
||||||
navigateTo(navigation.withdraw);
|
navigateTo(navigation.withdraw);
|
||||||
@@ -96,7 +98,8 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it(
|
// eslint-disable-next-line
|
||||||
|
it.skip(
|
||||||
'Able to withdraw asset: -eth wallet connected -withdraw funds button',
|
'Able to withdraw asset: -eth wallet connected -withdraw funds button',
|
||||||
{ tags: '@smoke' },
|
{ tags: '@smoke' },
|
||||||
function () {
|
function () {
|
||||||
@@ -197,20 +200,17 @@ context(
|
|||||||
);
|
);
|
||||||
cy.getByTestId(toastClose).click();
|
cy.getByTestId(toastClose).click();
|
||||||
});
|
});
|
||||||
cy.get(tableTxHash)
|
cy.get("[row-id='0']").within(() => {
|
||||||
.eq(1)
|
cy.get(tableAssetSymbol).should('have.text', usdcSymbol);
|
||||||
.should('have.text', 'Complete withdrawal')
|
cy.get(tableAmount).should('have.text', '110.00');
|
||||||
.parent()
|
cy.get(tableReceiverAddress)
|
||||||
.within(() => {
|
.find('a')
|
||||||
cy.get(tableAssetSymbol).should('have.text', usdcSymbol);
|
.should('have.attr', 'href')
|
||||||
cy.get(tableAmount).should('have.text', '110.00');
|
.and('contain', 'https://sepolia.etherscan.io/address/');
|
||||||
cy.get(tableReceiverAddress)
|
cy.get(tableCreatedTimeStamp).should('not.be.empty');
|
||||||
.find('a')
|
});
|
||||||
.should('have.attr', 'href')
|
|
||||||
.and('contain', 'https://sepolia.etherscan.io/address/');
|
|
||||||
cy.get(tableCreatedTimeStamp).should('not.be.empty');
|
|
||||||
});
|
|
||||||
ethereumWalletConnect();
|
ethereumWalletConnect();
|
||||||
|
cy.get(scrollBar).scrollTo('right');
|
||||||
cy.getByTestId(completeWithdrawalButton).first().click();
|
cy.getByTestId(completeWithdrawalButton).first().click();
|
||||||
cy.getByTestId(toast)
|
cy.getByTestId(toast)
|
||||||
.last(txTimeout)
|
.last(txTimeout)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
cy.getByTestId('home-proposals').within(() => {
|
cy.getByTestId('home-proposals').within(() => {
|
||||||
cy.get('[href="/proposals"]')
|
cy.get('[href="/proposals"]')
|
||||||
.should('exist')
|
.should('exist')
|
||||||
.and('have.text', 'Browse, vote, and propose');
|
.and('have.text', 'See all proposals');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -119,6 +119,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 0006-NETW-001 0006-NETW-002
|
||||||
it('should display network data', function () {
|
it('should display network data', function () {
|
||||||
cy.getByTestId('git-network-data')
|
cy.getByTestId('git-network-data')
|
||||||
.should('contain.text', 'Reading network data from')
|
.should('contain.text', 'Reading network data from')
|
||||||
@@ -130,6 +131,37 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 0006-NETW-003 0006-NETW-008 0006-NETW-009 0006-NETW-010 0006-NETW-012 0006-NETW-013 0006-NETW-017 0006-NETW-018 0006-NETW-019 0006-NETW-020
|
||||||
|
it('should have option to switch to different network node', function () {
|
||||||
|
cy.getByTestId('git-network-data').within(() => {
|
||||||
|
cy.getByTestId('link').click();
|
||||||
|
});
|
||||||
|
cy.getByTestId('node-row').within(() => {
|
||||||
|
cy.getByTestId('node-url-0')
|
||||||
|
.parent()
|
||||||
|
.should('have.text', 'http://localhost:3008/graphql');
|
||||||
|
cy.getByTestId('response-time-cell')
|
||||||
|
.invoke('text')
|
||||||
|
.should('not.be.empty')
|
||||||
|
.and('not.eq', 'Checking');
|
||||||
|
cy.getByTestId('block-height-cell')
|
||||||
|
.invoke('text')
|
||||||
|
.should('not.be.empty')
|
||||||
|
.then((currentBlockHeight) => {
|
||||||
|
// Check that block height updates automatically
|
||||||
|
cy.getByTestId('block-height-cell')
|
||||||
|
.invoke('text')
|
||||||
|
.should('not.eq', currentBlockHeight);
|
||||||
|
});
|
||||||
|
cy.getByTestId('subscription-cell').should('have.text', 'Yes');
|
||||||
|
});
|
||||||
|
cy.getByTestId('connect').should('be.disabled');
|
||||||
|
cy.getByTestId('node-url-custom').click();
|
||||||
|
cy.get('input').should('exist');
|
||||||
|
cy.getByTestId('connect').should('be.disabled');
|
||||||
|
cy.getByTestId('icon-cross').click();
|
||||||
|
});
|
||||||
|
|
||||||
it('should display eth data', function () {
|
it('should display eth data', function () {
|
||||||
cy.getByTestId('git-eth-data')
|
cy.getByTestId('git-eth-data')
|
||||||
.should('contain.text', 'Reading Ethereum data from')
|
.should('contain.text', 'Reading Ethereum data from')
|
||||||
@@ -138,6 +170,7 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 0006-NETW-011
|
||||||
it('should contain link for known issues on Github', function () {
|
it('should contain link for known issues on Github', function () {
|
||||||
cy.getByTestId('git-info').within(() => {
|
cy.getByTestId('git-info').within(() => {
|
||||||
cy.contains('Known issues and feedback on')
|
cy.contains('Known issues and feedback on')
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ const governanceDocsUrl = 'https://vega.xyz/governance';
|
|||||||
const networkUpgradeProposalListItem = 'protocol-upgrade-proposals-list-item';
|
const networkUpgradeProposalListItem = 'protocol-upgrade-proposals-list-item';
|
||||||
const closedProposals = 'closed-proposals';
|
const closedProposals = 'closed-proposals';
|
||||||
const closedProposalToggle = 'closed-proposals-toggle-networkUpgrades';
|
const closedProposalToggle = 'closed-proposals-toggle-networkUpgrades';
|
||||||
|
const protocolUpgradeTime = 'protocol-upgrade-time';
|
||||||
|
|
||||||
context(
|
context(
|
||||||
'Governance Page - verify elements on page',
|
'Governance Page - verify elements on page',
|
||||||
@@ -161,7 +162,7 @@ context(
|
|||||||
);
|
);
|
||||||
cy.getByTestId('protocol-upgrade-proposal-status').should(
|
cy.getByTestId('protocol-upgrade-proposal-status').should(
|
||||||
'have.text',
|
'have.text',
|
||||||
'Approved by validators '
|
'Approved by validators'
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -174,6 +175,7 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 3009-NTWU-003 3009-NTWU-004 3009-NTWU-007
|
||||||
it('should see details of network upgrade proposal', function () {
|
it('should see details of network upgrade proposal', function () {
|
||||||
mockNetworkUpgradeProposal();
|
mockNetworkUpgradeProposal();
|
||||||
navigateTo(navigation.proposals);
|
navigateTo(navigation.proposals);
|
||||||
@@ -227,5 +229,51 @@ context(
|
|||||||
cy.getByTestId(networkUpgradeProposalListItem).should('not.exist');
|
cy.getByTestId(networkUpgradeProposalListItem).should('not.exist');
|
||||||
cy.getByTestId(closedProposalToggle).should('not.exist');
|
cy.getByTestId(closedProposalToggle).should('not.exist');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 3009-NTWU-001 3009-NTWU-002 3009-NTWU-006 3009-NTWU-009
|
||||||
|
it.skip('should display network upgrade banner with estimate', function () {
|
||||||
|
mockNetworkUpgradeProposal();
|
||||||
|
cy.visit('/');
|
||||||
|
cy.getByTestId('banners').within(() => {
|
||||||
|
cy.get('div')
|
||||||
|
.should('contain.text', 'The network will upgrade to v1 in ')
|
||||||
|
.and(
|
||||||
|
'contain.text',
|
||||||
|
'Trading activity will be interrupted, manage your risk appropriately.'
|
||||||
|
);
|
||||||
|
cy.getByTestId('external-link')
|
||||||
|
.should('have.attr', 'href')
|
||||||
|
.and('contain', '/proposals/protocol-upgrade/v1');
|
||||||
|
});
|
||||||
|
|
||||||
|
// estimate does not display possibly due to mocks or Cypress unless the proposal is clicked on several times
|
||||||
|
// By default the application waits for 10 blocks until showing estimate - roughly 10 seconds
|
||||||
|
for (let i = 0; i < 3; i++) {
|
||||||
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
|
cy.wait(3000);
|
||||||
|
navigateTo(navigation.proposals);
|
||||||
|
cy.getByTestId(networkUpgradeProposalListItem)
|
||||||
|
.first()
|
||||||
|
.find('[data-testid="view-proposal-btn"]')
|
||||||
|
.click();
|
||||||
|
}
|
||||||
|
cy.getByTestId('upgrade-proposal-estimate')
|
||||||
|
.invoke('text')
|
||||||
|
.as('displayedEstimate');
|
||||||
|
cy.get('@displayedEstimate').then((estimateText) => {
|
||||||
|
// Estimated time should automatically update every second
|
||||||
|
cy.getByTestId(protocolUpgradeTime)
|
||||||
|
.invoke('text')
|
||||||
|
.should('not.eq', estimateText);
|
||||||
|
});
|
||||||
|
// time estimate on proposal detail
|
||||||
|
cy.getByTestId('protocol-upgrade-proposal').within(() => {
|
||||||
|
cy.get('@displayedEstimate').then((estimateText) => {
|
||||||
|
cy.getByTestId(protocolUpgradeTime)
|
||||||
|
.invoke('text')
|
||||||
|
.should('not.eq', estimateText);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {
|
|||||||
waitForBeginningOfEpoch,
|
waitForBeginningOfEpoch,
|
||||||
} from '../../support/staking.functions';
|
} from '../../support/staking.functions';
|
||||||
import { previousEpochData } from '../../fixtures/mocks/previous-epoch';
|
import { previousEpochData } from '../../fixtures/mocks/previous-epoch';
|
||||||
|
import { chainIdQuery, statisticsQuery } from '@vegaprotocol/mock';
|
||||||
|
|
||||||
const guideLink = 'staking-guide-link';
|
const guideLink = 'staking-guide-link';
|
||||||
const validatorTitle = 'validator-node-title';
|
const validatorTitle = 'validator-node-title';
|
||||||
@@ -33,11 +34,22 @@ const overstakedPenaltyToolTip = 'overstaked-penalty-tooltip';
|
|||||||
const multisigPenaltyToolTip = 'multisig-error-tooltip';
|
const multisigPenaltyToolTip = 'multisig-error-tooltip';
|
||||||
const epochCountDown = 'epoch-countdown';
|
const epochCountDown = 'epoch-countdown';
|
||||||
const stakeNumberRegex = /^\d{1,3}(,\d{3})*(\.\d+)?$/;
|
const stakeNumberRegex = /^\d{1,3}(,\d{3})*(\.\d+)?$/;
|
||||||
|
const txTimeout = Cypress.env('txTimeout');
|
||||||
|
|
||||||
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', () => {
|
||||||
|
cy.mockGQL((req) => {
|
||||||
|
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||||
|
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||||
|
});
|
||||||
cy.visit('/validators');
|
cy.visit('/validators');
|
||||||
});
|
});
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.mockGQL((req) => {
|
||||||
|
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||||
|
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
describe('with wallets disconnected', { tags: '@smoke' }, function () {
|
||||||
it('Should have validators tab highlighted', function () {
|
it('Should have validators tab highlighted', function () {
|
||||||
@@ -177,6 +189,11 @@ context('Validators Page - verify elements on page', function () {
|
|||||||
{ tags: '@smoke' },
|
{ tags: '@smoke' },
|
||||||
function () {
|
function () {
|
||||||
before('connect wallets and click on validator', function () {
|
before('connect wallets and click on validator', function () {
|
||||||
|
cy.mockGQL((req) => {
|
||||||
|
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||||
|
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||||
|
});
|
||||||
|
cy.visit('/validators');
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
clickOnValidatorFromList(0);
|
clickOnValidatorFromList(0);
|
||||||
});
|
});
|
||||||
@@ -263,7 +280,7 @@ context('Validators Page - verify elements on page', function () {
|
|||||||
|
|
||||||
cy.getByTestId(epochCountDown).within(() => {
|
cy.getByTestId(epochCountDown).within(() => {
|
||||||
cy.get(epochTitle).should('not.be.empty');
|
cy.get(epochTitle).should('not.be.empty');
|
||||||
cy.get(nextEpochInfo).should('contain.text', 'Next epoch');
|
cy.get(nextEpochInfo, txTimeout).should('contain.text', 'Next epoch');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ import {
|
|||||||
vegaWalletFaucetAssetsWithoutCheck,
|
vegaWalletFaucetAssetsWithoutCheck,
|
||||||
vegaWalletTeardown,
|
vegaWalletTeardown,
|
||||||
} from '../../support/wallet-functions';
|
} from '../../support/wallet-functions';
|
||||||
|
import { aliasGQLQuery } from '@vegaprotocol/cypress';
|
||||||
|
import { chainIdQuery, statisticsQuery } from '@vegaprotocol/mock';
|
||||||
|
|
||||||
const walletContainer = 'aside [data-testid="vega-wallet"]';
|
const walletContainer = 'aside [data-testid="vega-wallet"]';
|
||||||
const walletHeader = '[data-testid="wallet-header"] h1';
|
const walletHeader = '[data-testid="wallet-header"] h1';
|
||||||
@@ -14,10 +16,6 @@ const dialogHeader = 'dialog-title';
|
|||||||
const walletDialogHeader = 'wallet-dialog-title';
|
const walletDialogHeader = 'wallet-dialog-title';
|
||||||
const connectorsList = 'connectors-list';
|
const connectorsList = 'connectors-list';
|
||||||
const dialogCloseBtn = 'dialog-close';
|
const dialogCloseBtn = 'dialog-close';
|
||||||
const restConnectorForm = 'rest-connector-form';
|
|
||||||
const restWallet = '#wallet';
|
|
||||||
const restPassphrase = '#passphrase';
|
|
||||||
const restConnectBtn = '[type="submit"]';
|
|
||||||
const accountNo = 'vega-account-truncated';
|
const accountNo = 'vega-account-truncated';
|
||||||
const currencyTitle = 'currency-title';
|
const currencyTitle = 'currency-title';
|
||||||
const currencyValue = 'currency-value';
|
const currencyValue = 'currency-value';
|
||||||
@@ -69,7 +67,7 @@ context(
|
|||||||
cy.get(dialog).within(() => {
|
cy.get(dialog).within(() => {
|
||||||
cy.getByTestId(walletDialogHeader)
|
cy.getByTestId(walletDialogHeader)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'Connect');
|
.and('have.text', 'Get a Vega wallet');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -77,10 +75,7 @@ context(
|
|||||||
cy.getByTestId(connectorsList).within(() => {
|
cy.getByTestId(connectorsList).within(() => {
|
||||||
cy.getByTestId('connector-jsonRpc')
|
cy.getByTestId('connector-jsonRpc')
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.and('have.text', 'Connect Vega wallet');
|
.and('have.text', 'Use the Desktop App/CLI');
|
||||||
cy.getByTestId('connector-rest')
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Hosted Fairground wallet');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -91,48 +86,14 @@ context(
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('when rest connector form opened', function () {
|
|
||||||
before('click hosted wallet app button', function () {
|
|
||||||
cy.getByTestId(connectorsList).within(() => {
|
|
||||||
cy.getByTestId('connector-rest').click();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
// 0002-WCON-002
|
|
||||||
it('should have wallet field visible', function () {
|
|
||||||
cy.getByTestId(restConnectorForm).within(() => {
|
|
||||||
cy.get(restWallet).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have password field visible', function () {
|
|
||||||
cy.getByTestId(restConnectorForm).within(() => {
|
|
||||||
cy.get(restPassphrase).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have connect button visible', function () {
|
|
||||||
cy.getByTestId(restConnectorForm).within(() => {
|
|
||||||
cy.get(restConnectBtn)
|
|
||||||
.should('be.visible')
|
|
||||||
.and('have.text', 'Connect');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should have close button visible', function () {
|
|
||||||
cy.get(dialog).within(() => {
|
|
||||||
cy.getByTestId(dialogCloseBtn).should('be.visible');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
after('close dialog', function () {
|
|
||||||
cy.getByTestId(dialogCloseBtn).click().should('not.exist');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('when vega wallet connected', function () {
|
describe('when vega wallet connected', function () {
|
||||||
before('connect vega wallet', function () {
|
before('connect vega wallet', function () {
|
||||||
|
cy.mockGQL((req) => {
|
||||||
|
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||||
|
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||||
|
});
|
||||||
cy.visit('/');
|
cy.visit('/');
|
||||||
|
cy.wait('@ChainId');
|
||||||
cy.connectVegaWallet();
|
cy.connectVegaWallet();
|
||||||
vegaWalletTeardown();
|
vegaWalletTeardown();
|
||||||
});
|
});
|
||||||
@@ -315,6 +276,10 @@ context(
|
|||||||
];
|
];
|
||||||
|
|
||||||
before('faucet assets to connected vega wallet', function () {
|
before('faucet assets to connected vega wallet', function () {
|
||||||
|
cy.mockGQL((req) => {
|
||||||
|
aliasGQLQuery(req, 'ChainId', chainIdQuery());
|
||||||
|
aliasGQLQuery(req, 'Statistics', statisticsQuery());
|
||||||
|
});
|
||||||
for (const { id, amount } of assets) {
|
for (const { id, amount } of assets) {
|
||||||
vegaWalletFaucetAssetsWithoutCheck(id, amount, vegaWalletPublicKey);
|
vegaWalletFaucetAssetsWithoutCheck(id, amount, vegaWalletPublicKey);
|
||||||
}
|
}
|
||||||
@@ -339,7 +304,7 @@ context(
|
|||||||
cy.getByTestId(vegaWalletCurrencyTitle)
|
cy.getByTestId(vegaWalletCurrencyTitle)
|
||||||
.contains(name)
|
.contains(name)
|
||||||
.parent()
|
.parent()
|
||||||
.siblings()
|
.siblings(txTimeout)
|
||||||
.should((elementAmount) => {
|
.should((elementAmount) => {
|
||||||
const displayedAmount = parseFloat(elementAmount.text());
|
const displayedAmount = parseFloat(elementAmount.text());
|
||||||
expect(displayedAmount).be.gte(expectedAmount);
|
expect(displayedAmount).be.gte(expectedAmount);
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ export function dissociateFromSecondWalletKey() {
|
|||||||
cy.getByTestId('vega-in-wallet')
|
cy.getByTestId('vega-in-wallet')
|
||||||
.first()
|
.first()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId('eth-wallet-associated-balances')
|
cy.getByTestId('eth-wallet-associated-balances', txTimeout)
|
||||||
.last()
|
.last()
|
||||||
.within(() => {
|
.within(() => {
|
||||||
cy.getByTestId('associated-key')
|
cy.getByTestId('associated-key')
|
||||||
|
|||||||
@@ -232,6 +232,23 @@ export function getDownloadedProposalJsonPath(proposalType: string) {
|
|||||||
return filepath;
|
return filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function validateProposalDetailsDiff(
|
||||||
|
RowName: string,
|
||||||
|
changeType: proposalChangeType,
|
||||||
|
newValue: string,
|
||||||
|
oldValue?: string
|
||||||
|
) {
|
||||||
|
cy.contains(RowName)
|
||||||
|
.parentsUntil(proposalInformationTableRows)
|
||||||
|
.parent()
|
||||||
|
.first()
|
||||||
|
.within(() => {
|
||||||
|
cy.contains(changeType).should('be.visible');
|
||||||
|
cy.contains(newValue).should('be.visible');
|
||||||
|
if (oldValue) cy.contains(oldValue).should('have.class', 'line-through');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function getFormattedTime() {
|
function getFormattedTime() {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const day = now.getDate().toString().padStart(2, '0');
|
const day = now.getDate().toString().padStart(2, '0');
|
||||||
@@ -252,3 +269,8 @@ export enum governanceProposalType {
|
|||||||
FREEFORM = 'Freeform',
|
FREEFORM = 'Freeform',
|
||||||
RAW = 'raw proposal',
|
RAW = 'raw proposal',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum proposalChangeType {
|
||||||
|
UPDATED = 'Updated',
|
||||||
|
ADDED = 'Added',
|
||||||
|
}
|
||||||
|
|||||||
@@ -211,6 +211,143 @@ export function createNewMarketProposalTxBody(): ProposalSubmissionBody {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Requires cy.createMarket() to be run to set up parent market
|
||||||
|
export function createSuccessorMarketProposalTxBody(
|
||||||
|
parentMarketId: string
|
||||||
|
): ProposalSubmissionBody {
|
||||||
|
const MIN_CLOSE_SEC = 10000;
|
||||||
|
const MIN_ENACT_SEC = 10000;
|
||||||
|
|
||||||
|
const closingDate = addSeconds(new Date(), MIN_CLOSE_SEC);
|
||||||
|
const enactmentDate = addSeconds(closingDate, MIN_ENACT_SEC);
|
||||||
|
const closingTimestamp = millisecondsToSeconds(closingDate.getTime());
|
||||||
|
const enactmentTimestamp = millisecondsToSeconds(enactmentDate.getTime());
|
||||||
|
return {
|
||||||
|
proposalSubmission: {
|
||||||
|
rationale: {
|
||||||
|
title: 'Test successor market proposal details',
|
||||||
|
description: 'E2E test for successor market',
|
||||||
|
},
|
||||||
|
terms: {
|
||||||
|
newMarket: {
|
||||||
|
changes: {
|
||||||
|
decimalPlaces: '5',
|
||||||
|
positionDecimalPlaces: '5',
|
||||||
|
linearSlippageFactor: '0.001',
|
||||||
|
quadraticSlippageFactor: '0',
|
||||||
|
lpPriceRange: '10',
|
||||||
|
instrument: {
|
||||||
|
name: 'Token test market',
|
||||||
|
code: 'TEST.24h',
|
||||||
|
future: {
|
||||||
|
settlementAsset:
|
||||||
|
'816af99af60d684502a40824758f6b5377e6af48e50a9ee8ef478ecb879ea8bc',
|
||||||
|
quoteName: 'fUSDC',
|
||||||
|
dataSourceSpecForSettlementData: {
|
||||||
|
external: {
|
||||||
|
oracle: {
|
||||||
|
signers: [
|
||||||
|
{
|
||||||
|
pubKey: {
|
||||||
|
key: '70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
key: {
|
||||||
|
name: 'prices.BTC.value',
|
||||||
|
type: 'TYPE_INTEGER' as const,
|
||||||
|
numberDecimalPlaces: '0',
|
||||||
|
},
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
operator: 'OPERATOR_GREATER_THAN' as const,
|
||||||
|
value: '0',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dataSourceSpecForTradingTermination: {
|
||||||
|
external: {
|
||||||
|
oracle: {
|
||||||
|
signers: [
|
||||||
|
{
|
||||||
|
pubKey: {
|
||||||
|
key: '70d14a321e02e71992fd115563df765000ccc4775cbe71a0e2f9ff5a3b9dc680',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
key: {
|
||||||
|
name: 'trading.terminated.ETH5',
|
||||||
|
type: 'TYPE_BOOLEAN' as const,
|
||||||
|
},
|
||||||
|
conditions: [
|
||||||
|
{
|
||||||
|
operator: 'OPERATOR_EQUALS' as const,
|
||||||
|
value: 'true',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
dataSourceSpecBinding: {
|
||||||
|
settlementDataProperty: 'prices.BTC.value',
|
||||||
|
tradingTerminationProperty: 'trading.terminated.ETH5',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
metadata: [
|
||||||
|
'sector:food',
|
||||||
|
'sector:materials',
|
||||||
|
'source:docs.vega.xyz',
|
||||||
|
],
|
||||||
|
priceMonitoringParameters: {
|
||||||
|
triggers: [
|
||||||
|
{
|
||||||
|
horizon: '43200',
|
||||||
|
probability: '0.9999999',
|
||||||
|
auctionExtension: '600',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
liquidityMonitoringParameters: {
|
||||||
|
targetStakeParameters: {
|
||||||
|
timeWindow: '3600',
|
||||||
|
scalingFactor: 10,
|
||||||
|
},
|
||||||
|
triggeringRatio: '0.7',
|
||||||
|
auctionExtension: '1',
|
||||||
|
},
|
||||||
|
logNormal: {
|
||||||
|
tau: 0.0001140771161,
|
||||||
|
riskAversionParameter: 0.01,
|
||||||
|
params: {
|
||||||
|
mu: 0,
|
||||||
|
r: 0.016,
|
||||||
|
sigma: 0.5,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
successor: {
|
||||||
|
parentMarketId: parentMarketId,
|
||||||
|
insurancePoolFraction: '0.75',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
closingTimestamp,
|
||||||
|
enactmentTimestamp,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
export function mockNetworkUpgradeProposal() {
|
export function mockNetworkUpgradeProposal() {
|
||||||
cy.mockGQL((req) => {
|
cy.mockGQL((req) => {
|
||||||
aliasGQLQuery(req, 'Nodes', nodeData);
|
aliasGQLQuery(req, 'Nodes', nodeData);
|
||||||
|
|||||||
@@ -78,13 +78,22 @@ export function stakingPageAssociateTokens(
|
|||||||
}
|
}
|
||||||
cy.get(tokenAmountInputBox, epochTimeout).type(amount);
|
cy.get(tokenAmountInputBox, epochTimeout).type(amount);
|
||||||
if (approve) {
|
if (approve) {
|
||||||
cy.get(tokenInputApprove, txTimeout).should('be.enabled').click();
|
cy.getByTestId('wallet-associate').then((walletAssociateField) => {
|
||||||
cy.contains('Approve $VEGA Tokens for staking on Vega').should(
|
if (
|
||||||
'be.visible'
|
walletAssociateField.find('[data-testid="token-input-approve-button"]')
|
||||||
);
|
.length
|
||||||
cy.contains('Approve $VEGA Tokens for staking on Vega', txTimeout).should(
|
) {
|
||||||
'not.exist'
|
cy.get(tokenInputApprove, txTimeout).should('be.enabled').click();
|
||||||
);
|
cy.contains(
|
||||||
|
'Approve $VEGA Tokens for staking on Vega',
|
||||||
|
txTimeout
|
||||||
|
).should('be.visible');
|
||||||
|
cy.contains(
|
||||||
|
'Approve $VEGA Tokens for staking on Vega',
|
||||||
|
txTimeout
|
||||||
|
).should('not.exist');
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
cy.get(tokenSubmitButton, txTimeout).should('be.enabled').click();
|
cy.get(tokenSubmitButton, txTimeout).should('be.enabled').click();
|
||||||
|
|
||||||
@@ -173,8 +182,9 @@ export function clickOnValidatorFromList(
|
|||||||
} else {
|
} else {
|
||||||
cy.get(`[row-id="${validatorNumber}"]`)
|
cy.get(`[row-id="${validatorNumber}"]`)
|
||||||
.should('be.visible')
|
.should('be.visible')
|
||||||
.find(stakeValidatorListName)
|
.first()
|
||||||
.click();
|
.as('validatorOnList');
|
||||||
|
cy.get('@validatorOnList').click();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","STAGNET1":"https:
|
|||||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||||
NX_VEGA_WALLET_URL=http://localhost:1789
|
NX_VEGA_WALLET_URL=http://localhost:1789
|
||||||
NX_VEGA_EXPLORER_URL=https://explorer.stagnet1.vega.rocks
|
NX_VEGA_EXPLORER_URL=https://explorer.stagnet1.vega.rocks
|
||||||
|
NX_ORACLE_PROOFS_URL=https://raw.githubusercontent.com/vegaprotocol/well-known/main/__generated__/oracle-proofs.json
|
||||||
|
|
||||||
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
|
||||||
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet
|
||||||
@@ -18,6 +19,13 @@ NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/annou
|
|||||||
NX_WALLETCONNECT_PROJECT_ID=fe8091dc35738863e509fc4947525c72
|
NX_WALLETCONNECT_PROJECT_ID=fe8091dc35738863e509fc4947525c72
|
||||||
NX_VEGA_REST_URL=https://api.n00.stagnet1.vega.xyz/api/v2/
|
NX_VEGA_REST_URL=https://api.n00.stagnet1.vega.xyz/api/v2/
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.n01.stagnet1.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet1.vega.xyz/websocket
|
||||||
|
|
||||||
|
|
||||||
#Test configuration variables
|
#Test configuration variables
|
||||||
CYPRESS_FAIRGROUND=false
|
CYPRESS_FAIRGROUND=false
|
||||||
LC_ALL="en_US.UTF-8"
|
LC_ALL="en_US.UTF-8"
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=true
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ NX_DELEGATIONS_PAGINATION=50
|
|||||||
NX_TRANCHES_SERVICE_URL=https://tranches-stagnet1-k8s.ops.vega.xyz
|
NX_TRANCHES_SERVICE_URL=https://tranches-stagnet1-k8s.ops.vega.xyz
|
||||||
NX_VEGA_REST_URL=http://localhost:3008/api/v2/
|
NX_VEGA_REST_URL=http://localhost:3008/api/v2/
|
||||||
|
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=http://localhost:26617
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
|
||||||
|
|
||||||
#Test configuration variables
|
#Test configuration variables
|
||||||
CYPRESS_FAIRGROUND=false
|
CYPRESS_FAIRGROUND=false
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=false
|
||||||
|
|||||||
@@ -13,3 +13,12 @@ NX_TRANCHES_SERVICE_URL=https://tranches-devnet1-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/fairground/announcements.json
|
||||||
NX_VEGA_REST_URL=https://api.n00.devnet1.vega.xyz/api/v2/
|
NX_VEGA_REST_URL=https://api.n00.devnet1.vega.xyz/api/v2/
|
||||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||||
|
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.devnet1.vega.xyz/
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.devnet1.vega.xyz/websocket
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=true
|
||||||
|
|||||||
@@ -14,3 +14,11 @@ NX_DELEGATIONS_PAGINATION=50
|
|||||||
NX_TRANCHES_SERVICE_URL=https://tranches-mainnet-k8s.ops.vega.xyz
|
NX_TRANCHES_SERVICE_URL=https://tranches-mainnet-k8s.ops.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_REST_URL=https://api.vega.community/api/v2/
|
NX_VEGA_REST_URL=https://api.vega.community/api/v2/
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://be.vega.community
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.vega.community/websocket
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=false
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# App configuration variables
|
# App configuration variables
|
||||||
NX_VEGA_ENV=MAINNET-MIRROR
|
NX_VEGA_ENV=MAINNET_MIRROR
|
||||||
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
NX_VEGA_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/mainnet-mirror/vegawallet-mainnet-mirror.toml
|
||||||
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
NX_VEGA_URL=https://api.mainnet-mirror.vega.rocks/graphql
|
||||||
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz","MAINNET-MIRROR":"https://governance.mainnet-mirror.vega.rocks","STAGNET1":"https://trading.stagnet1.vega.rocks"}'
|
NX_VEGA_NETWORKS='{"DEVNET":"https://dev.governance.vega.xyz","TESTNET":"https://governance.fairground.wtf","MAINNET":"https://governance.vega.xyz","MAINNET_MIRROR":"https://governance.mainnet-mirror.vega.rocks","STAGNET1":"https://trading.stagnet1.vega.rocks"}'
|
||||||
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
|
||||||
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
|
||||||
@@ -13,3 +13,11 @@ NX_DELEGATIONS_PAGINATION=50
|
|||||||
NX_TRANCHES_SERVICE_URL=https://tranches-mainnet-mirror-k8s.ops.vega.xyz
|
NX_TRANCHES_SERVICE_URL=https://tranches-mainnet-mirror-k8s.ops.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_REST_URL=https://api.mainnet-mirror.vega.rocks/api/v2/
|
NX_VEGA_REST_URL=https://api.mainnet-mirror.vega.rocks/api/v2/
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://be.mainnet-mirror.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.mainnet-mirror.vega.rocks/websocket
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=false
|
||||||
|
|||||||
@@ -9,3 +9,12 @@ NX_DELEGATIONS_PAGINATION=50
|
|||||||
NX_TRANCHES_SERVICE_URL=https://tranches-stagnet1-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/fairground/announcements.json
|
||||||
NX_VEGA_REST_URL=https://api.n00.stagnet1.vega.xyz/api/v2/
|
NX_VEGA_REST_URL=https://api.n00.stagnet1.vega.xyz/api/v2/
|
||||||
|
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.n01.stagnet1.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n01.stagnet1.vega.xyz/websocket
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=true
|
||||||
|
|||||||
@@ -14,3 +14,12 @@ NX_TRANCHES_SERVICE_URL=https://tranches-testnet-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/fairground/announcements.json
|
||||||
NX_VEGA_REST_URL=https://api.n07.testnet.vega.xyz/api/v2/
|
NX_VEGA_REST_URL=https://api.n07.testnet.vega.xyz/api/v2/
|
||||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||||
|
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.testnet.vega.xyz
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.testnet.vega.xyz/websocket
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=true
|
||||||
|
|||||||
@@ -11,3 +11,12 @@ NX_VEGA_EXPLORER_URL=https://explorer.validators-testnet.vega.rocks/
|
|||||||
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_REST_URL=https://api-validators-testnet.vega.rocks/api/v2/
|
NX_VEGA_REST_URL=https://api-validators-testnet.vega.rocks/api/v2/
|
||||||
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
NX_SENTRY_DSN=https://4b8c8a8ba07742648aa4dfe1b8d17e40@o286262.ingest.sentry.io/5882996
|
||||||
|
|
||||||
|
NX_CHROME_EXTENSION_URL=https://chrome.google.com/webstore/detail/vega-wallet-fairground/nmmjkiafpmphlikhefgjbblebfgclikn
|
||||||
|
NX_MOZILLA_EXTENSION_URL=https://addons.mozilla.org/pl/firefox/addon/vega-wallet
|
||||||
|
|
||||||
|
NX_TENDERMINT_URL=https://tm.be.validators-testnet.vega.rocks
|
||||||
|
NX_TENDERMINT_WEBSOCKET_URL=wss://be.validators-testnet.vega.
|
||||||
|
|
||||||
|
# Cosmic elevator flags
|
||||||
|
NX_SUCCESSOR_MARKETS=false
|
||||||
|
|||||||
@@ -2,14 +2,13 @@ import * as Sentry from '@sentry/react';
|
|||||||
import { toBigNum } from '@vegaprotocol/utils';
|
import { toBigNum } from '@vegaprotocol/utils';
|
||||||
import { Splash } from '@vegaprotocol/ui-toolkit';
|
import { Splash } from '@vegaprotocol/ui-toolkit';
|
||||||
import { useVegaWallet, useEagerConnect } from '@vegaprotocol/wallet';
|
import { useVegaWallet, useEagerConnect } from '@vegaprotocol/wallet';
|
||||||
import { useEnvironment } from '@vegaprotocol/environment';
|
import { FLAGS, useEnvironment } from '@vegaprotocol/environment';
|
||||||
import { useWeb3React } from '@web3-react/core';
|
import { useWeb3React } from '@web3-react/core';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
import { SplashError } from './components/splash-error';
|
import { SplashError } from './components/splash-error';
|
||||||
import { SplashLoader } from './components/splash-loader';
|
import { SplashLoader } from './components/splash-loader';
|
||||||
import { Flags } from './config';
|
|
||||||
import {
|
import {
|
||||||
AppStateActionType,
|
AppStateActionType,
|
||||||
useAppState,
|
useAppState,
|
||||||
@@ -80,7 +79,7 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!Flags.NETWORK_DOWN) {
|
if (!FLAGS.GOVERNANCE_NETWORK_DOWN) {
|
||||||
run();
|
run();
|
||||||
}
|
}
|
||||||
}, [token, appDispatch, staking, vesting]);
|
}, [token, appDispatch, staking, vesting]);
|
||||||
@@ -148,7 +147,7 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Only begin polling if network limits flag is set, as this is a new API not yet on mainnet 7/3/22
|
// Only begin polling if network limits flag is set, as this is a new API not yet on mainnet 7/3/22
|
||||||
if (Flags.NETWORK_LIMITS) {
|
if (FLAGS.GOVERNANCE_NETWORK_LIMITS) {
|
||||||
getNetworkLimits();
|
getNetworkLimits();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -157,7 +156,7 @@ export const AppLoader = ({ children }: { children: React.ReactElement }) => {
|
|||||||
};
|
};
|
||||||
}, [appDispatch, VEGA_URL, t]);
|
}, [appDispatch, VEGA_URL, t]);
|
||||||
|
|
||||||
if (Flags.NETWORK_DOWN) {
|
if (FLAGS.GOVERNANCE_NETWORK_DOWN) {
|
||||||
return (
|
return (
|
||||||
<Splash>
|
<Splash>
|
||||||
<SplashError />
|
<SplashError />
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
export * from './json-diff';
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
import { render, screen, cleanup } from '@testing-library/react';
|
||||||
|
import { JsonDiff } from './json-diff';
|
||||||
|
|
||||||
|
describe('JsonDiff', () => {
|
||||||
|
afterEach(cleanup);
|
||||||
|
|
||||||
|
it('renders without crashing', () => {
|
||||||
|
render(<JsonDiff left={{}} right={{}} />);
|
||||||
|
expect(screen.getByTestId('json-diff')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('shows the correct message when both objects are identical', () => {
|
||||||
|
render(<JsonDiff left={{}} right={{}} />);
|
||||||
|
expect(screen.getByText('Data is identical')).toBeInTheDocument();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('does not show the "identical" message when both objects are not identical', () => {
|
||||||
|
render(
|
||||||
|
<JsonDiff
|
||||||
|
left={{
|
||||||
|
name: 'test',
|
||||||
|
}}
|
||||||
|
right={{
|
||||||
|
name: 'test2',
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
expect(screen.queryByText('Data is identical')).not.toBeInTheDocument();
|
||||||
|
});
|
||||||
|
});
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
import { useState, useEffect } from 'react';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { formatters, create } from 'jsondiffpatch';
|
||||||
|
import 'jsondiffpatch/dist/formatters-styles/html.css';
|
||||||
|
import 'jsondiffpatch/dist/formatters-styles/annotated.css';
|
||||||
|
|
||||||
|
export type JsonValue =
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| boolean
|
||||||
|
| null
|
||||||
|
| JsonValue[]
|
||||||
|
| { [key: string]: JsonValue };
|
||||||
|
|
||||||
|
interface JsonDiffProps {
|
||||||
|
left: JsonValue;
|
||||||
|
right: JsonValue;
|
||||||
|
objectHash?: (obj: unknown) => string | undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const JsonDiff = ({ right, left, objectHash }: JsonDiffProps) => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [html, setHtml] = useState<string | undefined>();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const delta = create({
|
||||||
|
objectHash,
|
||||||
|
}).diff(left, right);
|
||||||
|
|
||||||
|
if (delta) {
|
||||||
|
const deltaHtml = formatters.html.format(delta, left);
|
||||||
|
|
||||||
|
formatters.html.hideUnchanged();
|
||||||
|
|
||||||
|
setHtml(deltaHtml);
|
||||||
|
} else {
|
||||||
|
setHtml(undefined);
|
||||||
|
}
|
||||||
|
}, [right, left, objectHash]);
|
||||||
|
|
||||||
|
return html ? (
|
||||||
|
<div data-testid="json-diff" dangerouslySetInnerHTML={{ __html: html }} />
|
||||||
|
) : (
|
||||||
|
<p data-testid="json-diff">{t('dataIsIdentical')}</p>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -18,6 +18,7 @@ import { VegaWallet } from '../vega-wallet';
|
|||||||
import { useLocation, useMatch } from 'react-router-dom';
|
import { useLocation, useMatch } from 'react-router-dom';
|
||||||
import { useEffect } from 'react';
|
import { useEffect } from 'react';
|
||||||
import { useTelemetryDialog } from '../telemetry-dialog/telemetry-dialog';
|
import { useTelemetryDialog } from '../telemetry-dialog/telemetry-dialog';
|
||||||
|
import { ProtocolUpgradeCountdown } from '@vegaprotocol/proposals';
|
||||||
|
|
||||||
export const SettingsLink = () => {
|
export const SettingsLink = () => {
|
||||||
const { open, isOpen, close } = useTelemetryDialog();
|
const { open, isOpen, close } = useTelemetryDialog();
|
||||||
@@ -61,7 +62,12 @@ export const Nav = ({ theme }: Pick<NavigationProps, 'theme'>) => {
|
|||||||
appName="Governance"
|
appName="Governance"
|
||||||
theme={theme}
|
theme={theme}
|
||||||
breakpoints={[458, 959]}
|
breakpoints={[458, 959]}
|
||||||
actions={<SettingsLink />}
|
actions={
|
||||||
|
<>
|
||||||
|
<SettingsLink />
|
||||||
|
<ProtocolUpgradeCountdown />
|
||||||
|
</>
|
||||||
|
}
|
||||||
>
|
>
|
||||||
<NavigationList
|
<NavigationList
|
||||||
className="[.drawer-content_&]:border-b [.drawer-content_&]:border-b-vega-light-200 dark:[.drawer-content_&]:border-b-vega-dark-200 [.drawer-content_&]:pb-8 [.drawer-content_&]:mb-2"
|
className="[.drawer-content_&]:border-b [.drawer-content_&]:border-b-vega-light-200 dark:[.drawer-content_&]:border-b-vega-dark-200 [.drawer-content_&]:pb-8 [.drawer-content_&]:mb-2"
|
||||||
|
|||||||
@@ -4,7 +4,12 @@ import type { ReactNode } from 'react';
|
|||||||
import { AnnouncementBanner } from '@vegaprotocol/announcements';
|
import { AnnouncementBanner } from '@vegaprotocol/announcements';
|
||||||
import { Nav } from '../nav';
|
import { Nav } from '../nav';
|
||||||
import { Networks, useEnvironment } from '@vegaprotocol/environment';
|
import { Networks, useEnvironment } from '@vegaprotocol/environment';
|
||||||
import React from 'react';
|
import {
|
||||||
|
ProtocolUpgradeCountdownMode,
|
||||||
|
ProtocolUpgradeInProgressNotification,
|
||||||
|
ProtocolUpgradeProposalNotification,
|
||||||
|
} from '@vegaprotocol/proposals';
|
||||||
|
import { ViewingAsBanner } from '@vegaprotocol/ui-toolkit';
|
||||||
|
|
||||||
interface AppLayoutProps {
|
interface AppLayoutProps {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
@@ -31,8 +36,24 @@ export const AppLayout = ({ children }: AppLayoutProps) => {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Nav theme={VEGA_ENV === Networks.TESTNET ? 'yellow' : 'dark'} />
|
<Nav theme={VEGA_ENV === Networks.TESTNET ? 'yellow' : 'dark'} />
|
||||||
|
<NotificationsContainer />
|
||||||
</div>
|
</div>
|
||||||
<div className={AppLayoutClasses}>{children}</div>
|
<div className={AppLayoutClasses}>{children}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const NotificationsContainer = () => {
|
||||||
|
const { isReadOnly, pubKey, disconnect } = useVegaWallet();
|
||||||
|
return (
|
||||||
|
<div data-testid="banners">
|
||||||
|
<ProtocolUpgradeProposalNotification
|
||||||
|
mode={ProtocolUpgradeCountdownMode.IN_ESTIMATED_TIME_REMAINING}
|
||||||
|
/>
|
||||||
|
<ProtocolUpgradeInProgressNotification />
|
||||||
|
{isReadOnly ? (
|
||||||
|
<ViewingAsBanner pubKey={pubKey} disconnect={disconnect} />
|
||||||
|
) : null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
import { ViewingAsBanner } from '@vegaprotocol/ui-toolkit';
|
|
||||||
import { useVegaWallet } from '@vegaprotocol/wallet';
|
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
export interface TemplateSidebarProps {
|
export interface TemplateSidebarProps {
|
||||||
@@ -8,24 +6,18 @@ export interface TemplateSidebarProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {
|
export function TemplateSidebar({ children, sidebar }: TemplateSidebarProps) {
|
||||||
const { isReadOnly, pubKey, disconnect } = useVegaWallet();
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="w-full border-b border-neutral-700 lg:grid lg:grid-rows-[1fr] lg:grid-cols-[1fr_450px]">
|
||||||
{isReadOnly ? (
|
<main className="max-w-[100vw] col-start-1 p-4 overflow-auto">
|
||||||
<ViewingAsBanner pubKey={pubKey} disconnect={disconnect} />
|
{children}
|
||||||
) : null}
|
</main>
|
||||||
<div className="w-full border-b border-neutral-700 lg:grid lg:grid-rows-[1fr] lg:grid-cols-[1fr_450px]">
|
<aside className="col-start-2 row-start-1 row-span-2 hidden lg:block p-4 bg-banner bg-contain border-l border-neutral-700">
|
||||||
<main className="max-w-[100vw] col-start-1 p-4 overflow-auto">
|
{sidebar.map((Component, i) => (
|
||||||
{children}
|
<section className="mb-4 last:mb-0" key={i}>
|
||||||
</main>
|
{Component}
|
||||||
<aside className="col-start-2 row-start-1 row-span-2 hidden lg:block p-4 bg-banner bg-contain border-l border-neutral-700">
|
</section>
|
||||||
{sidebar.map((Component, i) => (
|
))}
|
||||||
<section className="mb-4 last:mb-0" key={i}>
|
</aside>
|
||||||
{Component}
|
</div>
|
||||||
</section>
|
|
||||||
))}
|
|
||||||
</aside>
|
|
||||||
</div>
|
|
||||||
</>
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
import { VegaConnectDialog, VegaManageDialog } from '@vegaprotocol/wallet';
|
import {
|
||||||
|
VegaConnectDialog,
|
||||||
|
VegaManageDialog,
|
||||||
|
ViewAsDialog,
|
||||||
|
} from '@vegaprotocol/wallet';
|
||||||
import {
|
import {
|
||||||
AppStateActionType,
|
AppStateActionType,
|
||||||
useAppState,
|
useAppState,
|
||||||
@@ -25,6 +29,8 @@ export const VegaWalletDialogs = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<ViewAsDialog connector={Connectors.view} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
import { Link } from '@vegaprotocol/ui-toolkit';
|
|
||||||
import { useTranslation } from 'react-i18next';
|
|
||||||
import { ExternalLinks } from '@vegaprotocol/environment';
|
|
||||||
|
|
||||||
export const DownloadWalletPrompt = () => {
|
|
||||||
const { t } = useTranslation();
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<h3 className="mt-4 mb-2">{t('getWallet')}</h3>
|
|
||||||
<p>
|
|
||||||
<Link className="text-neutral-500" href={ExternalLinks.VEGA_WALLET_URL}>
|
|
||||||
{t('getWalletLink')}
|
|
||||||
</Link>
|
|
||||||
</p>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
};
|
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
import { ButtonLink, Link } from '@vegaprotocol/ui-toolkit';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { ExternalLinks } from '@vegaprotocol/environment';
|
||||||
|
import { useViewAsDialog } from '@vegaprotocol/wallet';
|
||||||
|
|
||||||
|
export const VegaWalletPrompt = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const setViewAsDialog = useViewAsDialog((state) => state.setOpen);
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h3 className="mt-4 mb-2">{t('getWallet')}</h3>
|
||||||
|
<div className="flex flex-row gap-4">
|
||||||
|
<Link className="text-neutral-500" href={ExternalLinks.VEGA_WALLET_URL}>
|
||||||
|
{t('getWalletLink')}
|
||||||
|
</Link>
|
||||||
|
<ButtonLink
|
||||||
|
className="text-neutral-500"
|
||||||
|
data-testid="view-as-user"
|
||||||
|
onClick={() => setViewAsDialog(true)}
|
||||||
|
>
|
||||||
|
{t('viewAsParty')}
|
||||||
|
</ButtonLink>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -20,7 +20,7 @@ import {
|
|||||||
WalletCardHeader,
|
WalletCardHeader,
|
||||||
WalletCardRow,
|
WalletCardRow,
|
||||||
} from '../wallet-card';
|
} from '../wallet-card';
|
||||||
import { DownloadWalletPrompt } from './download-wallet-prompt';
|
import { VegaWalletPrompt } from './vega-wallet-prompt';
|
||||||
import { usePollForDelegations } from './hooks';
|
import { usePollForDelegations } from './hooks';
|
||||||
import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
|
import { useVegaWallet, useVegaWalletDialogStore } from '@vegaprotocol/wallet';
|
||||||
import { Button, ButtonLink } from '@vegaprotocol/ui-toolkit';
|
import { Button, ButtonLink } from '@vegaprotocol/ui-toolkit';
|
||||||
@@ -85,7 +85,7 @@ const VegaWalletNotConnected = () => {
|
|||||||
>
|
>
|
||||||
{t('connectVegaWalletToUseAssociated')}
|
{t('connectVegaWalletToUseAssociated')}
|
||||||
</Button>
|
</Button>
|
||||||
<DownloadWalletPrompt />
|
<VegaWalletPrompt />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -25,6 +25,10 @@ export const ContractAddresses: {
|
|||||||
claimAddress: customClaimAddress ?? '0x0',
|
claimAddress: customClaimAddress ?? '0x0',
|
||||||
lockedAddress: customLockedAddress ?? '0x0',
|
lockedAddress: customLockedAddress ?? '0x0',
|
||||||
},
|
},
|
||||||
|
MAINNET_MIRROR: {
|
||||||
|
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
||||||
|
lockedAddress: '0x0', // TODO not deployed to this env
|
||||||
|
},
|
||||||
DEVNET: {
|
DEVNET: {
|
||||||
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
claimAddress: '0x8Cef746ab7C83B61F6461cC92882bD61AB65a994', // TODO not deployed to this env, but random address so app doesn't error
|
||||||
lockedAddress: '0x0', // TODO not deployed to this env
|
lockedAddress: '0x0', // TODO not deployed to this env
|
||||||
@@ -63,12 +67,6 @@ export const ENV = {
|
|||||||
localProviderUrl: windowOrDefault('NX_LOCAL_PROVIDER_URL'),
|
localProviderUrl: windowOrDefault('NX_LOCAL_PROVIDER_URL'),
|
||||||
delegationsPagination: windowOrDefault('NX_DELEGATIONS_PAGINATION'),
|
delegationsPagination: windowOrDefault('NX_DELEGATIONS_PAGINATION'),
|
||||||
rest: windowOrDefault('NX_VEGA_REST_URL'),
|
rest: windowOrDefault('NX_VEGA_REST_URL'),
|
||||||
flags: {
|
|
||||||
NETWORK_DOWN: TRUTHY.includes(windowOrDefault('NX_NETWORK_DOWN')),
|
|
||||||
MOCK: TRUTHY.includes(windowOrDefault('NX_MOCKED')),
|
|
||||||
FAIRGROUND: TRUTHY.includes(windowOrDefault('NX_FAIRGROUND')),
|
|
||||||
NETWORK_LIMITS: TRUTHY.includes(windowOrDefault('NX_NETWORK_LIMITS')),
|
|
||||||
},
|
|
||||||
addresses:
|
addresses:
|
||||||
ContractAddresses[(envName === 'local' ? 'CUSTOM' : envName) as Networks],
|
ContractAddresses[(envName === 'local' ? 'CUSTOM' : envName) as Networks],
|
||||||
};
|
};
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user