Compare commits
25
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bf519fbfaa | ||
|
|
c7bc64abfb | ||
|
|
7f60485c59 | ||
|
|
c9c240cb29 | ||
|
|
64aa39fe4b | ||
|
|
485c609791 | ||
|
|
61457bc24d | ||
|
|
2217925285 | ||
|
|
28fe7458ca | ||
|
|
2cb88624f3 | ||
|
|
d2ae780996 | ||
|
|
bd129f1229 | ||
|
|
f3cd2db1ce | ||
|
|
418ea41e22 | ||
|
|
bcc1c8a474 | ||
|
|
496fdee10e | ||
|
|
c8fc91a3bd | ||
|
|
48cccc2678 | ||
|
|
9d66eeae51 | ||
|
|
7ab20d07f9 | ||
|
|
b0aa1b8a3e | ||
|
|
13ffe8a8d0 | ||
|
|
01420c56ff | ||
|
|
15bb7b94ad | ||
|
|
d65ef297a9 |
@@ -98,7 +98,7 @@ jobs:
|
||||
while read -r file; do
|
||||
mv "${file}" "$(echo ${file} | sed 's|:|-|g')"
|
||||
done< <(find /home/runner/.vegacapsule/testnet/logs -type f)
|
||||
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: ${{ always() }}
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Vega Explorer E2E tests
|
||||
|
||||
To run the UI automation tests with Vega Capsule, run:
|
||||
|
||||
```bash
|
||||
yarn nx run explorer-e2e:e2e
|
||||
```
|
||||
|
||||
To open Cypress and run in interactive mode, run:
|
||||
|
||||
```bash
|
||||
yarn nx run explorer-e2e:e2e --watch
|
||||
```
|
||||
|
||||
## Vega Capsule Setup
|
||||
|
||||
The e2e tests run against a locally running instance of the Vega network, managed and controlled by [Vega Capsule](https://github.com/vegaprotocol/vegacapsule). Vega Capsule will:
|
||||
|
||||
- Bootstrap and start up a Vega network
|
||||
- Start up [Ganache](https://trufflesuite.com/ganache/) for a local Ethereum network
|
||||
- Install the required Vega smart contracts
|
||||
- Set up DataNodes with a running GraphQL and REST APIs.
|
||||
|
||||
Refer to the [Vega Capsule readme](https://github.com/vegaprotocol/vegacapsule#readme) for setting up and running Capsule. You will need [Go 1.19 or later](https://go.dev/doc/install) and [Docker](https://docs.docker.com/get-docker/) installed.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
- You may need to run `vegacapsule nodes unsafe-reset-all` to get a clean network state
|
||||
|
||||
## Vega Wallet Setup
|
||||
|
||||
Start by [downloading the Vega wallet software here](https://github.com/vegaprotocol/vega/releases).
|
||||
|
||||
You can then refer to (or run) `vegacapsule/setup-vegawallet.sh`. This will initialise and configure your wallet to have the correct public keys and network config to run against capsule.
|
||||
@@ -351,7 +351,7 @@
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "129999.45",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "82197.14332850199619251",
|
||||
"locked_amount": "81189.00181109020553229",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129999.45",
|
||||
@@ -417,7 +417,7 @@
|
||||
"tranche_end": "2023-09-03T00:00:00.000Z",
|
||||
"total_added": "52600",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "36530.92183536276314",
|
||||
"locked_amount": "35918.4961123794978",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "2600",
|
||||
@@ -590,7 +590,7 @@
|
||||
"tranche_end": "2023-09-17T00:00:00.000Z",
|
||||
"total_added": "5000",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "3664.301908929477",
|
||||
"locked_amount": "3606.086536022324",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "5000",
|
||||
@@ -801,7 +801,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "97499.58",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "23849.9422179213040896852",
|
||||
"locked_amount": "22861.0493019706346484468",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "97499.58",
|
||||
@@ -834,7 +834,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "135173.4239508",
|
||||
"total_removed": "98230.390980249184455396",
|
||||
"locked_amount": "32598.75349114788455213696028",
|
||||
"locked_amount": "31247.107600282979940660298716",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "135173.4239508",
|
||||
@@ -880,7 +880,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "32499.86",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "10033.258824607458562468",
|
||||
"locked_amount": "9617.248652134231053772",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "32499.86",
|
||||
@@ -913,7 +913,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "10833.29",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "3265.7283869706566541744",
|
||||
"locked_amount": "3130.321112697780704066",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "10833.29",
|
||||
@@ -946,7 +946,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "22749.93",
|
||||
"total_removed": "0",
|
||||
"locked_amount": "12208.022097758508156912",
|
||||
"locked_amount": "11701.839463857984444507",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "6500",
|
||||
@@ -1084,8 +1084,8 @@
|
||||
"tranche_start": "2022-11-01T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-01T00:00:00.000Z",
|
||||
"total_added": "22500",
|
||||
"total_removed": "2056.3876419",
|
||||
"locked_amount": "15973.015941528543",
|
||||
"total_removed": "2310.007577475",
|
||||
"locked_amount": "15444.7355547882135",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "7500",
|
||||
@@ -1109,6 +1109,11 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x1d4aa474e9a6de0e86702e16f621eb46d117a5d072049ade2860ca8301d6cf02"
|
||||
},
|
||||
{
|
||||
"amount": "253.619935575",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xcc41ce33de4f693230c5ca45acba37c826147157c0ab86e7cbaf235652c9cfad"
|
||||
},
|
||||
{
|
||||
"amount": "442.132826925",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -1144,6 +1149,12 @@
|
||||
"tranche_id": 33,
|
||||
"tx": "0x1d4aa474e9a6de0e86702e16f621eb46d117a5d072049ade2860ca8301d6cf02"
|
||||
},
|
||||
{
|
||||
"amount": "253.619935575",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 33,
|
||||
"tx": "0xcc41ce33de4f693230c5ca45acba37c826147157c0ab86e7cbaf235652c9cfad"
|
||||
},
|
||||
{
|
||||
"amount": "442.132826925",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -1158,8 +1169,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "7500",
|
||||
"withdrawn_tokens": "2056.3876419",
|
||||
"remaining_tokens": "5443.6123581"
|
||||
"withdrawn_tokens": "2310.007577475",
|
||||
"remaining_tokens": "5189.992422525"
|
||||
},
|
||||
{
|
||||
"address": "0x2539b51EbDE65a75672aBcfE9439a706a99D18D1",
|
||||
@@ -1184,7 +1195,7 @@
|
||||
"tranche_end": "2023-06-02T00:00:00.000Z",
|
||||
"total_added": "1939928.38",
|
||||
"total_removed": "928642.9598472029154",
|
||||
"locked_amount": "853005.319889025269684887",
|
||||
"locked_amount": "830418.589078051136755202",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1852091.69",
|
||||
@@ -1536,7 +1547,7 @@
|
||||
"tranche_end": "2023-02-01T00:00:00.000Z",
|
||||
"total_added": "42500",
|
||||
"total_removed": "22452.0135114",
|
||||
"locked_amount": "9122.264524204912225",
|
||||
"locked_amount": "8140.6710761372795",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "12500",
|
||||
@@ -31979,7 +31990,7 @@
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "3732368.4671",
|
||||
"total_removed": "428705.3729302523069",
|
||||
"locked_amount": "1335273.421962689707530227104",
|
||||
"locked_amount": "1300565.575097378439837757406",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "1998.95815",
|
||||
@@ -33204,8 +33215,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-12-05T00:00:00.000Z",
|
||||
"total_added": "15870102.715470999700000001",
|
||||
"total_removed": "506806.74351511222783952",
|
||||
"locked_amount": "10034481.4071726185207856284228107618572587",
|
||||
"total_removed": "511218.93522350218767952",
|
||||
"locked_amount": "9911409.6106449879859047601650237654190322",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "16249.93",
|
||||
@@ -33754,6 +33765,31 @@
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x857534def76185e44db301ed76b6b1c58b2b861a92a2a426c66215dd1af481ed"
|
||||
},
|
||||
{
|
||||
"amount": "1387.11719949836634",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tx": "0x06a5b5862308d83bda5de42c3ce7f692d528d61da7d77e7698488ece926e8e53"
|
||||
},
|
||||
{
|
||||
"amount": "587.132524539506",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xa05b3825dec0543aa934b601d345f80d8db2a64f1a2d04e4d7c1d1b42f940f46"
|
||||
},
|
||||
{
|
||||
"amount": "1484.032846",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tx": "0xaa6324943437bf4c7cfd5e768371d0f23b2e9e4a93e3f0be5a790607524b3a77"
|
||||
},
|
||||
{
|
||||
"amount": "450.13493513362275",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0xfbf58834bd7889b8a3d473ec21f4c583708b672e274f4d047b175c7b72dde478"
|
||||
},
|
||||
{
|
||||
"amount": "503.77420321846475",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tx": "0x1e3efba0c9a6b7f9653f0fb5f9b24ae9c13ec801d00cf7f9333689f7432914c0"
|
||||
},
|
||||
{
|
||||
"amount": "930.302108",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
@@ -35036,6 +35072,24 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0x857534def76185e44db301ed76b6b1c58b2b861a92a2a426c66215dd1af481ed"
|
||||
},
|
||||
{
|
||||
"amount": "587.132524539506",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xa05b3825dec0543aa934b601d345f80d8db2a64f1a2d04e4d7c1d1b42f940f46"
|
||||
},
|
||||
{
|
||||
"amount": "450.13493513362275",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xfbf58834bd7889b8a3d473ec21f4c583708b672e274f4d047b175c7b72dde478"
|
||||
},
|
||||
{
|
||||
"amount": "503.77420321846475",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x1e3efba0c9a6b7f9653f0fb5f9b24ae9c13ec801d00cf7f9333689f7432914c0"
|
||||
},
|
||||
{
|
||||
"amount": "2074.139541638025125",
|
||||
"user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b",
|
||||
@@ -35926,8 +35980,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "259998.8875",
|
||||
"withdrawn_tokens": "95601.643430125375125",
|
||||
"remaining_tokens": "164397.244069874624875"
|
||||
"withdrawn_tokens": "97142.685093016968625",
|
||||
"remaining_tokens": "162856.202406983031375"
|
||||
},
|
||||
{
|
||||
"address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c",
|
||||
@@ -36154,6 +36208,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0xe63c2fb53455781596d91101708c24e53610a10d74b12132fbd3f7300fbae5f3"
|
||||
},
|
||||
{
|
||||
"amount": "1387.11719949836634",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
"tranche_id": 2,
|
||||
"tx": "0x06a5b5862308d83bda5de42c3ce7f692d528d61da7d77e7698488ece926e8e53"
|
||||
},
|
||||
{
|
||||
"amount": "1055.19046635722995",
|
||||
"user": "0xe3eB4CF43C072658401996b71D43eE26E573562D",
|
||||
@@ -36294,8 +36354,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "150551.801",
|
||||
"withdrawn_tokens": "54272.36427887047024",
|
||||
"remaining_tokens": "96279.43672112952976"
|
||||
"withdrawn_tokens": "55659.48147836883658",
|
||||
"remaining_tokens": "94892.31952163116342"
|
||||
},
|
||||
{
|
||||
"address": "0x4d982Ab0823fD2f48e934a7be2bb0a5374a26148",
|
||||
@@ -36509,6 +36569,12 @@
|
||||
"tranche_id": 2,
|
||||
"tx": "0xb87629e5ecd14a79820cfc8eb8804e15c5385d5f425ff732a61bf32d0c57b803"
|
||||
},
|
||||
{
|
||||
"amount": "1484.032846",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
"tranche_id": 2,
|
||||
"tx": "0xaa6324943437bf4c7cfd5e768371d0f23b2e9e4a93e3f0be5a790607524b3a77"
|
||||
},
|
||||
{
|
||||
"amount": "930.302108",
|
||||
"user": "0xF4c75FdbAe821C6B5DBB9f001bB23cBA58D1bA37",
|
||||
@@ -36613,8 +36679,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "200000",
|
||||
"withdrawn_tokens": "72759.880204",
|
||||
"remaining_tokens": "127240.119796"
|
||||
"withdrawn_tokens": "74243.91305",
|
||||
"remaining_tokens": "125756.08695"
|
||||
},
|
||||
{
|
||||
"address": "0x1b956E6c00E238194B331eddEFF72Cb5f28A8d01",
|
||||
@@ -37918,8 +37984,8 @@
|
||||
"tranche_start": "2021-11-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-05-05T00:00:00.000Z",
|
||||
"total_added": "14597706.0446472999",
|
||||
"total_removed": "3487265.64008411344306753",
|
||||
"locked_amount": "3542323.93804273703335817968877454",
|
||||
"total_removed": "3489401.90950082536320653",
|
||||
"locked_amount": "3428704.84130926731572974432005816",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "129284.449",
|
||||
@@ -38158,6 +38224,21 @@
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x9e2334407036669be5b1bccc4544949dd5b64a986498f4118b378f4c750d860f"
|
||||
},
|
||||
{
|
||||
"amount": "814.221479739060978",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x35a541fdaee8b0d8408783be8c28fc334c79b20e3cb61d0ef8f58ff35cd38862"
|
||||
},
|
||||
{
|
||||
"amount": "624.757173846928447",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0xa1dca04a068ba23bab9e2c53554a9357b9bedb1f4c2b63aef77b92ce46ae2ee6"
|
||||
},
|
||||
{
|
||||
"amount": "697.290763125930714",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tx": "0x617ff95943d9685aaf9763e3fb4ca1f81e8dd04fd013d1a64b59e52b78b25b81"
|
||||
},
|
||||
{
|
||||
"amount": "9158.56255453299474378",
|
||||
"user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8",
|
||||
@@ -40754,6 +40835,24 @@
|
||||
"tranche_id": 3,
|
||||
"tx": "0x9e2334407036669be5b1bccc4544949dd5b64a986498f4118b378f4c750d860f"
|
||||
},
|
||||
{
|
||||
"amount": "814.221479739060978",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x35a541fdaee8b0d8408783be8c28fc334c79b20e3cb61d0ef8f58ff35cd38862"
|
||||
},
|
||||
{
|
||||
"amount": "624.757173846928447",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0xa1dca04a068ba23bab9e2c53554a9357b9bedb1f4c2b63aef77b92ce46ae2ee6"
|
||||
},
|
||||
{
|
||||
"amount": "697.290763125930714",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
"tranche_id": 3,
|
||||
"tx": "0x617ff95943d9685aaf9763e3fb4ca1f81e8dd04fd013d1a64b59e52b78b25b81"
|
||||
},
|
||||
{
|
||||
"amount": "2874.6686339993457875",
|
||||
"user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b",
|
||||
@@ -42934,8 +43033,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "359123.469575",
|
||||
"withdrawn_tokens": "271972.71356822515138125",
|
||||
"remaining_tokens": "87150.75600677484861875"
|
||||
"withdrawn_tokens": "274108.98298493707152025",
|
||||
"remaining_tokens": "85014.48659006292847975"
|
||||
},
|
||||
{
|
||||
"address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB",
|
||||
@@ -44179,7 +44278,7 @@
|
||||
"tranche_end": "2023-04-05T00:00:00.000Z",
|
||||
"total_added": "5778205.3912159303",
|
||||
"total_removed": "2479228.813551817124120168",
|
||||
"locked_amount": "1082690.208177314167466422765104855",
|
||||
"locked_amount": "1037798.493633229255945123020263576",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "552496.6455",
|
||||
@@ -45974,8 +46073,8 @@
|
||||
"tranche_start": "2022-06-05T00:00:00.000Z",
|
||||
"tranche_end": "2023-06-05T00:00:00.000Z",
|
||||
"total_added": "472355.6199999996",
|
||||
"total_removed": "21197.8027491183963",
|
||||
"locked_amount": "211581.70645827225611927070928464",
|
||||
"total_removed": "27238.3679206278963",
|
||||
"locked_amount": "206082.034745654336161635141856908",
|
||||
"deposits": [
|
||||
{
|
||||
"amount": "3000",
|
||||
@@ -52619,6 +52718,36 @@
|
||||
"user": "0xe28dBf57Ad23cc0c32b6769556CD3c64873b4330",
|
||||
"tx": "0x93e29c518d96a60702a9ec71087ef37e4b4125dae3a4087c2ec61a7612fa03cd"
|
||||
},
|
||||
{
|
||||
"amount": "40.914155252",
|
||||
"user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
|
||||
"tx": "0xa6cc04f7c5af79b204cbe1dc0161b604ea0cc92a884934718b079a9610b5a1d5"
|
||||
},
|
||||
{
|
||||
"amount": "7.578386604",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
"tx": "0x3888d5619b67bce67e15fa391be79c46e9916cd3a9fcc2e375714d871d76ae8b"
|
||||
},
|
||||
{
|
||||
"amount": "55.585308853",
|
||||
"user": "0xe46BFCBF19E96e2AdD939b5bC6E541feE6631a11",
|
||||
"tx": "0xc1b142befd0ff0b541a6a6333cd5baa7b1145fa1a854b01601b35adddada71ce"
|
||||
},
|
||||
{
|
||||
"amount": "5811.945484488",
|
||||
"user": "0xfB48DBD9eaEA23D7ABCFB80fF87d001567956c0e",
|
||||
"tx": "0xe1d9888ad5ee915e9c81f18ac12e6e0ee54f006f0a75ad3ab4fabd8e9c5ac549"
|
||||
},
|
||||
{
|
||||
"amount": "96.547945204",
|
||||
"user": "0xf016E520e70f12A366a34B24B621F83140f8Be68",
|
||||
"tx": "0x459e4dbb06dac1e3171d15a8974dd7035e7f735c0247b45b66c4bdf427984af2"
|
||||
},
|
||||
{
|
||||
"amount": "27.9938911085",
|
||||
"user": "0xeE2C02Cd75dcEacD16614feB126a1cD2637646d0",
|
||||
"tx": "0x81181699f4cae02ba8761ccf126f88141644a318f8f5bfd67f3d4a4f870b59e9"
|
||||
},
|
||||
{
|
||||
"amount": "199.140778792",
|
||||
"user": "0x2827B97046558f044ab07c3De0159632f8956472",
|
||||
@@ -53672,10 +53801,17 @@
|
||||
"tx": "0xb59405747c8088945a412703637a7b422f3639439ec2ee15e180c0a2a0d71ee4"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "5811.945484488",
|
||||
"user": "0xfB48DBD9eaEA23D7ABCFB80fF87d001567956c0e",
|
||||
"tranche_id": 5,
|
||||
"tx": "0xe1d9888ad5ee915e9c81f18ac12e6e0ee54f006f0a75ad3ab4fabd8e9c5ac549"
|
||||
}
|
||||
],
|
||||
"total_tokens": "10400",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "10400"
|
||||
"withdrawn_tokens": "5811.945484488",
|
||||
"remaining_tokens": "4588.054515512"
|
||||
},
|
||||
{
|
||||
"address": "0x727f82E843617c79c5E5aa7368B92f2C790D8257",
|
||||
@@ -54440,10 +54576,17 @@
|
||||
"tx": "0xee02e72ef8e0755982704385da512cc12c8ff0ea7b58056fa3d5a5932394e9ca"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "55.585308853",
|
||||
"user": "0xe46BFCBF19E96e2AdD939b5bC6E541feE6631a11",
|
||||
"tranche_id": 5,
|
||||
"tx": "0xc1b142befd0ff0b541a6a6333cd5baa7b1145fa1a854b01601b35adddada71ce"
|
||||
}
|
||||
],
|
||||
"total_tokens": "100",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "100"
|
||||
"withdrawn_tokens": "55.585308853",
|
||||
"remaining_tokens": "44.414691147"
|
||||
},
|
||||
{
|
||||
"address": "0x4e5D990688190A9d0245912e1Cc0C2cC9E5aBf62",
|
||||
@@ -65607,6 +65750,12 @@
|
||||
"tranche_id": 5,
|
||||
"tx": "0x42cab1fe6b6604bb12a8d76335aec458d600328f039a78baba10a4bb750ebf67"
|
||||
},
|
||||
{
|
||||
"amount": "7.578386604",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x3888d5619b67bce67e15fa391be79c46e9916cd3a9fcc2e375714d871d76ae8b"
|
||||
},
|
||||
{
|
||||
"amount": "26.6608828",
|
||||
"user": "0x4eD2b3c68BB4fda084ce1591a210F4aC8b71234A",
|
||||
@@ -65663,8 +65812,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "214.495116692",
|
||||
"remaining_tokens": "185.504883308"
|
||||
"withdrawn_tokens": "222.073503296",
|
||||
"remaining_tokens": "177.926496704"
|
||||
},
|
||||
{
|
||||
"address": "0x5c90765F50629570738fEe7b7FA82ae118f81Ed1",
|
||||
@@ -67579,6 +67728,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "96.547945204",
|
||||
"user": "0xf016E520e70f12A366a34B24B621F83140f8Be68",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x459e4dbb06dac1e3171d15a8974dd7035e7f735c0247b45b66c4bdf427984af2"
|
||||
},
|
||||
{
|
||||
"amount": "127.394812276",
|
||||
"user": "0xf016E520e70f12A366a34B24B621F83140f8Be68",
|
||||
@@ -67587,8 +67742,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "127.394812276",
|
||||
"remaining_tokens": "272.605187724"
|
||||
"withdrawn_tokens": "223.94275748",
|
||||
"remaining_tokens": "176.05724252"
|
||||
},
|
||||
{
|
||||
"address": "0x1d999A280c97D468866b80292c707c47f23D7B18",
|
||||
@@ -69886,10 +70041,17 @@
|
||||
"tx": "0x3a0390dffa4280c286016566b29c62e4cec36c6504f7ac3d1de80d22b2903008"
|
||||
}
|
||||
],
|
||||
"withdrawals": [],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "27.9938911085",
|
||||
"user": "0xeE2C02Cd75dcEacD16614feB126a1cD2637646d0",
|
||||
"tranche_id": 5,
|
||||
"tx": "0x81181699f4cae02ba8761ccf126f88141644a318f8f5bfd67f3d4a4f870b59e9"
|
||||
}
|
||||
],
|
||||
"total_tokens": "50",
|
||||
"withdrawn_tokens": "0",
|
||||
"remaining_tokens": "50"
|
||||
"withdrawn_tokens": "27.9938911085",
|
||||
"remaining_tokens": "22.0061088915"
|
||||
},
|
||||
{
|
||||
"address": "0x4B2FE2305A9F8AdCa0038B375dADCcad274C09Ca",
|
||||
@@ -70029,6 +70191,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "40.914155252",
|
||||
"user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
|
||||
"tranche_id": 5,
|
||||
"tx": "0xa6cc04f7c5af79b204cbe1dc0161b604ea0cc92a884934718b079a9610b5a1d5"
|
||||
},
|
||||
{
|
||||
"amount": "180.29405124",
|
||||
"user": "0xcB555C5602cC0b2434A27d277e14Cb5C7bF4Ead1",
|
||||
@@ -70037,8 +70205,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "400",
|
||||
"withdrawn_tokens": "180.29405124",
|
||||
"remaining_tokens": "219.70594876"
|
||||
"withdrawn_tokens": "221.208206492",
|
||||
"remaining_tokens": "178.791793508"
|
||||
},
|
||||
{
|
||||
"address": "0x3738bec36216eA2F11B954891C65AAd1Bc852156",
|
||||
@@ -73949,7 +74117,7 @@
|
||||
"tranche_start": "2021-12-05T00:00:00.000Z",
|
||||
"tranche_end": "2022-06-05T00:00:00.000Z",
|
||||
"total_added": "171288.42",
|
||||
"total_removed": "60531.9043909997989",
|
||||
"total_removed": "60641.2093106172989",
|
||||
"locked_amount": "0",
|
||||
"deposits": [
|
||||
{
|
||||
@@ -78199,6 +78367,11 @@
|
||||
"user": "0xe611723f968ED5735B3742ae721b4A2A6edB6758",
|
||||
"tx": "0x940ac7457a2b8a9072a31ad871c5e4c0a343f302e0d9f76de99df369abe297fc"
|
||||
},
|
||||
{
|
||||
"amount": "109.3049196175",
|
||||
"user": "0x667B436A05523B8D80483b030f559f034753DD74",
|
||||
"tx": "0x48d6761a237f75fa95ff67082e4f0b5538586a58a7a677943f1c4260f3abb860"
|
||||
},
|
||||
{
|
||||
"amount": "250",
|
||||
"user": "0x3E1CECDc3d15Cb03e91a60470C4453f4fBFc75F9",
|
||||
@@ -86911,6 +87084,12 @@
|
||||
}
|
||||
],
|
||||
"withdrawals": [
|
||||
{
|
||||
"amount": "109.3049196175",
|
||||
"user": "0x667B436A05523B8D80483b030f559f034753DD74",
|
||||
"tranche_id": 6,
|
||||
"tx": "0x48d6761a237f75fa95ff67082e4f0b5538586a58a7a677943f1c4260f3abb860"
|
||||
},
|
||||
{
|
||||
"amount": "140.6950803825",
|
||||
"user": "0x667B436A05523B8D80483b030f559f034753DD74",
|
||||
@@ -86919,8 +87098,8 @@
|
||||
}
|
||||
],
|
||||
"total_tokens": "250",
|
||||
"withdrawn_tokens": "140.6950803825",
|
||||
"remaining_tokens": "109.3049196175"
|
||||
"withdrawn_tokens": "250",
|
||||
"remaining_tokens": "0"
|
||||
},
|
||||
{
|
||||
"address": "0x036946f917076119Dc6a221F8ad587938CBf14d3",
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
# Vega token website E2E tests
|
||||
|
||||
To run the UI automation tests with Vega Capsule, run:
|
||||
|
||||
```bash
|
||||
yarn nx run token-e2e:e2e
|
||||
```
|
||||
|
||||
To open Cypress and run in interactive mode, run:
|
||||
|
||||
```bash
|
||||
yarn nx run token-e2e:e2e --watch
|
||||
```
|
||||
|
||||
## Vega Capsule Setup
|
||||
|
||||
The e2e tests run against a locally running instance of the Vega network, managed and controlled by [Vega Capsule](https://github.com/vegaprotocol/vegacapsule). Vega Capsule will:
|
||||
|
||||
- Bootstrap and start up a Vega network
|
||||
- Start up [Ganache](https://trufflesuite.com/ganache/) for a local Ethereum network
|
||||
- Install the required Vega smart contracts
|
||||
- Set up DataNodes with a running GraphQL and REST APIs.
|
||||
|
||||
Refer to the [Vega Capsule readme](https://github.com/vegaprotocol/vegacapsule#readme) for setting up and running Capsule. You will need [Go 1.19 or later](https://go.dev/doc/install) and [Docker](https://docs.docker.com/get-docker/) installed.
|
||||
|
||||
### Troubleshooting
|
||||
|
||||
- You may need to run `vegacapsule nodes unsafe-reset-all` to get a clean network state
|
||||
|
||||
## Vega Wallet Setup
|
||||
|
||||
Start by [downloading the Vega wallet software here](https://github.com/vegaprotocol/vega/releases).
|
||||
|
||||
You can then refer to (or run) `vegacapsule/setup-vegawallet.sh`. This will initialise and configure your wallet to have the correct public keys and network config to run against capsule.
|
||||
@@ -183,12 +183,12 @@ describe('market info is displayed', { tags: '@smoke' }, () => {
|
||||
.first()
|
||||
.should('have.text', 'View governance proposal')
|
||||
.and('have.attr', 'href')
|
||||
.and('contain', '/governance/market-0');
|
||||
.and('contain', '/proposals/market-0');
|
||||
cy.getByTestId(externalLink)
|
||||
.eq(1)
|
||||
.should('have.text', 'Propose a change to market')
|
||||
.and('have.attr', 'href')
|
||||
.and('contain', '/governance/propose/update-market');
|
||||
.and('contain', '/proposals/propose/update-market');
|
||||
});
|
||||
|
||||
afterEach('close toggle', () => {
|
||||
|
||||
@@ -49,7 +49,7 @@ describe('Market proposal notification', { tags: '@smoke' }, () => {
|
||||
cy.getByTestId('external-link').should(
|
||||
'have.attr',
|
||||
'href',
|
||||
'https://stagnet3.token.vega.xyz/governance/123'
|
||||
'https://stagnet3.token.vega.xyz/proposals/123'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -106,7 +106,7 @@ describe('markets table', { tags: '@smoke' }, () => {
|
||||
.and(
|
||||
'have.attr',
|
||||
'href',
|
||||
'https://stagnet3.token.vega.xyz/governance/propose/new-market'
|
||||
'https://stagnet3.token.vega.xyz/proposals/propose/new-market'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -96,7 +96,7 @@ describe('orders list', { tags: '@smoke' }, () => {
|
||||
});
|
||||
|
||||
it('orders are sorted by most recent order', () => {
|
||||
//7003-MORD-002
|
||||
// 7003-MORD-002
|
||||
const expectedOrderList = ['BTCUSD.MF21', 'BTCUSD.MF21'];
|
||||
|
||||
cy.getByTestId('tab-orders')
|
||||
@@ -133,9 +133,9 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
});
|
||||
});
|
||||
const orderId = '1234567890';
|
||||
//7002-SORD-053
|
||||
//7002-SORD-040
|
||||
//7003-MORD-001
|
||||
// 7002-SORD-053
|
||||
// 7002-SORD-040
|
||||
// 7003-MORD-001
|
||||
it('must see an active order', () => {
|
||||
// 7002-SORD-041
|
||||
updateOrder({
|
||||
@@ -224,6 +224,70 @@ describe('subscribe orders', { tags: '@smoke' }, () => {
|
||||
cy.getByTestId(`order-status-${orderId}`).should('have.text', 'Parked');
|
||||
});
|
||||
|
||||
it('must see the size of the order and direction/side -', () => {
|
||||
// 7003-MORD-003
|
||||
// 7003-MORD-004
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
size: '15',
|
||||
side: Schema.Side.SIDE_SELL,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="size"]')
|
||||
.should('have.text', '-15');
|
||||
});
|
||||
|
||||
it('must see the size of the order and direction/side +', () => {
|
||||
// 7003-MORD-003
|
||||
// 7003-MORD-004
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
size: '5',
|
||||
side: Schema.Side.SIDE_BUY,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="size"]')
|
||||
.should('have.text', '+5');
|
||||
});
|
||||
|
||||
it('for limit typy must see the Limit price that was set on the order', () => {
|
||||
// 7003-MORD-005
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="price"]')
|
||||
.should('have.text', '200.00');
|
||||
});
|
||||
|
||||
it('for market typy must not see a price for active or parked orders', () => {
|
||||
// 7003-MORD-005
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
type: Schema.OrderType.TYPE_MARKET,
|
||||
status: Schema.OrderStatus.STATUS_PARKED,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find('[col-id="price"]')
|
||||
.should('have.text', '200.00');
|
||||
});
|
||||
|
||||
it('must see the time in force applied to the order', () => {
|
||||
// 7003-MORD-006
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
type: Schema.OrderType.TYPE_MARKET,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
|
||||
});
|
||||
cy.get(`[row-id=${orderId}]`)
|
||||
.find(`[col-id='${orderTimeInForce}']`)
|
||||
.should('have.text', "Good 'til Cancelled (GTC)");
|
||||
});
|
||||
|
||||
it('for Active order when is part of a liquidity or peg shape, must not see an option to amend the individual order ', () => {
|
||||
// 7003-MORD-008
|
||||
updateOrder({
|
||||
@@ -288,9 +352,10 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
|
||||
|
||||
const orderId = '1234567890';
|
||||
it('must be able to amend the price of an order', () => {
|
||||
//7003-MORD-012
|
||||
//7003-MORD-014
|
||||
//7003-MORD-015
|
||||
// 7003-MORD-007
|
||||
// 7003-MORD-012
|
||||
// 7003-MORD-014
|
||||
// 7003-MORD-015
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
@@ -316,9 +381,10 @@ describe('amend and cancel order', { tags: '@smoke' }, () => {
|
||||
});
|
||||
});
|
||||
it('must be able to cancel an individual order', () => {
|
||||
//7003-MORD-009
|
||||
//7003-MORD-010
|
||||
//7003-MORD-011
|
||||
// 7003-MORD-007
|
||||
// 7003-MORD-009
|
||||
// 7003-MORD-010
|
||||
// 7003-MORD-011
|
||||
updateOrder({
|
||||
id: orderId,
|
||||
status: Schema.OrderStatus.STATUS_ACTIVE,
|
||||
|
||||
@@ -8,8 +8,7 @@ import {
|
||||
Web3Provider as Web3ProviderInternal,
|
||||
useWeb3ConnectStore,
|
||||
} from '@vegaprotocol/web3';
|
||||
import { AsyncRenderer, Splash } from '@vegaprotocol/ui-toolkit';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
import { AsyncRenderer, Loader } from '@vegaprotocol/ui-toolkit';
|
||||
|
||||
interface AppLoaderProps {
|
||||
children: ReactNode;
|
||||
@@ -21,10 +20,7 @@ interface AppLoaderProps {
|
||||
*/
|
||||
export function AppLoader({ children }: AppLoaderProps) {
|
||||
return (
|
||||
<NetworkLoader
|
||||
skeleton={<Splash>{t('Loading...')}</Splash>}
|
||||
cache={cacheConfig}
|
||||
>
|
||||
<NetworkLoader skeleton={<Loader />} cache={cacheConfig}>
|
||||
{children}
|
||||
</NetworkLoader>
|
||||
);
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { Loader } from '@vegaprotocol/ui-toolkit';
|
||||
|
||||
export const Preloader = () => {
|
||||
return (
|
||||
<>
|
||||
<style>
|
||||
{`
|
||||
body{
|
||||
display: block;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
<div className="pre-loader">
|
||||
<Loader forceTheme="light" preloader />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default Preloader;
|
||||
@@ -1,4 +1,5 @@
|
||||
import Head from 'next/head';
|
||||
import dynamic from 'next/dynamic';
|
||||
import type { AppProps } from 'next/app';
|
||||
import { Navbar } from '../components/navbar';
|
||||
import { t } from '@vegaprotocol/react-helpers';
|
||||
@@ -22,6 +23,7 @@ import {
|
||||
} from '@vegaprotocol/environment';
|
||||
import { AppLoader, Web3Provider } from '../components/app-loader';
|
||||
import './styles.css';
|
||||
import './gen-styles.scss';
|
||||
import { usePageTitleStore } from '../stores';
|
||||
import { Footer } from '../components/footer';
|
||||
import { useEffect, useMemo, useState } from 'react';
|
||||
@@ -67,7 +69,7 @@ function AppBody({ Component }: AppProps) {
|
||||
const { VEGA_ENV } = useEnvironment();
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="h-full dark:bg-black dark:text-white">
|
||||
<Head>
|
||||
{/* Cannot use meta tags in _document.page.tsx see https://nextjs.org/docs/messages/no-document-viewport-meta */}
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
@@ -76,7 +78,7 @@ function AppBody({ Component }: AppProps) {
|
||||
<VegaWalletProvider>
|
||||
<AppLoader>
|
||||
<Web3Provider>
|
||||
<div className="h-full relative dark:bg-black dark:text-white z-0 grid grid-rows-[min-content,1fr,min-content]">
|
||||
<div className="h-full relative z-0 grid grid-rows-[min-content,1fr,min-content]">
|
||||
<Navbar
|
||||
navbarTheme={VEGA_ENV === Networks.TESTNET ? 'yellow' : 'dark'}
|
||||
/>
|
||||
@@ -92,10 +94,17 @@ function AppBody({ Component }: AppProps) {
|
||||
</Web3Provider>
|
||||
</AppLoader>
|
||||
</VegaWalletProvider>
|
||||
</>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const DynamicLoader = dynamic(
|
||||
() => import('../components/preloader/preloader'),
|
||||
{
|
||||
loading: () => <>Loading...</>,
|
||||
}
|
||||
);
|
||||
|
||||
function VegaTradingApp(props: AppProps) {
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
@@ -106,7 +115,9 @@ function VegaTradingApp(props: AppProps) {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!mounted) return null;
|
||||
if (!mounted) {
|
||||
return <DynamicLoader />;
|
||||
}
|
||||
|
||||
return (
|
||||
<HashRouter>
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
.pre-loader {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
@for $i from 0 through 16 {
|
||||
.loader-item:nth-child(#{$i}) {
|
||||
@if $i % 2 == 0 {
|
||||
animation-delay: #{$i * 50 * random(5)}ms;
|
||||
animation-direction: reverse;
|
||||
} @else {
|
||||
animation-delay: #{$i * -50 * random(5)}ms;
|
||||
animation-direction: alternate;
|
||||
}
|
||||
}
|
||||
}
|
||||
.pre-loader-center {
|
||||
align-items: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.pre-loader-wrapper {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
.loader-item {
|
||||
width: 10px;
|
||||
height: 10px;
|
||||
background: black;
|
||||
animation: flickering 0.4s steps(2, jump-none) alternate infinite;
|
||||
}
|
||||
}
|
||||
@keyframes flickering {
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
25% {
|
||||
opacity: 1;
|
||||
}
|
||||
26% {
|
||||
opacity: 0;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
@@ -31,5 +31,6 @@ subscription AccountEvents($partyId: ID) {
|
||||
balance
|
||||
assetId
|
||||
marketId
|
||||
partyId
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -17,7 +17,7 @@ export type AccountEventsSubscriptionVariables = Types.Exact<{
|
||||
}>;
|
||||
|
||||
|
||||
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null }> };
|
||||
export type AccountEventsSubscription = { __typename?: 'Subscription', accounts: Array<{ __typename?: 'AccountUpdate', type: Types.AccountType, balance: string, assetId: string, marketId?: string | null, partyId: string }> };
|
||||
|
||||
export const AccountFieldsFragmentDoc = gql`
|
||||
fragment AccountFields on AccountBalance {
|
||||
@@ -83,6 +83,7 @@ export const AccountEventsDocument = gql`
|
||||
balance
|
||||
assetId
|
||||
marketId
|
||||
partyId
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -26,6 +26,7 @@ describe('getId', () => {
|
||||
balance: '1',
|
||||
assetId: 'assetId',
|
||||
marketId: '',
|
||||
partyId: '',
|
||||
})
|
||||
);
|
||||
expect(
|
||||
@@ -41,6 +42,7 @@ describe('getId', () => {
|
||||
balance: '1',
|
||||
assetId: 'assetId',
|
||||
marketId: 'testId',
|
||||
partyId: 'partyId',
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
@@ -66,6 +66,7 @@ const update = (
|
||||
balance: delta.balance,
|
||||
market: delta.marketId ? { id: delta.marketId } : null,
|
||||
asset: { id: delta.assetId },
|
||||
party: { id: delta.partyId },
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -182,6 +183,7 @@ export const accountsDataProvider = makeDerivedDataProvider<Account[], never>(
|
||||
if (asset) {
|
||||
return {
|
||||
...account,
|
||||
partyId: account.party?.id,
|
||||
asset: {
|
||||
...asset,
|
||||
},
|
||||
|
||||
@@ -122,6 +122,7 @@ export const accountEventsSubscription = (
|
||||
balance: '100000000',
|
||||
assetId: 'asset-id',
|
||||
marketId: null,
|
||||
partyId: 'vega-0',
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
@@ -40,11 +40,13 @@ const getBlockDisplayValue = (
|
||||
return '-';
|
||||
};
|
||||
|
||||
const getSslDisplayValue = (ssl?: NodeData['ssl']) => {
|
||||
if (ssl?.value) {
|
||||
const getSubscriptionDisplayValue = (
|
||||
subscription?: NodeData['subscription']
|
||||
) => {
|
||||
if (subscription?.value) {
|
||||
return t('Yes');
|
||||
}
|
||||
if (ssl?.hasError) {
|
||||
if (subscription?.hasError) {
|
||||
return t('No');
|
||||
}
|
||||
return '-';
|
||||
@@ -81,12 +83,12 @@ const NodeStatsContent = ({
|
||||
{getBlockDisplayValue(data.block, setBlock)}
|
||||
</LayoutCell>
|
||||
<LayoutCell
|
||||
label={t('SSL')}
|
||||
isLoading={data.ssl?.isLoading}
|
||||
hasError={data.ssl?.hasError}
|
||||
dataTestId="ssl-cell"
|
||||
label={t('Subscription')}
|
||||
isLoading={data.subscription?.isLoading}
|
||||
hasError={data.subscription?.hasError}
|
||||
dataTestId="subscription-cell"
|
||||
>
|
||||
{getSslDisplayValue(data.ssl)}
|
||||
{getSubscriptionDisplayValue(data.subscription)}
|
||||
</LayoutCell>
|
||||
</LayoutRow>
|
||||
);
|
||||
|
||||
@@ -10,7 +10,7 @@ import { getErrorByType } from '../../utils/validate-node';
|
||||
import type { Configuration, NodeData } from '../../types';
|
||||
import { Networks, ErrorType, CUSTOM_NODE_KEY } from '../../types';
|
||||
|
||||
type NodeDataProp = 'responseTime' | 'block' | 'chain' | 'ssl';
|
||||
type NodeDataProp = 'responseTime' | 'block' | 'chain' | 'subscription';
|
||||
|
||||
jest.mock('../../hooks/use-environment');
|
||||
jest.mock('../../hooks/use-nodes');
|
||||
@@ -99,7 +99,7 @@ const getValidNodeState = (env: Networks, url: string) => ({
|
||||
hasError: false,
|
||||
value: 123,
|
||||
},
|
||||
ssl: {
|
||||
subscription: {
|
||||
isLoading: false,
|
||||
hasError: false,
|
||||
value: true,
|
||||
@@ -203,8 +203,8 @@ describe('Node switcher', () => {
|
||||
${'block'} | ${STATES.HAS_ERROR}
|
||||
${'chain'} | ${STATES.LOADING}
|
||||
${'chain'} | ${STATES.HAS_ERROR}
|
||||
${'ssl'} | ${STATES.LOADING}
|
||||
${'ssl'} | ${STATES.HAS_ERROR}
|
||||
${'subscription'} | ${STATES.LOADING}
|
||||
${'subscription'} | ${STATES.HAS_ERROR}
|
||||
`(
|
||||
'disables selecting a node when the $dataProp $state',
|
||||
({ dataProp, state }: { dataProp: NodeDataProp; state: STATES }) => {
|
||||
@@ -409,8 +409,8 @@ describe('Node switcher', () => {
|
||||
${'block'} | ${STATES.HAS_ERROR}
|
||||
${'chain'} | ${STATES.LOADING}
|
||||
${'chain'} | ${STATES.HAS_ERROR}
|
||||
${'ssl'} | ${STATES.LOADING}
|
||||
${'ssl'} | ${STATES.HAS_ERROR}
|
||||
${'subscription'} | ${STATES.LOADING}
|
||||
${'subscription'} | ${STATES.HAS_ERROR}
|
||||
`(
|
||||
'disables selecting a custom node when the $dataProp $state',
|
||||
({ dataProp, state }: { dataProp: NodeDataProp; state: STATES }) => {
|
||||
@@ -494,7 +494,9 @@ describe('Node switcher', () => {
|
||||
|
||||
if (state === STATES.HAS_ERROR) {
|
||||
const expectedErrorType =
|
||||
dataProp === 'ssl' ? ErrorType.SSL_ERROR : ErrorType.CONNECTION_ERROR;
|
||||
dataProp === 'subscription'
|
||||
? ErrorType.SUBSCRIPTION_ERROR
|
||||
: ErrorType.CONNECTION_ERROR;
|
||||
const error = getErrorByType(
|
||||
expectedErrorType,
|
||||
Networks.TESTNET,
|
||||
@@ -547,7 +549,7 @@ describe('Node switcher', () => {
|
||||
it.each`
|
||||
description | errorType
|
||||
${'the node has an invalid url'} | ${ErrorType.INVALID_URL}
|
||||
${'the node has an ssl issue'} | ${ErrorType.SSL_ERROR}
|
||||
${'the node has a subscription issue'} | ${ErrorType.SUBSCRIPTION_ERROR}
|
||||
${'the node cannot be reached'} | ${ErrorType.CONNECTION_ERROR}
|
||||
${'none of the config nodes can be connected to'} | ${ErrorType.CONNECTION_ERROR_ALL}
|
||||
${'the config cannot be loaded'} | ${ErrorType.CONFIG_LOAD_ERROR}
|
||||
|
||||
@@ -97,7 +97,7 @@ export const NodeSwitcher = ({
|
||||
<div />
|
||||
<span className="text-right">{t('Response time')}</span>
|
||||
<span className="text-right">{t('Block')}</span>
|
||||
<span className="text-right">{t('SSL')}</span>
|
||||
<span className="text-right">{t('Subscription')}</span>
|
||||
</LayoutRow>
|
||||
</div>
|
||||
<RadioGroup
|
||||
|
||||
@@ -503,7 +503,7 @@ describe('node selection', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('has a network error when the selected node has not ssl available', async () => {
|
||||
it('has a network error when the selected node has not subscription available', async () => {
|
||||
act(async () => {
|
||||
// @ts-ignore allow adding a mock return value to mocked module
|
||||
createClient.mockImplementation(() => {
|
||||
@@ -517,7 +517,7 @@ describe('node selection', () => {
|
||||
await waitFor(() => {
|
||||
expect(result.current).toEqual({
|
||||
...mockEnvironmentState,
|
||||
networkError: ErrorType.SSL_ERROR,
|
||||
networkError: ErrorType.SUBSCRIPTION_ERROR,
|
||||
setNodeSwitcherOpen: result.current.setNodeSwitcherOpen,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -88,12 +88,12 @@ export const useEtherscanLink = () => {
|
||||
export const BLOG = 'https://blog.vega.xyz/';
|
||||
|
||||
// Token pages
|
||||
export const TOKEN_NEW_MARKET_PROPOSAL = '/governance/propose/new-market';
|
||||
export const TOKEN_NEW_MARKET_PROPOSAL = '/proposals/propose/new-market';
|
||||
export const TOKEN_NEW_NETWORK_PARAM_PROPOSAL =
|
||||
'/governance/propose/network-parameter';
|
||||
export const TOKEN_GOVERNANCE = '/governance';
|
||||
export const TOKEN_PROPOSALS = '/governance';
|
||||
export const TOKEN_PROPOSAL = '/governance/:id';
|
||||
'/proposals/propose/network-parameter';
|
||||
export const TOKEN_GOVERNANCE = '/proposals';
|
||||
export const TOKEN_PROPOSALS = '/proposals';
|
||||
export const TOKEN_PROPOSAL = '/proposals/:id';
|
||||
|
||||
// Explorer pages
|
||||
export const EXPLORER_TX = '/txs/:hash';
|
||||
|
||||
@@ -24,7 +24,7 @@ const initialState = {
|
||||
hasError: false,
|
||||
value: undefined,
|
||||
},
|
||||
ssl: {
|
||||
subscription: {
|
||||
isLoading: false,
|
||||
hasError: false,
|
||||
value: undefined,
|
||||
@@ -84,8 +84,8 @@ describe('useNodes hook', () => {
|
||||
...initialState.chain,
|
||||
isLoading: true,
|
||||
},
|
||||
ssl: {
|
||||
...initialState.ssl,
|
||||
subscription: {
|
||||
...initialState.subscription,
|
||||
isLoading: true,
|
||||
},
|
||||
});
|
||||
@@ -122,7 +122,7 @@ describe('useNodes hook', () => {
|
||||
const { result } = renderHook(() => useNodes({ hosts: [node] }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.state[node].ssl).toEqual({
|
||||
expect(result.current.state[node].subscription).toEqual({
|
||||
isLoading: false,
|
||||
hasError: false,
|
||||
value: true,
|
||||
@@ -182,7 +182,7 @@ describe('useNodes hook', () => {
|
||||
const { result } = renderHook(() => useNodes({ hosts: [node] }));
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.state[node].ssl).toEqual({
|
||||
expect(result.current.state[node].subscription).toEqual({
|
||||
isLoading: false,
|
||||
hasError: true,
|
||||
value: undefined,
|
||||
@@ -273,7 +273,7 @@ describe('useNodes hook', () => {
|
||||
expect(result.current.state[node].block.hasError).toBe(true);
|
||||
expect(result.current.state[node].chain.hasError).toBe(true);
|
||||
expect(result.current.state[node].responseTime.hasError).toBe(true);
|
||||
expect(result.current.state[node].ssl.hasError).toBe(true);
|
||||
expect(result.current.state[node].subscription.hasError).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -331,7 +331,7 @@ describe('useNodes hook', () => {
|
||||
});
|
||||
|
||||
await waitFor(() => {
|
||||
expect(result.current.state[node].ssl).toEqual({
|
||||
expect(result.current.state[node].subscription).toEqual({
|
||||
isLoading: false,
|
||||
hasError: true,
|
||||
value: undefined,
|
||||
|
||||
@@ -61,7 +61,7 @@ const getNodeData = (url?: string): NodeData => ({
|
||||
initialized: false,
|
||||
responseTime: withData(),
|
||||
block: withData(),
|
||||
ssl: withData(),
|
||||
subscription: withData(),
|
||||
chain: withData(),
|
||||
});
|
||||
|
||||
@@ -141,18 +141,18 @@ const reducer = (state: Record<string, NodeData>, action: Action) => {
|
||||
state[action.node] = getNodeData(action.payload?.url);
|
||||
}
|
||||
state[action.node].url = action.payload?.url ?? '';
|
||||
state[action.node].ssl.isLoading = true;
|
||||
state[action.node].subscription.isLoading = true;
|
||||
state[action.node].initialized = true;
|
||||
});
|
||||
case ACTIONS.CHECK_SUBSCRIPTION_SUCCESS:
|
||||
return produce(state, (state) => {
|
||||
if (!state[action.node]) return;
|
||||
state[action.node].ssl = withData(true);
|
||||
state[action.node].subscription = withData(true);
|
||||
});
|
||||
case ACTIONS.CHECK_SUBSCRIPTION_FAILURE:
|
||||
return produce(state, (state) => {
|
||||
if (!state[action.node]) return;
|
||||
state[action.node].ssl = withError();
|
||||
state[action.node].subscription = withError();
|
||||
});
|
||||
case ACTIONS.ADD_NODE:
|
||||
return produce(state, (state) => {
|
||||
|
||||
@@ -10,7 +10,7 @@ export const CUSTOM_NODE_KEY = 'custom';
|
||||
|
||||
export enum ErrorType {
|
||||
INVALID_URL,
|
||||
SSL_ERROR,
|
||||
SUBSCRIPTION_ERROR,
|
||||
CONNECTION_ERROR,
|
||||
CONNECTION_ERROR_ALL,
|
||||
CONFIG_LOAD_ERROR,
|
||||
@@ -37,7 +37,7 @@ type NodeCheck<T> = {
|
||||
export type NodeData = {
|
||||
url: string;
|
||||
initialized: boolean;
|
||||
ssl: NodeCheck<boolean>;
|
||||
subscription: NodeCheck<boolean>;
|
||||
block: NodeCheck<number>;
|
||||
responseTime: NodeCheck<number>;
|
||||
chain: NodeCheck<string>;
|
||||
|
||||
@@ -8,7 +8,7 @@ export const getIsNodeLoading = (node?: NodeData): boolean => {
|
||||
node.chain.isLoading ||
|
||||
node.responseTime.isLoading ||
|
||||
node.block.isLoading ||
|
||||
node.ssl.isLoading
|
||||
node.subscription.isLoading
|
||||
);
|
||||
};
|
||||
|
||||
@@ -29,7 +29,7 @@ export const getIsNodeDisabled = (env: Networks, data?: NodeData) => {
|
||||
data.chain.hasError ||
|
||||
data.responseTime.hasError ||
|
||||
data.block.hasError ||
|
||||
data.ssl.hasError)
|
||||
data.subscription.hasError)
|
||||
);
|
||||
};
|
||||
|
||||
@@ -57,12 +57,12 @@ export const getErrorByType = (
|
||||
headline: t('Error: invalid url'),
|
||||
message: t(url ? `${url} is not a valid url.` : ''),
|
||||
};
|
||||
case ErrorType.SSL_ERROR:
|
||||
case ErrorType.SUBSCRIPTION_ERROR:
|
||||
return {
|
||||
headline: t(`Error: the node you are reading from does not have SSL`),
|
||||
headline: t(`Error: the node you are reading from does not emit data`),
|
||||
message: t(
|
||||
url
|
||||
? `${url} does not have SSL. SSL is required to subscribe to data.`
|
||||
? `${url} is required to have subscriptions working to enable data updates on the page.`
|
||||
: ''
|
||||
),
|
||||
};
|
||||
@@ -112,8 +112,8 @@ export const getErrorType = (env: Networks, data?: NodeData) => {
|
||||
return ErrorType.CONNECTION_ERROR;
|
||||
}
|
||||
|
||||
if (data.ssl.hasError) {
|
||||
return ErrorType.SSL_ERROR;
|
||||
if (data.subscription.hasError) {
|
||||
return ErrorType.SUBSCRIPTION_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export const useColumnDefs = () => {
|
||||
const { change } = data?.terms || {};
|
||||
if (instrumentGuard(change) && VEGA_TOKEN_URL) {
|
||||
if (data?.id) {
|
||||
const link = `${VEGA_TOKEN_URL}/governance/${data.id}`;
|
||||
const link = `${VEGA_TOKEN_URL}/proposals/${data.id}`;
|
||||
return (
|
||||
<ExternalLink href={link}>
|
||||
{change.instrument.code}
|
||||
|
||||
@@ -43,10 +43,10 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
|
||||
if (!value) return '-';
|
||||
return `${addDecimalsFormatNumber(value, assetDecimalPlaces ?? 0, 5)}`;
|
||||
};
|
||||
const stakeToCcySiskasFormatter = ({ value }: ValueFormatterParams) => {
|
||||
const stakeToCcyVolumeFormatter = ({ value }: ValueFormatterParams) => {
|
||||
if (!value) return '-';
|
||||
const newValue = new BigNumber(value)
|
||||
.times(stakeToCcySiskas ?? 1)
|
||||
.times(Number(stakeToCcySiskas) || 1)
|
||||
.toString();
|
||||
return `${addDecimalsFormatNumber(newValue, assetDecimalPlaces ?? 0, 5)}`;
|
||||
};
|
||||
@@ -121,7 +121,7 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
|
||||
headerTooltip={t(
|
||||
`The liquidity provider's obligation to the market, calculated as the liquidity commitment amount multiplied by the value of the stake_to_ccy_siskas network parameter to convert into units of liquidity volume. The obligation can be met by a combination of LP orders and limit orders on the order book.`
|
||||
)}
|
||||
valueFormatter={stakeToCcySiskasFormatter}
|
||||
valueFormatter={stakeToCcyVolumeFormatter}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Supplied')}
|
||||
@@ -130,7 +130,7 @@ export const LiquidityTable = forwardRef<AgGridReact, LiquidityTableProps>(
|
||||
)}
|
||||
field="balance"
|
||||
type="rightAligned"
|
||||
valueFormatter={stakeToCcySiskasFormatter}
|
||||
valueFormatter={stakeToCcyVolumeFormatter}
|
||||
/>
|
||||
<AgGridColumn
|
||||
headerName={t('Status')}
|
||||
|
||||
@@ -26,6 +26,6 @@ export const ExternalLinks = {
|
||||
};
|
||||
|
||||
export const TokenLinks = {
|
||||
PROPOSAL_PAGE: ':tokenUrl/governance/:proposalId',
|
||||
UPDATE_PROPOSAL_PAGE: ':tokenUrl/governance/propose/update-market',
|
||||
PROPOSAL_PAGE: ':tokenUrl/proposals/:proposalId',
|
||||
UPDATE_PROPOSAL_PAGE: ':tokenUrl/proposals/propose/update-market',
|
||||
};
|
||||
|
||||
@@ -4,20 +4,27 @@ import { useEffect, useState } from 'react';
|
||||
export interface LoaderProps {
|
||||
size?: 'small' | 'large';
|
||||
forceTheme?: 'dark' | 'light';
|
||||
preloader?: boolean;
|
||||
}
|
||||
|
||||
export const Loader = ({ size = 'large', forceTheme }: LoaderProps) => {
|
||||
export const Loader = ({
|
||||
size = 'large',
|
||||
forceTheme,
|
||||
preloader,
|
||||
}: LoaderProps) => {
|
||||
const [, forceRender] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const interval = setInterval(() => {
|
||||
forceRender((x) => !x);
|
||||
}, 100);
|
||||
const interval = preloader
|
||||
? undefined
|
||||
: setInterval(() => {
|
||||
forceRender((x) => !x);
|
||||
}, 100);
|
||||
|
||||
return () => clearInterval(interval);
|
||||
}, []);
|
||||
}, [preloader]);
|
||||
|
||||
const itemClasses = classNames({
|
||||
const itemClasses = classNames('loader-item', {
|
||||
'dark:bg-white bg-black': !forceTheme,
|
||||
'bg-white': forceTheme === 'dark',
|
||||
'bg-black': forceTheme === 'light',
|
||||
@@ -29,8 +36,11 @@ export const Loader = ({ size = 'large', forceTheme }: LoaderProps) => {
|
||||
const items = size === 'small' ? 9 : 16;
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center" data-testid="loader">
|
||||
<div className={`${wrapperClasses} flex flex-wrap`}>
|
||||
<div
|
||||
className="flex flex-col items-center pre-loader-center"
|
||||
data-testid="loader"
|
||||
>
|
||||
<div className={`${wrapperClasses} flex flex-wrap pre-loader-wrapper`}>
|
||||
{new Array(items).fill(null).map((_, i) => {
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user