Compare commits

...
Author SHA1 Message Date
mattrussell36 4b86b981b3 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-09 12:08:41 +00:00
Radosław Szpiech 615748548b chore: remove chainID request to wallet in e2e (#2370) 2022-12-09 12:08:26 +01:00
Edd 13c9dffc3d feat(explorer): add withdrawsubmission view (#2366)
* feat(explorer): add withdraw view
* fix(explorer): regenerate types after rebasing develop
2022-12-09 11:02:01 +00:00
macqbatandcandida-d fa8868d42a feat(2298): handle lost connection with wallet during order setting (#2344)
* feat: handle lost connection with wallet during order setting

* Update libs/deal-ticket/src/components/deal-ticket/deal-ticket-manager.tsx

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>

* feat: handle lost connection with wallet during order setting - adjust wording

* feat: handle lost connection with wallet during order setting - adjust wording

* feat: handle lost connection with wallet during order setting - adjust wording

* fix: handle lost connection with wallet add print vega version

* fix: handle lost connection with wallet add print vega version

Co-authored-by: candida-d <62548908+candida-d@users.noreply.github.com>
2022-12-09 11:33:13 +01:00
mattrussell36 d382887b95 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-09 06:08:22 +00:00
mattrussell36 74265b25d7 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-09 00:10:15 +00:00
botond 2211abbd72 chore: cleanup type gen (#2362)
* chore: remove apollo type gen and clean up types lib

* fix: format

* fix: tests

* fix: format

* fix: hammer token types til sh*t turns green

* fix: format

* fix: apparently format again

* fix: lint

* fix: build-specs

* fix: format

* chore: regen types

* chore: regenerate types again

* fix: format
2022-12-08 21:13:30 +00:00
mattrussell36 e5fe6a3106 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-08 18:08:33 +00:00
Sam KeenandDexter Edwards 86e4280680 feat(2089): second level validator table mouseovers (#2354)
* feat(1913): validator table column heading mouseovers

* feat(2089): stake needed for promotion tooltip

* feat(2089): normalised voting power tooltip

* feat(2089): total stake tooltip

* feat(2089): total stake tooltip for standby-pending-validators-table

* feat(2089): total penalties tooltip

* feat(2089): tooltip colour tweakage

* feat(2089): unit tests for the shared validator data functions

* feat(2089): removed unused import from tooltip.tsx

* Update apps/token/src/routes/staking/home/validator-tables/standby-pending-validators-table.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* feat(2089): tweaks from PR comments

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-12-08 14:57:11 +00:00
mattrussell36 e4afa67cd0 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-08 12:08:34 +00:00
macqbat 19c1f2f8c6 fix: lock widths of market table cells - make it durable for long values (#2360) 2022-12-08 06:30:05 -05:00
Ciaran McGhie 088c399b9f feat: add more data columns to lp dashboard (#2337)
* chore: rename column for liquidityCommited on LP market list page

* chore: organise imports in market-list.tsx

* feat: add column for last/mark price to lp-dashboard

* feat: add column for 24h change to lp-dashboard

* feat: add column for market type in lp-dashboard

* feat: add column for market code to lp-dashboard
2022-12-08 11:18:37 +00:00
Joe Tsang f1f775268f test(2306): token acs (#2352)
* chore: add acs to wallet tests

* chore: additional acs added

* chore: revert explorer changes

* chore: fix lint

* chore: generate 2nd pub key in workflow

* chore: revert copy pub key test
2022-12-08 08:53:42 +00:00
Matthew Russell 09af8db1fe fix: blank page if startup subscription fails (#2357)
* feat: add loading skeleton for network loader

* feat: add timeout for subscription check
2022-12-08 08:51:01 +00:00
Matthew Russell def34a329d feat: add not found catchall page for console (#2359) 2022-12-08 08:47:30 +00:00
Matthew Russell 97a264d0b8 feat: align governance right (#2358) 2022-12-08 08:46:44 +00:00
mattrussell36 cbbec5c688 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-08 06:05:53 +00:00
mattrussell36 8880d7c5d7 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-08 00:10:31 +00:00
Sam Keen ce04dd9ff2 feat(1913): validator table column heading mouseovers (#2335) 2022-12-07 21:55:32 +00:00
mattrussell36 e37185223f chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-07 18:05:50 +00:00
Edd 1bb3233fb2 feat(explorer): order amend view (#2314)
* feat(explorer): add amend order view
2022-12-07 16:00:09 +00:00
Edd 0a11831ab0 fix(explorer): improve search errors (#2327)
* feat(explorer): clearer errors on parties and txs
2022-12-07 15:20:24 +00:00
Radosław Szpiech 9f1a1d7a1b chore: remove installing bins from workflows (#2346) 2022-12-07 15:08:01 +01:00
Dexter Edwards c0566a91b2 feat: mirror environment (#2343)
* feat: mirror environment

* style: lint

* chore: update networks to have correct data node

* chore: update netowrks to point to correct data nodes

* chore: fix build
2022-12-07 13:55:51 +00:00
mattrussell36 827cdbecc7 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-07 12:06:59 +00:00
Matthew Russell d1e0af0dbf feat(#1271): allow ethereum disconnect (#2325) 2022-12-07 04:24:40 -05:00
macqbat 46a85b8e65 fix: insufficient balance error doesn't reset validation after balance has been fulfilled (#2336)
* fix: live validation in deal ticket - reset validation after market state or account balance changes

* fix: live validation in deal ticket - reset fix lint error

* fix: live validation in deal ticket - adjust failing int test
2022-12-07 08:45:30 +01:00
mattrussell36 5db3b9c0b9 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-07 06:06:08 +00:00
m.ray 8f182a5877 chore(#2039): update ledger entries mappings (#2339) 2022-12-06 18:52:58 -08:00
mattrussell36 8d88d2cea0 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-07 00:12:30 +00:00
mattrussell36 4ebb30c957 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 18:05:46 +00:00
Dexter Edwards 3486244137 feat(2033): reorganise token site (#2313)
* chore: make proposals the home page, redirect home to proposals

* chore: reorganise the remainder of the routes

* chore: small styling bug

* fix: nav links highlighted incorrectly

* feat: rename title, rename routes to new structure, add redirects

* chore: make navbar full width

* feat: new navbar bases on trading navbar

* chore: revert change to the width of the page

* chore: make navbar reactive and support draw

* chore: move draw into its' own file

* chore: move nav into toolkit

* style: lint

* chore: trading to use navbar

* fix: uppercase navbar title

* chore: add test

* fix: merge issue

* style: lint

* test: adjust test URLs

* test: more route adjsuting

* test: fix route name

* test: change URL to be new url

* test: more path corrections

* test: more path fixes

* style: lint

* test: minor test fixes

* test: more test fixes

* test: fix incorrect paths

* test: green build plz

* chore: adjust name as per PR comments

* test: fix path

* test: fix incorrect path

* test: final test fix

* test: plz green
2022-12-06 16:00:37 +00:00
daro-maj 7c15ee6c01 chore: fix live env tests (#2329)
* chore: fix for live env test

* chore: fix formatting
2022-12-06 14:14:38 +01:00
mattrussell36 a4dd3cc49b chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 12:08:35 +00:00
macqbat ca5c3bc21d fix: live validation in deal ticket (#2315)
* fix: live validation in deal ticket

* fix: live validation in deal ticket

* fix: live validation in deal ticket

* fix: live validation in deal ticket - fix test mock generate
2022-12-06 09:09:13 +01:00
mattrussell36 5cd6bf3d46 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 06:06:18 +00:00
mattrussell36 f1d4aa1862 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-06 00:12:55 +00:00
mattrussell36 75db3b3cbd chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 18:08:13 +00:00
777d330f8e chore(test fixes): use api token in test (#2316)
* chore: clean jsonrpc wallet api methods - remove permission methods

* chore: clean jsonrpc wallet api methods - remove permission methods

* chore: clean jsonrpc wallet api methods - remove permission methods

* chore: clean jsonrpc wallet api methods - fix failing unit test

* chore: update vega_version

* chore: update vega to v0.63.0 in workflows

* chore: mock api-token in connect wallet response

* chore: fix token env in workflow

* chore: remove dummy wallet leftovers

* chore: fix asset tests

* chore: fix remaining explorer tests

* chore: increase tx timeout

* chore: remove smoke test temporarily

* chore: remove other governance smoke test

* chore: remove smoke staking test

* chore: move validator tests to regression

* chore: revert regression change because they are also running

* chore: move vega wallet tests to slow

* chore: skip tests instead

Co-authored-by: maciek <maciek@vegaprotocol.io>
Co-authored-by: Rado <szpiechrados@gmail.com>
2022-12-05 16:51:53 +00:00
mattrussell36 8697561ed6 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 12:08:29 +00:00
macqbat aafa3d7256 fix: fix empty rows on empty collateral list (#2312)
* fix: fix empty rows on empty collateral list

* fix: fix empty rows on empty collateral list

* fix: fix empty rows on empty collateral list
2022-12-05 11:05:31 +01:00
mattrussell36 5531566e2f chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 06:07:41 +00:00
mattrussell36 5da5c202f5 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 00:12:51 +00:00
mattrussell36 e2d7b1ee59 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-04 18:08:18 +00:00
mattrussell36 9d6a709fae chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-04 12:07:40 +00:00
mattrussell36 639b586e85 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-04 06:06:10 +00:00
mattrussell36 bed81eed76 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-04 00:12:33 +00:00
mattrussell36 2d19796250 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-03 18:06:10 +00:00
mattrussell36 55b4279709 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-03 12:08:06 +00:00
mattrussell36 dfb04b4971 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-03 06:08:13 +00:00
mattrussell36 14632bae15 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-03 00:11:56 +00:00
Matthew Russell 71c419a818 chore: move meta viewport back to app after next warning 2022-12-02 15:24:15 -08:00
mattrussell36 d5fef8729a chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-02 18:08:34 +00:00
Edd 8b74e63195 feat(explorer): cancel and order transaction view (#2289)
* feat(explorer): cancel & submit tx view
2022-12-02 14:58:33 +00:00
macqbat 8639cf0ff6 chore(2104): make account table ready for change from being empty to full and back (#2302)
* chore: split ag-grid table for make one empty ready for new records

* chore: split ag-grid table for make one empty fix linter issues

* chore: split ag-grid table for make one empty change implnt. Add unit test

* chore: split ag-grid table for make one empty fix failing int test
2022-12-02 13:32:54 +01:00
mattrussell36 3d760b8f15 chore: update tranches
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-02 12:06:10 +00:00
Matthew Russell 8d08ede22d chore: update document page to use page extension (#2305) 2022-12-02 10:38:43 +01:00
Joe Tsang 6352400598 chore: fixes for staking flow tests (#2303)
* chore: fixes for staking flow tests

* chore: remove commented code

* chore: fix lint
2022-12-02 09:20:30 +00:00
mattrussell36 30c440439e chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-02 06:05:58 +00:00
Matthew RussellandRado 9ddedd0b78 chore(#2004): add market status to trade header (#2269)
* feat: add status header stat, move header to own component

* chore: fix alignment of price change values when arrow is not rendered

* test: add check for market state display

* feat: add market state component and adjust queries to handle sub updates to market state

* test: update mocks to include data.marketState fields

* chore: add missing market state to console-lite mock

* chore: test adjustment

* fix: botched conflict resolution

* chore: update select market columns test

* chore: add missing fields to test helper functions

Co-authored-by: Rado <szpiechrados@gmail.com>
2022-12-01 16:33:30 -08:00
mattrussell36 9b356e53b4 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-02 00:12:33 +00:00
mattrussell36 4db5d37578 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-01 18:06:26 +00:00
Matthew Russell 65564f1afc chore: remove default title from issue templates 2022-12-01 09:35:52 -08:00
Edd 13d4c463cd fix(explorer): remove old chain api (#2244)
* fix(explorer): remove old chain api
2022-12-01 16:08:55 +00:00
Ciaran McGhie 7ba90904d8 feat: use Console for liquidity details for a market (#2225)
Replace our LP details page with a link to Console, which has up to date
details for each market.
2022-12-01 15:59:24 +00:00
3e75d64e0d chore: regenerate types (#2295)
* chore: regenerate types

* chore: remove unneeded type helper

* test: fix test

* chore: add wait for wallet dialog to disappear

* chore: add wallet teardown

Co-authored-by: sam-keen <samuel.kleinmann@gmail.com>
Co-authored-by: Joe <joe@vega.xyz>
2022-12-01 15:23:13 +00:00
mattrussell36 3baad78bb7 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-01 12:06:46 +00:00
Sam Keen a30f2227c4 feat(2025): validator table broken into sub-tables (#2290)
* feat(2025): validator table broken into sub-tables and showing all the new data

* feat(2025): fixed test broken due to a refactor

* feat(2025): removed unused redundancy in shared.tsx

* feat(2025): tweak to types import location in consensus-validators-table.spec.tsx

* feat(2025): removed tests for deleted validator table elements
2022-12-01 11:39:15 +00:00
Dexter Edwards cf2cfad746 fix: show correct asset in rewards table (#2294) 2022-12-01 09:38:03 +00:00
mattrussell36 972325b04a chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-01 06:06:40 +00:00
Bartłomiej Głownia 17736cc985 chore: fix accounts subscription (#2276) 2022-11-30 18:54:06 -08:00
Matthew Russellandm.ray 910a3e7a7f chore: back merge release/testnet after hotfix (#2292)
* fix: orderbook decimal places issue  (#2235)

* fix: positions table fixes notional dp (#2144)

* fix: update decimals on position notional size

* fix: normalize values

* fix: fix positions unit tests

* fix: remove liquidation price

* fix: positions linting issue

* fix: remove liquidation price test

* fix: remove total summary row

* fix: remove comments

* fix: cypress test to not show trailing 0s

* fix: add back liq. price est as cell only

* fix: remove not used params

* chore: merge with release/testnet

* fix: orderbook dp

* Update libs/positions/src/lib/positions-table.spec.tsx

* fix: governance navbar link (#2247)

* fix: governance navbar link

* fix(#2245): fix gov link a tag no navlink

* fix(#2245): remove export getActiveNavLinkClassNames

* fix(#2283): use correct GQL document for withdrawal event subscription (#2291)

Co-authored-by: m.ray <16125548+MadalinaRaicu@users.noreply.github.com>
2022-11-30 17:48:35 -08:00
mattrussell36 ac17bc4b64 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-12-01 00:11:10 +00:00
mattrussell36 399a3daa4c chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-30 18:06:09 +00:00
Joe Tsang afd42f8a9a test(token test fixes): fix failing smoke tests (#2288)
* chore: fix staking view tests

* fix: staking flow test

* chore: rename variable
2022-11-30 17:53:38 +00:00
Dexter 5d3a3a6f11 ci: fix syntax 2022-11-30 16:48:51 +00:00
Dexter 077700910b ci: fix syntax 2022-11-30 16:41:29 +00:00
Dexter 84814f3476 ci: publish containers with new tag format 2022-11-30 16:37:05 +00:00
Radosław Szpiech c450f57e8d chore: fix few tests looking for connect your vega wallet string (#2284) 2022-11-30 16:52:44 +01:00
Joe Tsang 6ba7ce5e7f chore: fix workflow (#2280) 2022-11-30 15:05:48 +00:00
m.ray d823daeea4 feat(#2239): add decimal places in key details in market info (#2268) 2022-11-30 14:44:51 +00:00
Sam KeenandDexter Edwards 7c8a54b35a feat(1263): split validator page into separate tables (#2250)
* frontend-monorepo-1263 validator status of pending now named 'candidate' in the ui

* feat(1263): validator table updates, calculating penalties

* feat(1263): bit of cleanup

* feat(1263): tables built and values derived

* feat(1263): tweaks

* feat(1263): upping site max width to 1500px

* feat(1263): tweak to normalised voting power column width

* feat(1263): ensure validator rows when hovered have cursor:pointer

* feat(1263): consensus validators now have a ranking field by voting power shown in the table

* feat(1263): fixed linting errors

* feat(1263): a couple of extra tests and correct import of schema to use enums

* Update apps/token/src/routes/staking/home/validator-tables/standby-pending-validators-table.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Update apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Update apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* Update apps/token/src/routes/staking/home/validator-tables/validator-tables.tsx

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>

* feat(1263): tweaks from PR comments, initial push of util to remove 'node' from arrs

* feat(1263): updated new util to remove 'node' from 'edges'. Implemented across the monorepo

* feat(1263): cleaned up splitting validators into consensus, pending and ersatz to put into tables

* feat(1263): used decimals from app state in validator-tables.tsx

* feat(1263): removed redundant compact import

Co-authored-by: Dexter Edwards <dexter.edwards93@gmail.com>
2022-11-30 12:55:30 +00:00
Joe Tsang 5bc861b5ec chore(cypress-11): upgrade to cypress 11.2 (#2251)
* chore: upgrade to cypress 11.2

* fix: update grep tags
2022-11-30 12:32:01 +00:00
mattrussell36 2f600207f7 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-30 12:06:34 +00:00
macqbat b67bc33c49 chore(2220): partial live update of market dropdown (#2263)
* chore: partial live update of market dropdown

* chore: partial live update of market dropdown

* chore: partial live update of market dropdown - some refactor

* chore: partial live update of market dropdown - some refactor

* chore: partial live update of market dropdown - fix lint error

* chore: partial live update of market dropdown - fix failing tests

* chore: partial live update of market dropdown - fix failing tests
2022-11-30 12:02:59 +01:00
Joe Tsang 03f659ebb3 chore: update capsule files (#2275)
* chore: update capsule files

* chore: revert cypress config space

* chore: remove wallet block
2022-11-30 10:48:22 +00:00
Edd 96843cd2be fix(explorer): refactor chain event view error handling (#2233)
* feat(explorer): change chain event tx error handling
2022-11-30 09:40:49 +00:00
Matthew Russell af7a5630ac chore: update issue templates with title (#2272) 2022-11-30 10:25:50 +01:00
mattrussell36 512149e491 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-30 06:07:18 +00:00
mattrussell36 aada0a805a chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-30 00:13:21 +00:00
mattrussell36 9e935449ae chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-29 18:08:36 +00:00
mattrussell36 d5b4ae7e53 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-29 12:06:25 +00:00
Matthew Russell 995f1f1eaf fix: text color of no data message, add connect buttons to trade grid user section (#2246) 2022-11-29 08:45:35 +01:00
mattrussell36 02410df2d7 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-29 06:07:57 +00:00
mattrussell36 0d8f14e050 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-29 00:13:31 +00:00
Matthew Russellandm.ray c2d2985e92 chore: back merge release/testnet (#2248)
* fix: orderbook decimal places issue  (#2235)

* fix: positions table fixes notional dp (#2144)

* fix: update decimals on position notional size

* fix: normalize values

* fix: fix positions unit tests

* fix: remove liquidation price

* fix: positions linting issue

* fix: remove liquidation price test

* fix: remove total summary row

* fix: remove comments

* fix: cypress test to not show trailing 0s

* fix: add back liq. price est as cell only

* fix: remove not used params

* chore: merge with release/testnet

* fix: orderbook dp

* Update libs/positions/src/lib/positions-table.spec.tsx

* fix: governance navbar link (#2247)

* fix: governance navbar link

* fix(#2245): fix gov link a tag no navlink

* fix(#2245): remove export getActiveNavLinkClassNames

Co-authored-by: m.ray <16125548+MadalinaRaicu@users.noreply.github.com>
2022-11-29 00:02:24 +00:00
Matthew Russell 02f56dd0ec feat(#2050): support new desktop wallet release (#2083)
* feat: make a single button to connect to either wallet gui or cli

* chore: update token to use jsonrpc connector

* chore: update stray connector-cli entry

* chore: update mock queries to return matching chain id, change tests to connecting using jsonRpc

* chore: add type map for TIF short code

* chore: update data testid as cli and gui are combined into jsonRpc

* chore: remove unused env vars and update readme
2022-11-28 12:16:53 -08:00
mattrussell36 88263df9c2 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-28 18:08:54 +00:00
71890d662a test: 2059 migrate trading e2e tests to use vegawallet v2 (#2175)
* test: trading e2e switched to use v2 wallet

* chore: fix remove transaction from storage

* chore: mock for v2 wallet transactions added

* test: added new mock for transaction, updated deal ticket and withdraw tests

* chore: skipped some mock to allow wallet connection

* chore: remove unused function

* chore: dont make chain id check when in test

* chore: fix lint warnings

* chore: fix trading fills test by ensuring correct pubkey is used for connection

* chore: add comment for cypress check in json rpc connect flow

* chore: add chainID mock

* chore: add data-testId to order list status cell

* chore: fix testid

* chore: fix trading-portfolio test

* chore: revert marigin test changes

* chore: improve tests regarding wallet connection

* chore: reuse ordersubmission type in test

* chore: apply connect vega wallet changes to console-lite-e2e

* chore: trigger lint

Co-authored-by: Matthew Russell <mattrussell36@gmail.com>
Co-authored-by: Bartłomiej Głownia <bglownia@gmail.com>
2022-11-28 18:07:15 +01:00
m.ray 081c9f44ae fix: orderbook decimal places issue (#2235) (#2237)
* fix: positions table fixes notional dp (#2144)

* fix: update decimals on position notional size

* fix: normalize values

* fix: fix positions unit tests

* fix: remove liquidation price

* fix: positions linting issue

* fix: remove liquidation price test

* fix: remove total summary row

* fix: remove comments

* fix: cypress test to not show trailing 0s

* fix: add back liq. price est as cell only

* fix: remove not used params

* chore: merge with release/testnet

* fix: orderbook dp

* Update libs/positions/src/lib/positions-table.spec.tsx
2022-11-28 15:15:18 +00:00
Radosław Szpiechandmaciek c60e5841f7 chore: add regression tagged tests to PR runs (#2242)
* chore: fix trading-portfolio test

* chore: fix wallet connect

* chore: fix failing deal ticket validation test

* chore: add regression tagged tests to be run during pr checks

* chore: skip parties tests in explorer-e2e

Co-authored-by: maciek <maciek@vegaprotocol.io>
2022-11-28 15:13:57 +01:00
mattrussell36 96e082cb5d chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-28 12:06:48 +00:00
mattrussell36 152574ebb3 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-28 06:08:21 +00:00
mattrussell36 b5f42ad715 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-28 00:10:50 +00:00
mattrussell36 86b0c6db3e chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-27 18:06:14 +00:00
mattrussell36 3aed0b2e5f chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-27 12:06:29 +00:00
mattrussell36 9c228c082f chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-27 06:06:30 +00:00
mattrussell36 aa7bed137b chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-27 00:11:14 +00:00
mattrussell36 1b4ffb6f1f chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-26 18:07:20 +00:00
mattrussell36 e2e6ec40b7 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-26 12:06:37 +00:00
mattrussell36 8a9fa1efdc chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-26 06:06:31 +00:00
mattrussell36 60d1434c40 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-26 00:10:06 +00:00
Edd d5efae6419 fix(explorer): avoid caching block list, cache block by id (#2238) 2022-11-25 19:58:13 +00:00
Edd 8489d50024 fix(explorer): remove old urls from default env (#2234) 2022-11-25 18:54:49 +00:00
mattrussell36 7af2580512 chore: update tranches
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-11-25 18:07:33 +00:00
620 changed files with 15205 additions and 8349 deletions
@@ -1,28 +0,0 @@
inputs:
all:
description: 'Install all binaries'
default: false
version:
description: 'Vega version'
gobin:
description: 'GOBIN path'
default: '/home/runner/go/bin'
runs:
using: 'composite'
steps:
- name: Install Vega binaries
shell: bash
run: |
wget 'https://github.com/vegaprotocol/vega/releases/download/${{ inputs.version }}/vega-linux-amd64.zip' -q
unzip vega-linux-amd64.zip -d ${{ inputs.gobin }}
- name: Checkout vegawallet-dummy
uses: actions/checkout@v3
with:
repository: 'vegaprotocol/vegawallet-dummy'
path: './dummy'
- name: Install vegawallet-dummy binaries
shell: bash
run: go install
working-directory: ./dummy
@@ -1,26 +1,6 @@
inputs:
github-token:
description: 'github token'
runs:
using: 'composite'
steps:
- name: Checkout capsule
uses: actions/checkout@v2
with:
repository: vegaprotocol/vegacapsule
ref: main
token: ${{ inputs.github-token }}
path: './capsule'
- name: Build capsule
run: go install
shell: bash
working-directory: capsule
- name: Login to docker
shell: bash
run: echo -n ${{ inputs.github-token }} | docker login https://ghcr.io -u vega-ci-bot --password-stdin
- name: Start nomad
shell: bash
run: vegacapsule nomad &
@@ -1,6 +1,10 @@
inputs:
passphrase:
description: 'Wallet password'
outputs:
token:
description: 'api-token of wallet'
value: ${{ steps.generate-api-token.outputs.api-token }}
runs:
using: 'composite'
steps:
@@ -16,10 +20,23 @@ runs:
shell: bash
run: vega wallet import -w capsule_wallet --recovery-phrase-file ./frontend-monorepo/vegacapsule/recovery -p ./passphrase --home ~/.vegacapsule/testnet/wallet
- name: Generate second public key
shell: bash
run: vega wallet key generate -w capsule_wallet -p ./passphrase --home ~/.vegacapsule/testnet/wallet
- name: Import network
shell: bash
run: vega wallet network import --force --from-file ./frontend-monorepo/vegacapsule/wallet-config.toml --home ~/.vegacapsule/testnet/wallet
- name: Init api-token
shell: bash
run: vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file passphrase
- name: Generate api-token
id: generate-api-token
shell: bash
run: echo api-token=$(vega wallet api-token generate --wallet-name capsule_wallet --tokens-passphrase-file passphrase --wallet-passphrase-file passphrase --home ~/.vegacapsule/testnet/wallet | grep -Eo '[a-zA-Z0-9]{64}') >> $GITHUB_OUTPUT
- name: Start service using capsule network
shell: bash
run: vegawallet-dummy service run --network DV --wallet capsule_wallet --passphrase-file ./passphrase --home ~/.vegacapsule/testnet/wallet &
run: vega wallet service run -n DV --load-tokens --tokens-passphrase-file passphrase --no-version-check --automatic-consent --home ~/.vegacapsule/testnet/wallet &
+14 -1
View File
@@ -3,6 +3,10 @@ inputs:
description: 'Recovery phrase'
passphrase:
description: 'Wallet password'
outputs:
token:
description: 'api-token of wallet'
value: ${{ steps.generate-api-token.outputs.api-token }}
runs:
using: 'composite'
steps:
@@ -30,6 +34,15 @@ runs:
shell: bash
run: vega wallet network import --from-url="https://raw.githubusercontent.com/vegaprotocol/networks-internal/main/stagnet3/vegawallet-stagnet3.toml" --force --home ~/.vegacapsule/testnet/wallet
- name: Init api-token
shell: bash
run: vega wallet api-token init --home ~/.vegacapsule/testnet/wallet --passphrase-file passphrase
- name: Generate api-token
id: generate-api-token
shell: bash
run: echo api-token=$(vega wallet api-token generate --wallet-name UI_Trading_Test --tokens-passphrase-file passphrase --wallet-passphrase-file passphrase --home ~/.vegacapsule/testnet/wallet | grep -Eo '[a-zA-Z0-9]{64}') >> $GITHUB_OUTPUT
- name: Start service using stagnet3 network
shell: bash
run: vegawallet-dummy service run --network stagnet3 --wallet UI_Trading_Test --passphrase-file ./passphrase --home ~/.vegacapsule/testnet/wallet &
run: vega wallet service run -n stagnet3 --load-tokens --tokens-passphrase-file passphrase --no-version-check --automatic-consent --home ~/.vegacapsule/testnet/wallet &
@@ -26,10 +26,6 @@ on:
required: false
type: boolean
default: false
env:
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.62.1'
jobs:
manual:
name: Run Cypress tests -- manual trigger
@@ -43,8 +39,6 @@ jobs:
run: echo SKIP_NX_CACHE="--skip-nx-cache" >> $GITHUB_ENV
outputs:
vega-version: ${{env.VEGA_VERSION}}
gobin: ${{env.GOBIN}}
skip-cache: ${{env.SKIP_NX_CACHE}}
tags: ${{env.TAGS}}
@@ -54,7 +48,5 @@ jobs:
secrets: inherit
with:
project: ${{ inputs.project }}
vega-version: ${{needs.manual.outputs.vega-version}}
gobin: ${{needs.manual.outputs.gobin}}
skip-cache: ${{needs.manual.outputs.skip-cache}}
tags: ${{needs.manual.outputs.tags}}
@@ -13,7 +13,5 @@ jobs:
secrets: inherit
with:
project: '[console-lite-e2e, explorer-e2e, liquidity-provision-dashboard-e2e, stats-e2e, token-e2e, trading-e2e]'
vega-version: 'v0.62.1'
gobin: /home/runner/go/bin
tags: --env.grepTags '[ @smoke, @regression, @slow ]'
night-run: true
+1 -10
View File
@@ -11,11 +11,6 @@ on:
- reopened
- synchronize
- ready_for_review
env:
GOBIN: /home/runner/go/bin
VEGA_VERSION: 'v0.62.1'
jobs:
pr:
runs-on: ubuntu-latest
@@ -56,8 +51,6 @@ jobs:
outputs:
projects: ${{ env.AFFECTED }}
vega-version: ${{ env.VEGA_VERSION }}
gobin: ${{ env.GOBIN }}
dispatch:
needs: pr
@@ -65,6 +58,4 @@ jobs:
secrets: inherit
with:
project: ${{ needs.pr.outputs.projects }}
vega-version: ${{needs.pr.outputs.vega-version}}
gobin: ${{needs.pr.outputs.gobin}}
tags: "--env.grepTags='@smoke'"
tags: "--env.grepTags='[ @smoke, @regression ]'"
+2 -21
View File
@@ -7,13 +7,6 @@ on:
required: true
type: string
default: 'false'
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
@@ -26,10 +19,6 @@ jobs:
if: ${{ inputs.trigger == 'true' }}
runs-on: self-hosted
steps:
# Add GOBIN to PATH
- name: Add GOBIN to PATH
run: echo ${{ inputs.gobin }} >> $GITHUB_PATH
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v3
@@ -51,21 +40,12 @@ jobs:
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
#######
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
######
## Setup a Vega wallet for our user
######
- name: Set up Vegawallet
id: setup-vega
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
with:
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
@@ -83,3 +63,4 @@ jobs:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
+2 -19
View File
@@ -7,13 +7,6 @@ on:
required: true
type: string
default: 'false'
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
@@ -31,10 +24,6 @@ jobs:
runs-on: self-hosted
timeout-minutes: 30
steps:
# Add GOBIN to PATH
- name: Add GOBIN to PATH
run: echo ${{ inputs.gobin }} >> $GITHUB_PATH
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v3
@@ -60,22 +49,15 @@ jobs:
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
- name: Build and run Vegacapsule network
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
with:
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
######
## Setup a Vega wallet for our user
######
- name: Set up Vegawallet for docker
id: setup-vega
uses: ./frontend-monorepo/.github/actions/setup-vegawallet-docker
with:
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
@@ -97,6 +79,7 @@ jobs:
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_NIGHTLY_RUN: ${{ inputs.night-run }}
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
######
## Upload logs
+2 -19
View File
@@ -7,13 +7,6 @@ on:
required: true
type: string
default: 'false'
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
@@ -27,10 +20,6 @@ jobs:
runs-on: self-hosted
timeout-minutes: 60
steps:
# Add GOBIN to PATH
- name: Add GOBIN to PATH
run: echo ${{ inputs.gobin }} >> $GITHUB_PATH
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v3
@@ -56,22 +45,15 @@ jobs:
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
- name: Build and run Vegacapsule network
uses: ./frontend-monorepo/.github/actions/run-vegacapsule
with:
github-token: ${{ secrets.VEGA_CI_BOT_GITHUB_TOKEN }}
######
## Setup a Vega wallet for our user
######
- name: Set up Vegawallet for docker
id: setup-vega
uses: ./frontend-monorepo/.github/actions/setup-vegawallet-docker
with:
passphrase: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
@@ -92,6 +74,7 @@ jobs:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
######
## Upload logs
+4 -21
View File
@@ -7,13 +7,6 @@ on:
required: true
type: string
default: 'false'
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
@@ -27,10 +20,8 @@ jobs:
timeout-minutes: 30
runs-on: self-hosted
steps:
# Add GOBIN to PATH
- name: Add GOBIN to PATH
run: echo ${{ inputs.gobin }} >> $GITHUB_PATH
- name: check version
run: vega version
# Checkout front ends
- name: Checkout frontend mono repo
uses: actions/checkout@v3
@@ -52,21 +43,12 @@ jobs:
run: yarn install --frozen-lockfile
working-directory: frontend-monorepo
#######
## Build and run Vegacapsule network
#######
- name: Install Vega binaries
uses: ./frontend-monorepo/.github/actions/install-vega-binaries
with:
version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
######
## Setup a Vega wallet for our user
######
- name: Set up Vegawallet
id: setup-vega
uses: ./frontend-monorepo/.github/actions/setup-vegawallet
with:
recovery: ${{ secrets.TRADING_TEST_VEGA_WALLET_RECOVERY }}
@@ -84,3 +66,4 @@ jobs:
CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE: ${{ secrets.CYPRESS_TRADING_TEST_VEGA_WALLET_PASSPHRASE }}
CYPRESS_SLACK_WEBHOOK: ${{ secrets.CYPRESS_SLACK_WEBHOOK }}
CYPRESS_ETH_WALLET_MNEMONIC: ${{ secrets.CYPRESS_ETH_WALLET_MNEMONIC }}
CYPRESS_VEGA_WALLET_API_TOKEN: ${{ steps.setup-vega.outputs.token }}
@@ -4,7 +4,7 @@ name: Publish docker containers
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-pre[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch:
inputs:
-15
View File
@@ -4,13 +4,6 @@ on:
project:
required: true
type: string
vega-version:
required: true
type: string
gobin:
required: false
type: string
default: /home/runner/go/bin
skip-cache:
required: false
type: string
@@ -27,8 +20,6 @@ jobs:
secrets: inherit
with:
trigger: ${{ contains(inputs.project, 'console-lite-e2e') || contains(inputs.project, 'console-lite') }}
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
@@ -37,8 +28,6 @@ jobs:
secrets: inherit
with:
trigger: ${{ contains(inputs.project, 'explorer-e2e') || contains(inputs.project, 'explorer') }}
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
night-run: ${{ inputs.night-run }}
@@ -60,8 +49,6 @@ jobs:
secrets: inherit
with:
trigger: ${{ contains(inputs.project, 'token-e2e') || contains(inputs.project, 'token') }}
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
@@ -70,7 +57,5 @@ jobs:
secrets: inherit
with:
trigger: ${{ contains(inputs.project, 'trading-e2e') || contains(inputs.project, 'trading') }}
vega-version: ${{ inputs.vega-version }}
gobin: ${{ inputs.gobin }}
skip-cache: ${{ inputs.skip-cache }}
tags: ${{ inputs.tags }}
+5 -5
View File
@@ -88,12 +88,12 @@ Run `nx test my-app` to execute the unit tests with [Jest](https://jestjs.io), o
### Using wallet
To run tests locally using your own wallets you can add the following environment variables to `cypress.json`
To run tests locally using your own wallets make sure you have generated at least two public keys and update the following environment variables in `cypress.config.js` to match your wallet.
1. Change `TRADING_TEST_VEGA_WALLET_NAME` to your Vega wallet name
2. Add `TRADING_TEST_VEGA_WALLET_PASSPHRASE` as your wallet passphrase
3. Add `ETH_WALLET_MNEMONIC` as your Ethereum wallet mnemonic
4. Use [vegawallet-dummy](https://github.com/vegaprotocol/vegawallet-dummy) to avoid being prompted in CLI during test execution.
1. Set `VEGA_PUBLIC_KEY` and `TRUNCATED_VEGA_PUBLIC_KEY` to your first public key.
2. Set `VEGA_PUBLIC_KEY2` and `TRUNCATED_VEGA_PUBLIC_KEY2` to your second public key.
3. Set `TRADING_TEST_VEGA_WALLET_PASSPHRASE` as your wallet passphrase
4. Add `ETH_WALLET_MNEMONIC` as your Ethereum wallet mnemonic
### Formatting
+1
View File
@@ -7,3 +7,4 @@ NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_VEGA_EXPLORER_URL=https://stagnet3.explorer.vega.xyz
NX_VEGA_WALLET_URL=http://localhost:1789
CYPRESS_VEGA_ENV=STAGNET3
CYPRESS_VEGA_WALLET_API_TOKEN=
+1 -2
View File
@@ -4,7 +4,7 @@ module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
require('cypress-grep/src/plugin')(config);
require('@cypress/grep/src/plugin')(config);
return config;
},
baseUrl: 'http://localhost:4200',
@@ -23,7 +23,6 @@ module.exports = defineConfig({
viewportHeight: 900,
},
env: {
TRADING_TEST_VEGA_WALLET_NAME: 'UI_Trading_Test',
ETHEREUM_PROVIDER_URL:
'https://sepolia.infura.io/v3/4f846e79e13f44d1b51bbd7ed9edefb8',
VEGA_PUBLIC_KEY:
+20
View File
@@ -0,0 +1,20 @@
/// <reference types="cypress" />
declare namespace Cypress {
// specify additional properties in the TestConfig object
// in our case we will add "tags" property
interface SuiteConfigOverrides {
/**
* List of tags for this test
* @example a single tag
* it('logs in', { tags: '@smoke' }, () => { ... })
* @example multiple tags
* it('works', { tags: ['@smoke', '@slow'] }, () => { ... })
*/
tags?: string | string[];
}
interface Cypress {
grep?: (grep?: string, tags?: string, burn?: string) => void;
}
}
@@ -1,4 +1,3 @@
import { connectVegaWallet } from '../support/vega-wallet';
import { aliasQuery } from '@vegaprotocol/cypress';
import {
generateMarket,
@@ -52,7 +51,7 @@ describe('market selector', { tags: '@smoke' }, () => {
it('should be properly rendered', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('input[placeholder="Search"]').should(
'have.value',
markets[0].tradableInstrument.instrument.name
@@ -76,7 +75,7 @@ describe('market selector', { tags: '@smoke' }, () => {
it('typing should change list', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('input[placeholder="Search"]').type('{backspace}');
cy.getByTestId('market-pane')
.children()
@@ -112,7 +111,7 @@ describe('market selector', { tags: '@smoke' }, () => {
it.skip('keyboard navigation should work well', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('input[placeholder="Search"]').type('{backspace}');
cy.get('input[placeholder="Search"]').clear();
cy.focused().realPress('ArrowDown');
@@ -134,7 +133,7 @@ describe('market selector', { tags: '@smoke' }, () => {
if (markets?.length) {
cy.viewport('iphone-xr');
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('[role="dialog"]').should('not.exist');
cy.getByTestId('arrow-button').click();
cy.get('[role="dialog"]').should('be.visible');
@@ -1,4 +1,3 @@
import { connectVegaWallet } from '../support/vega-wallet';
import { aliasQuery } from '@vegaprotocol/cypress';
import {
generateSimpleMarkets,
@@ -63,7 +62,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('side selector should work well', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').should(
'have.text',
'Long'
@@ -82,7 +81,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
if (markets?.length) {
cy.viewport('iphone-xr');
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.getByTestId('next-button').scrollIntoView().click();
cy.get('button[aria-label="Open long position"]').should(
@@ -114,7 +113,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('size slider should work well', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -136,7 +135,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('percentage selection should work well', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -163,7 +162,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('size input should work well', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -191,7 +190,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('slippage value should be displayed', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -207,7 +206,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('allow slippage value to be adjusted', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -235,7 +234,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('notional position size should be present', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -262,7 +261,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('total fees should be displayed', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[1].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-1-control [aria-label^="Selected value"]').click();
cy.get('button[aria-label="Open short position"]').click();
cy.get('#step-2-control').click();
@@ -280,7 +279,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
it('order review should display proper calculations', () => {
if (markets?.length) {
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-3-control').click();
cy.getByTestId('review-trade')
@@ -310,7 +309,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
if (markets?.length) {
cy.viewport('iphone-xr');
cy.visit(`/trading/${markets[0].id}`);
connectVegaWallet();
cy.connectVegaWallet();
cy.get('#step-3-control').click();
// Start from the bottom tooltip to ensure the tooltip above
@@ -1,4 +1,3 @@
import { connectVegaWallet } from '../support/vega-wallet';
import { aliasQuery } from '@vegaprotocol/cypress';
import {
generatePositions,
@@ -22,7 +21,7 @@ describe('Portfolio page - wallet', { tags: '@smoke' }, () => {
cy.visit('/');
cy.get('[href="/portfolio"]').eq(0).click();
cy.getByTestId('trading-connect-wallet').should('be.visible');
connectVegaWallet();
cy.connectVegaWallet();
cy.getByTestId('trading-connect-wallet').should('not.exist');
});
});
@@ -43,7 +42,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
it('certain tabs should exist', () => {
cy.visit('/portfolio');
connectVegaWallet();
cy.connectVegaWallet();
cy.getByTestId('assets').click();
cy.location('pathname').should('eq', '/portfolio/assets');
@@ -74,7 +73,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
aliasQuery(req, 'Assets', generateAssets());
});
cy.visit('/portfolio/assets');
connectVegaWallet();
cy.connectVegaWallet();
});
it('data should be properly rendered', () => {
@@ -105,7 +104,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
aliasQuery(req, 'Assets', generateAssets());
});
cy.visit('/portfolio/positions');
connectVegaWallet();
cy.connectVegaWallet();
});
it('data should be properly rendered', () => {
@@ -122,7 +121,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
aliasQuery(req, 'Markets', generateFillsMarkets());
});
cy.visit('/portfolio/orders');
connectVegaWallet();
cy.connectVegaWallet();
});
it('data should be properly rendered', () => {
@@ -139,7 +138,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
aliasQuery(req, 'Markets', generateFillsMarkets());
});
cy.visit('/portfolio/fills');
connectVegaWallet();
cy.connectVegaWallet();
});
it('data should be properly rendered', () => {
@@ -166,7 +165,7 @@ describe('Portfolio page tabs', { tags: '@smoke' }, () => {
aliasQuery(req, 'MarketsData', generateMarketsData());
});
cy.visit('/portfolio');
connectVegaWallet();
cy.connectVegaWallet();
});
it('"No data to display" should be always displayed', () => {
+1 -1
View File
@@ -17,7 +17,7 @@ import '@vegaprotocol/cypress';
import 'cypress-real-events/support';
// Import commands.js using ES2015 syntax:
import './commands';
import registerCypressGrep from 'cypress-grep';
import registerCypressGrep from '@cypress/grep';
import { aliasQuery } from '@vegaprotocol/cypress';
registerCypressGrep();
@@ -1,5 +1,5 @@
import type { Market } from '@vegaprotocol/market-list';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { SingleMarketFieldsFragment } from '@vegaprotocol/market-list';
export const protoCandles = [
@@ -1,6 +1,6 @@
import merge from 'lodash/merge';
import type { AccountsQuery } from '@vegaprotocol/accounts';
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import type { PartialDeep } from 'type-fest';
export const generateAccounts = (
@@ -1,6 +1,6 @@
import merge from 'lodash/merge';
import type { AssetsQuery } from '@vegaprotocol/assets';
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import type { PartialDeep } from 'type-fest';
export const generateAssets = (override?: PartialDeep<AssetsQuery>) => {
@@ -1,5 +1,5 @@
import type { FillsQuery, FillFieldsFragment } from '@vegaprotocol/fills';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import merge from 'lodash/merge';
import type { PartialDeep } from 'type-fest';
@@ -1,7 +1,7 @@
import merge from 'lodash/merge';
import type { PartialDeep } from 'type-fest';
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import type { MarketDepthQuery } from '../../../../../libs/market-depth/src/lib/__generated___/MarketDepth';
import type { MarketDepthQuery } from '../../../../../libs/market-depth/src/lib/__generated__/MarketDepth';
export const generateMarketDepth = (
override?: PartialDeep<MarketDepthQuery>
@@ -1,5 +1,5 @@
import type { MarketPositionsQuery } from '@vegaprotocol/deal-ticket';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
export const generateMarketPositions = (): MarketPositionsQuery => {
return {
@@ -1,5 +1,5 @@
import merge from 'lodash/merge';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type {
MarketsQuery,
Market,
@@ -1413,6 +1413,7 @@ export const generateMarketData = (): MarketDataQuery => {
},
marketTradingMode:
Schema.MarketTradingMode.TRADING_MODE_CONTINUOUS,
marketState: Schema.MarketState.STATE_ACTIVE,
staticMidPrice: '0',
indicativePrice: '0',
bestStaticBidPrice: '0',
@@ -1,7 +1,7 @@
import merge from 'lodash/merge';
import type { PartialDeep } from 'type-fest';
import type { OrdersQuery, OrderFieldsFragment } from '@vegaprotocol/orders';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
export const generateOrders = (
override?: PartialDeep<OrdersQuery>
@@ -1,7 +1,7 @@
import merge from 'lodash/merge';
import type { PartyBalanceQuery } from '@vegaprotocol/deal-ticket';
import type { PartialDeep } from 'type-fest';
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
export const generatePartyBalance = (
override?: PartialDeep<PartyBalanceQuery>
@@ -1,5 +1,5 @@
import type { PartyMarketDataQuery } from '@vegaprotocol/deal-ticket';
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
export const generatePartyMarketData = (): PartyMarketDataQuery => {
return {
@@ -1,12 +0,0 @@
export const connectVegaWallet = () => {
const form = 'rest-connector-form';
const walletName = Cypress.env('TRADING_TEST_VEGA_WALLET_NAME');
const walletPassphrase = Cypress.env('TRADING_TEST_VEGA_WALLET_PASSPHRASE');
cy.getByTestId('connect-vega-wallet').click();
cy.getByTestId('connectors-list')
.find('[data-testid="connector-gui"]')
.click();
cy.getByTestId(form).find('#wallet').click().type(walletName);
cy.getByTestId(form).find('#passphrase').click().type(walletPassphrase);
cy.getByTestId('rest-connector-form').find('button[type=submit]').click();
};
+2 -2
View File
@@ -7,7 +7,7 @@
"allowSyntheticDefaultImports": true,
"outDir": "../../dist/out-tsc",
"allowJs": true,
"types": ["cypress", "node", "cypress-real-events", "cypress-grep"]
"types": ["cypress", "node", "cypress-real-events", "@cypress/grep"]
},
"include": ["src/**/*.ts", "src/**/*.js", "./declaration.d.ts"]
"include": ["src/**/*.ts", "src/**/*.js", "./declaration.d.ts", "index.d.ts"]
}
@@ -1,51 +1,54 @@
/* tslint:disable */
/* eslint-disable */
// @generated
// This file was automatically generated and should not be edited.
import * as Types from '@vegaprotocol/types';
// ====================================================
// GraphQL query operation: MarketTags
// ====================================================
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type MarketTagsQueryVariables = Types.Exact<{
marketId: Types.Scalars['ID'];
}>;
export interface MarketTags_market_tradableInstrument_instrument_metadata {
__typename: "InstrumentMetadata";
/**
* An arbitrary list of tags to associated to associate to the Instrument (string list)
*/
tags: string[] | null;
export type MarketTagsQuery = { __typename?: 'Query', market?: { __typename?: 'Market', tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null } } } } | null };
export const MarketTagsDocument = gql`
query MarketTags($marketId: ID!) {
market(id: $marketId) {
tradableInstrument {
instrument {
metadata {
tags
}
}
}
}
}
`;
export interface MarketTags_market_tradableInstrument_instrument {
__typename: "Instrument";
/**
* Metadata for this instrument
*/
metadata: MarketTags_market_tradableInstrument_instrument_metadata;
}
export interface MarketTags_market_tradableInstrument {
__typename: "TradableInstrument";
/**
* An instance of, or reference to, a fully specified instrument.
*/
instrument: MarketTags_market_tradableInstrument_instrument;
}
export interface MarketTags_market {
__typename: "Market";
/**
* An instance of, or reference to, a tradable instrument.
*/
tradableInstrument: MarketTags_market_tradableInstrument;
}
export interface MarketTags {
/**
* An instrument that is trading on the Vega network
*/
market: MarketTags_market | null;
}
export interface MarketTagsVariables {
marketId: string;
}
/**
* __useMarketTagsQuery__
*
* To run a query within a React component, call `useMarketTagsQuery` and pass it any options that fit your needs.
* When your component renders, `useMarketTagsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useMarketTagsQuery({
* variables: {
* marketId: // value for 'marketId'
* },
* });
*/
export function useMarketTagsQuery(baseOptions: Apollo.QueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
}
export function useMarketTagsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
}
export type MarketTagsQueryHookResult = ReturnType<typeof useMarketTagsQuery>;
export type MarketTagsLazyQueryHookResult = ReturnType<typeof useMarketTagsLazyQuery>;
export type MarketTagsQueryResult = Apollo.QueryResult<MarketTagsQuery, MarketTagsQueryVariables>;
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -1,54 +0,0 @@
import { Schema as Types } from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type MarketTagsQueryVariables = Types.Exact<{
marketId: Types.Scalars['ID'];
}>;
export type MarketTagsQuery = { __typename?: 'Query', market?: { __typename?: 'Market', tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', metadata: { __typename?: 'InstrumentMetadata', tags?: Array<string> | null } } } } | null };
export const MarketTagsDocument = gql`
query MarketTags($marketId: ID!) {
market(id: $marketId) {
tradableInstrument {
instrument {
metadata {
tags
}
}
}
}
}
`;
/**
* __useMarketTagsQuery__
*
* To run a query within a React component, call `useMarketTagsQuery` and pass it any options that fit your needs.
* When your component renders, `useMarketTagsQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useMarketTagsQuery({
* variables: {
* marketId: // value for 'marketId'
* },
* });
*/
export function useMarketTagsQuery(baseOptions: Apollo.QueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
}
export function useMarketTagsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<MarketTagsQuery, MarketTagsQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<MarketTagsQuery, MarketTagsQueryVariables>(MarketTagsDocument, options);
}
export type MarketTagsQueryHookResult = ReturnType<typeof useMarketTagsQuery>;
export type MarketTagsLazyQueryHookResult = ReturnType<typeof useMarketTagsLazyQuery>;
export type MarketTagsQueryResult = Apollo.QueryResult<MarketTagsQuery, MarketTagsQueryVariables>;
@@ -2,7 +2,7 @@ import React from 'react';
import { render } from '@testing-library/react';
import type { AccountFragment } from '@vegaprotocol/deal-ticket';
import { DealTicketBalance } from './deal-ticket-balance';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { MarketDealTicketAsset } from '@vegaprotocol/market-list';
const tDAI: MarketDealTicketAsset = {
@@ -1,6 +1,6 @@
import classNames from 'classnames';
import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { AccountFragment } from '@vegaprotocol/deal-ticket';
import type { MarketDealTicket } from '@vegaprotocol/market-list';
import { useSettlementAccount } from '@vegaprotocol/deal-ticket';
@@ -1,11 +1,14 @@
import { useParams } from 'react-router-dom';
import compact from 'lodash/compact';
import {
DealTicketManager,
usePartyBalanceQuery,
} from '@vegaprotocol/deal-ticket';
import { Loader, Splash } from '@vegaprotocol/ui-toolkit';
import { t, useDataProvider } from '@vegaprotocol/react-helpers';
import {
t,
useDataProvider,
removePaginationWrapper,
} from '@vegaprotocol/react-helpers';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { DealTicketSteps } from './deal-ticket-steps';
import { DealTicketBalance } from './deal-ticket-balance';
@@ -46,8 +49,8 @@ export const DealTicketContainer = () => {
skip: !marketId,
});
const accounts = compact(partyData?.party?.accountsConnection?.edges).map(
(e) => e.node
const accounts = removePaginationWrapper(
partyData?.party?.accountsConnection?.edges
);
const loader = <Loader />;
@@ -1,7 +1,6 @@
import { useCallback, useEffect, useMemo, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useForm, Controller } from 'react-hook-form';
import compact from 'lodash/compact';
import { Stepper } from '../stepper';
import {
getDefaultOrder,
@@ -25,6 +24,7 @@ import {
addDecimalsFormatNumber,
addDecimal,
formatNumber,
removePaginationWrapper,
} from '@vegaprotocol/react-helpers';
import {
useOrderSubmit,
@@ -37,7 +37,7 @@ import { DealTicketSize } from './deal-ticket-size';
import MarketNameRenderer from '../simple-market-list/simple-market-renderer';
import SideSelector, { SIDE_NAMES } from './side-selector';
import ReviewTrade from './review-trade';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import { DealTicketSlippage } from './deal-ticket-slippage';
import { useOrderValidation } from './use-order-validation';
import type { MarketDealTicket } from '@vegaprotocol/market-list';
@@ -82,8 +82,8 @@ export const DealTicketSteps = ({ market }: DealTicketMarketProps) => {
skip: !pubKey,
});
const accounts = compact(partyBalance?.party?.accountsConnection?.edges).map(
(e) => e.node
const accounts = removePaginationWrapper(
partyBalance?.party?.accountsConnection?.edges
);
const maxTrade = useMaximumPositionSize({
partyId: pubKey || '',
@@ -8,28 +8,10 @@ import classNames from 'classnames';
import { DealTicketEstimates } from '@vegaprotocol/deal-ticket';
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
import { SIDE_NAMES } from './side-selector';
import { gql, useQuery } from '@apollo/client';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import { MarketExpires } from '@vegaprotocol/market-info';
import type { MarketDealTicket } from '@vegaprotocol/market-list';
import type {
MarketTags,
MarketTagsVariables,
} from './__generated__/MarketTags';
export const MARKET_TAGS_QUERY = gql`
query MarketTags($marketId: ID!) {
market(id: $marketId) {
tradableInstrument {
instrument {
metadata {
tags
}
}
}
}
}
`;
import { useMarketTagsQuery } from './__generated__/MarketTags';
interface Props {
market: MarketDealTicket;
@@ -57,12 +39,9 @@ export default ({
notionalSize,
slippage,
}: Props) => {
const { data: tagsData } = useQuery<MarketTags, MarketTagsVariables>(
MARKET_TAGS_QUERY,
{
variables: { marketId: market.id },
}
);
const { data: tagsData } = useMarketTagsQuery({
variables: { marketId: market.id },
});
return (
<div className="mb-8 text-black dark:text-white" data-testid="review-trade">
@@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { FormGroup } from '@vegaprotocol/ui-toolkit';
import { t } from '@vegaprotocol/react-helpers';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
interface SideSelectorProps {
value: Schema.Side;
@@ -3,11 +3,7 @@ import { renderHook } from '@testing-library/react';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { MockedProvider } from '@apollo/client/testing';
import type { VegaWalletContextShape } from '@vegaprotocol/wallet';
import {
MarketStateMapping,
Schema as Types,
Schema,
} from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { ValidationProps } from './use-order-validation';
import { marketTranslations, useOrderValidation } from './use-order-validation';
import type { MarketDealTicket } from '@vegaprotocol/market-list';
@@ -78,9 +74,10 @@ const market: MarketDealTicket = {
bestBidPrice: '1605489971',
bestOfferPrice: '1606823730',
markPrice: '1606823730',
trigger: Types.AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED,
trigger: Schema.AuctionTrigger.AUCTION_TRIGGER_UNSPECIFIED,
staticMidPrice: '1606156850',
marketTradingMode: Schema.MarketTradingMode.TRADING_MODE_CONTINUOUS,
marketState: Schema.MarketState.STATE_ACTIVE,
indicativeVolume: '0',
indicativePrice: '0',
bestStaticBidPrice: '1605489971',
@@ -91,7 +88,11 @@ const market: MarketDealTicket = {
auctionEnd: null,
market: { __typename: 'Market', id: 'market-id' },
},
marketTimestamps: {},
marketTimestamps: {
__typename: 'MarketTimestamps',
close: null,
open: null,
},
};
const defaultWalletContext = {
@@ -193,7 +194,11 @@ describe('useOrderValidation', () => {
`(
'Returns an error message for market state when not accepting orders',
({ state }) => {
const { result } = setup({ market: { ...defaultOrder.market, state } });
const market = {
...defaultOrder.market,
data: { ...defaultOrder.market.data, marketState: state },
};
const { result } = setup({ market });
expect(result.current).toStrictEqual({
isDisabled: true,
message: `This market is ${marketTranslations(
@@ -215,14 +220,19 @@ describe('useOrderValidation', () => {
balance: '0',
margin: '100',
balanceError: false,
// asset,
});
const { result } = setup({
market: {
...defaultOrder.market,
state,
tradingMode: Schema.MarketTradingMode.TRADING_MODE_BATCH_AUCTION,
const market = {
...defaultOrder.market,
data: {
...defaultOrder.market.data,
marketState: state,
marketTradingMode:
Schema.MarketTradingMode.TRADING_MODE_BATCH_AUCTION,
},
};
const { result } = setup({
market,
order: {
...order,
type: Schema.OrderType.TYPE_LIMIT,
@@ -231,7 +241,7 @@ describe('useOrderValidation', () => {
});
expect(result.current).toStrictEqual({
isDisabled: false,
message: `This market is ${MarketStateMapping[
message: `This market is ${Schema.MarketStateMapping[
state as Schema.MarketState
].toLowerCase()} and only accepting liquidity commitment orders`,
section: 'sec-summary',
@@ -247,8 +257,12 @@ describe('useOrderValidation', () => {
`(
`Returns an error message when trying to submit a non-limit order for a "$tradingMode" market`,
({ tradingMode, errorMessage }) => {
const market = {
...defaultOrder.market,
data: { ...defaultOrder.market.data, marketTradingMode: tradingMode },
};
const { result } = setup({
market: { ...defaultOrder.market, tradingMode },
market,
order: {
...order,
type: Schema.OrderType.TYPE_MARKET,
@@ -273,8 +287,12 @@ describe('useOrderValidation', () => {
`(
`Returns an error message when submitting a limit order with a "$orderTimeInForce" value to a "$tradingMode" market`,
({ tradingMode, orderTimeInForce, errorMessage }) => {
const market = {
...defaultOrder.market,
data: { ...defaultOrder.market.data, marketTradingMode: tradingMode },
};
const { result } = setup({
market: { ...defaultOrder.market, tradingMode },
market,
order: {
...order,
type: Schema.OrderType.TYPE_LIMIT,
@@ -377,14 +395,15 @@ describe('useOrderValidation', () => {
`(
'Returns error when market state is pending and size is wrong',
({ state }) => {
const market = {
...defaultOrder.market,
data: { ...defaultOrder.market.data, marketState: state },
};
const { result } = setup({
fieldErrors: {
size: { type: `validate`, message: DealTicket.ERROR_SIZE_DECIMAL },
},
market: {
...market,
state,
},
market,
});
expect(result.current).toStrictEqual({
isDisabled: true,
@@ -3,7 +3,7 @@ import type { FieldErrors } from 'react-hook-form';
import { useMemo } from 'react';
import { t, toDecimal } from '@vegaprotocol/react-helpers';
import { useVegaWallet } from '@vegaprotocol/wallet';
import { MarketStateMapping, Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { OrderSubmissionBody } from '@vegaprotocol/wallet';
import { Tooltip } from '@vegaprotocol/ui-toolkit';
import {
@@ -39,7 +39,7 @@ export const marketTranslations = (marketState: Schema.MarketState) => {
case Schema.MarketState.STATE_TRADING_TERMINATED:
return t('terminated');
default:
return t(MarketStateMapping[marketState]).toLowerCase();
return t(Schema.MarketStateMapping[marketState]).toLowerCase();
}
};
@@ -169,13 +169,13 @@ export const useOrderValidation = ({
Schema.MarketState.STATE_TRADING_TERMINATED,
Schema.MarketState.STATE_CANCELLED,
Schema.MarketState.STATE_CLOSED,
].includes(market.state)
].includes(market.data.marketState)
) {
return {
isDisabled: true,
message: t(
`This market is ${marketTranslations(
market.state
market.data.marketState
)} and not accepting orders`
),
section: DEAL_TICKET_SECTION.SUMMARY,
@@ -186,7 +186,7 @@ export const useOrderValidation = ({
[
Schema.MarketState.STATE_PROPOSED,
Schema.MarketState.STATE_PENDING,
].includes(market.state)
].includes(market.data.marketState)
) {
if (fieldErrorChecking) {
return fieldErrorChecking;
@@ -195,7 +195,7 @@ export const useOrderValidation = ({
isDisabled: false,
message: t(
`This market is ${marketTranslations(
market.state
market.data.marketState
)} and only accepting liquidity commitment orders`
),
section: DEAL_TICKET_SECTION.SUMMARY,
@@ -205,9 +205,9 @@ export const useOrderValidation = ({
if (isMarketInAuction(market)) {
if (order.type === Schema.OrderType.TYPE_MARKET) {
if (
market.tradingMode ===
market.data.marketTradingMode ===
Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger ===
market.data.trigger ===
Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY
) {
return {
@@ -230,9 +230,9 @@ export const useOrderValidation = ({
};
}
if (
market.tradingMode ===
market.data.marketTradingMode ===
Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger === Schema.AuctionTrigger.AUCTION_TRIGGER_PRICE
market.data.trigger === Schema.AuctionTrigger.AUCTION_TRIGGER_PRICE
) {
return {
isDisabled: true,
@@ -270,9 +270,9 @@ export const useOrderValidation = ({
].includes(order.timeInForce)
) {
if (
market.tradingMode ===
market.data.marketTradingMode ===
Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger ===
market.data.trigger ===
Schema.AuctionTrigger.AUCTION_TRIGGER_LIQUIDITY
) {
return {
@@ -297,9 +297,9 @@ export const useOrderValidation = ({
};
}
if (
market.tradingMode ===
market.data.marketTradingMode ===
Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION &&
market.data?.trigger === Schema.AuctionTrigger.AUCTION_TRIGGER_PRICE
market.data.trigger === Schema.AuctionTrigger.AUCTION_TRIGGER_PRICE
) {
return {
isDisabled: true,
@@ -355,7 +355,7 @@ export const useOrderValidation = ({
Schema.MarketTradingMode.TRADING_MODE_BATCH_AUCTION,
Schema.MarketTradingMode.TRADING_MODE_MONITORING_AUCTION,
Schema.MarketTradingMode.TRADING_MODE_OPENING_AUCTION,
].includes(market.tradingMode)
].includes(market.data.marketTradingMode)
) {
return {
isDisabled: false,
@@ -12,7 +12,7 @@ import {
t,
} from '@vegaprotocol/react-helpers';
import BigNumber from 'bignumber.js';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
interface Props {
partyId: string;
@@ -14,20 +14,14 @@ import {
import type { OrderFieldsFragment, Order } from '@vegaprotocol/orders';
import type { OrderCancellationBody } from '@vegaprotocol/wallet';
import { isOrderActive } from '@vegaprotocol/orders';
import {
OrderRejectionReasonMapping,
OrderStatusMapping,
OrderTypeMapping,
Schema,
OrderTimeInForceMapping,
} from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import BigNumber from 'bignumber.js';
import { Button } from '@vegaprotocol/ui-toolkit';
type StatusKey = keyof typeof OrderStatusMapping;
type RejectReasonKey = keyof typeof OrderRejectionReasonMapping;
type OrderTimeKey = keyof typeof OrderTimeInForceMapping;
type StatusKey = keyof typeof Schema.OrderStatusMapping;
type RejectReasonKey = keyof typeof Schema.OrderRejectionReasonMapping;
type OrderTimeKey = keyof typeof Schema.OrderTimeInForceMapping;
interface Props {
setEditOrder: (order: Order) => void;
orderCancel: {
@@ -81,7 +75,7 @@ const useColumnDefinitions = ({ setEditOrder, orderCancel }: Props) => {
value,
}: ValueFormatterParams & {
value?: OrderFieldsFragment['type'];
}) => OrderTypeMapping[value as Schema.OrderType],
}) => Schema.OrderTypeMapping[value as Schema.OrderType],
},
{
colId: 'status',
@@ -95,14 +89,14 @@ const useColumnDefinitions = ({ setEditOrder, orderCancel }: Props) => {
}) => {
if (value && data && data.market) {
if (value === Schema.OrderStatus.STATUS_REJECTED) {
return `${OrderStatusMapping[value as StatusKey]}: ${
return `${Schema.OrderStatusMapping[value as StatusKey]}: ${
data.rejectionReason &&
OrderRejectionReasonMapping[
Schema.OrderRejectionReasonMapping[
data.rejectionReason as RejectReasonKey
]
}`;
}
return OrderStatusMapping[value as StatusKey] as string;
return Schema.OrderStatusMapping[value as StatusKey] as string;
}
return '-';
},
@@ -176,11 +170,11 @@ const useColumnDefinitions = ({ setEditOrder, orderCancel }: Props) => {
new Date(data.expiresAt)
);
return `${
OrderTimeInForceMapping[value as OrderTimeKey]
Schema.OrderTimeInForceMapping[value as OrderTimeKey]
}: ${expiry}`;
}
return OrderTimeInForceMapping[value as OrderTimeKey];
return Schema.OrderTimeInForceMapping[value as OrderTimeKey];
}
return '-';
},
@@ -16,7 +16,7 @@ import type {
GroupCellRendererParams,
ColDef,
} from 'ag-grid-community';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { VegaValueFormatterParams } from '@vegaprotocol/ui-toolkit';
import { Intent, ProgressBarCell } from '@vegaprotocol/ui-toolkit';
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -1,6 +1,6 @@
import { t } from '@vegaprotocol/react-helpers';
import { themelite as theme } from '@vegaprotocol/tailwindcss-config';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import colors from 'tailwindcss/colors';
import type { Market } from '@vegaprotocol/market-list';
import { IS_MARKET_TRADABLE } from '../../constants';
@@ -9,7 +9,7 @@ import {
} from '@testing-library/react';
import { MockedProvider } from '@apollo/client/testing';
import { BrowserRouter } from 'react-router-dom';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { Market } from '@vegaprotocol/market-list';
import SimpleMarketList from './simple-market-list';
@@ -13,7 +13,7 @@ import SimpleMarketToolbar from './simple-market-toolbar';
import { IS_MARKET_TRADABLE } from '../../constants';
import { ConsoleLiteGrid } from '../console-lite-grid';
import type { Market } from '@vegaprotocol/market-list';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import { marketsWithCandlesProvider } from '@vegaprotocol/market-list';
export type MarketWithPercentChange = Market & {
@@ -4,7 +4,7 @@ import { InView } from 'react-intersection-observer';
import { useDataProvider, useYesterday } from '@vegaprotocol/react-helpers';
import type { Candle } from '@vegaprotocol/market-list';
import { marketCandlesProvider } from '@vegaprotocol/market-list';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
interface Props {
candles: (Candle | null)[] | null;
@@ -1,6 +1,6 @@
import React from 'react';
import { render, screen } from '@testing-library/react';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import MarketNameRenderer from './simple-market-renderer';
import type { Market } from '@vegaprotocol/market-list';
@@ -14,7 +14,7 @@ import {
getAllByText,
} from '@testing-library/react';
import { MockedProvider } from '@apollo/react-testing';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { Market } from '@vegaprotocol/market-list';
import SimpleMarketToolbar from './simple-market-toolbar';
import { markets as filterData } from './mocks/market-filters.json';
@@ -13,7 +13,7 @@ import {
DropdownMenuItemIndicator,
Icon,
} from '@vegaprotocol/ui-toolkit';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { Market } from '@vegaprotocol/market-list';
import { HorizontalMenu } from '../horizontal-menu';
import type { HorizontalMenuItem } from '../horizontal-menu';
@@ -1,5 +1,5 @@
import { useMemo } from 'react';
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import type { MarketWithCandles } from '@vegaprotocol/market-list';
import type { RouterParams } from './simple-market-list';
+1 -1
View File
@@ -1,4 +1,4 @@
import { Schema } from '@vegaprotocol/types';
import * as Schema from '@vegaprotocol/types';
import { t } from '@vegaprotocol/react-helpers';
import type { Market } from '@vegaprotocol/market-list';
+2
View File
@@ -16,3 +16,5 @@ NX_EXPLORER_TXS_LIST=0
NX_EXPLORER_NETWORK_PARAMETERS=1
NX_EXPLORER_PARTIES=1
NX_EXPLORER_VALIDATORS=1
CYPRESS_VEGA_WALLET_API_TOKEN=
+1 -1
View File
@@ -5,7 +5,7 @@ module.exports = defineConfig({
e2e: {
setupNodeEvents(on, config) {
require('cypress-grep/src/plugin')(config);
require('@cypress/grep/src/plugin')(config);
return config;
},
baseUrl: 'http://localhost:3000',
+14 -11
View File
@@ -47,34 +47,37 @@ context('Asset page', { tags: '@regression' }, function () {
.then((assetsListedInJson) => {
const assetInfo = this.assetsInfo[assetName];
assert.equal(assetsListedInJson.name, assetInfo.name);
assert.equal(assetsListedInJson.id, assetInfo.id);
assert.equal(assetsListedInJson.decimals, assetInfo.decimals);
assert.equal(assetsListedInJson.symbol, assetInfo.symbol);
assert.equal(assetsListedInJson.name, assetInfo.node.name);
assert.equal(assetsListedInJson.id, assetInfo.node.id);
assert.equal(
assetsListedInJson.decimals,
assetInfo.node.decimals
);
assert.equal(assetsListedInJson.symbol, assetInfo.node.symbol);
assert.equal(
assetsListedInJson.source.__typename,
assetInfo.source.__typename
assetInfo.node.source.__typename
);
if (assetInfo.source.__typename == 'ERC20') {
if (assetInfo.node.source.__typename == 'ERC20') {
assert.equal(
assetsListedInJson.source.contractAddress,
assetInfo.source.contractAddress
assetInfo.node.source.contractAddress
);
}
if (assetInfo.source.__typename == 'BuiltinAsset') {
if (assetInfo.node.source.__typename == 'BuiltinAsset') {
assert.equal(
assetsListedInJson.source.maxFaucetAmountMint,
assetInfo.source.maxFaucetAmountMint
assetInfo.node.source.maxFaucetAmountMint
);
}
let knownAssetTypes = ['BuiltinAsset', 'ERC20'];
assert.include(
knownAssetTypes,
assetInfo.source.__typename,
`Checking that current asset type of ${assetInfo.source.__typename} /
assetInfo.node.source.__typename,
`Checking that current asset type of ${assetInfo.node.source.__typename} /
is one of: ${knownAssetTypes}: /
If fail then we need to add extra tests for un-encountered asset types`
);
+1 -1
View File
@@ -50,7 +50,7 @@ context('Home Page', function () {
.invoke('text')
.should('match', /\d+d \d+h \d+m \d+s/i);
cy.get(statsValue).eq(3).should('have.text', '2');
cy.get(statsValue).eq(4).should('have.text', '0');
cy.get(statsValue).eq(4).should('have.text', '2');
cy.get(statsValue)
.eq(5)
.invoke('text')
@@ -14,7 +14,9 @@ let assetData = {
const assetsInTest = Object.keys(assetData);
context('Parties page', { tags: '@regression' }, function () {
// skipped due to existing issue
// https://github.com/vegaprotocol/frontend-monorepo/issues/2243
context.skip('Parties page', { tags: '@regression' }, function () {
before('send-faucet assets to connected vega wallet', function () {
assetsInTest.forEach((asset) => {
cy.vega_wallet_receive_fauceted_asset(
@@ -279,9 +279,9 @@ context('Validator page', { tags: '@smoke' }, function () {
Cypress.Commands.add('get_nodes', () => {
const mutation =
'{nodes { id name infoUrl avatarUrl pubkey tmPubkey ethereumAddress \
'{nodesConnection { edges { node { id name infoUrl avatarUrl pubkey tmPubkey ethereumAddress \
location stakedByOperator stakedByDelegates stakedTotal pendingStake \
epochData { total offline online __typename } status name __typename}}';
epochData { total offline online __typename } status name __typename}}}}';
cy.request({
method: 'POST',
url: `http://localhost:3028/query`,
@@ -290,7 +290,7 @@ context('Validator page', { tags: '@smoke' }, function () {
},
headers: { 'content-type': 'application/json' },
})
.its(`body.data.nodes`)
.its(`body.data.nodesConnection.edges`)
.then(function (response) {
let nodes = [];
response.forEach((node) => {
+1 -1
View File
@@ -15,5 +15,5 @@
import '@vegaprotocol/cypress';
import './common.functions.js';
import registerCypressGrep from 'cypress-grep';
import registerCypressGrep from '@cypress/grep';
registerCypressGrep();
+1 -1
View File
@@ -4,7 +4,7 @@
"jsx": "react-jsx",
"sourceMap": false,
"outDir": "../../dist/out-tsc",
"types": ["cypress", "node", "cypress-grep"],
"types": ["cypress", "node", "@cypress/grep"],
"allowJs": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
+4 -4
View File
@@ -1,13 +1,13 @@
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://n01.stagnet3.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n01.stagnet3.vega.xyz/tm/websocket
NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n00.stagnet3.vega.xyz/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_NETWORKS={\"MAINNET"\:\"https://explorer.vega.xyz"\,\"TESTNET\":\"https://explorer.fairground.wtf\"}
NX_VEGA_ENV=STAGNET3
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_HOSTED_WALLET_URL=https://wallet.testnet.vega.xyz
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
NX_BLOCK_EXPLORER=
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
NX_ETHERSCAN_URL=https://sepolia.etherscan.io
# App flags
NX_EXPLORER_ASSETS=1
-1
View File
@@ -1,5 +1,4 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=http://localhost:26617
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26617/websocket
NX_VEGA_NETWORKS={\"MAINNET"\:\"https://explorer.vega.xyz"\,\"TESTNET\":\"https://explorer.fairground.wtf\"}
-1
View File
@@ -1,5 +1,4 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://n04.d.vega.xyz/tm
NX_TENDERMINT_WEBSOCKET_URL=wss://n04.d.vega.xyz/tm/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/devnet-network.json
-1
View File
@@ -1,5 +1,4 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://be.explorer.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://be.explorer.vega.xyz
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/mainnet-network.json
+1 -4
View File
@@ -1,10 +1,7 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://tm.n00.stagnet3.vega.xyz
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.n00.stagnet3.vega.xyz/websocket
NX_VEGA_CONFIG_URL=https://static.vega.xyz/assets/stagnet3-network.json
NX_VEGA_NETWORKS={\"MAINNET"\:\"https://explorer.vega.xyz"\,\"TESTNET\":\"https://explorer.fairground.wtf\"}
NX_VEGA_ENV=STAGNET3
NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
NX_ETHERSCAN_URL=https://be.stagnet3.vega.xyz/rest
NX_BLOCK_EXPLORER=https://be.stagnet3.vega.xyz/rest
-1
View File
@@ -1,5 +1,4 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=https://tm.be.testnet.vega.xyz
NX_BLOCK_EXPLORER=https://be.testnet.vega.xyz/rest
NX_TENDERMINT_WEBSOCKET_URL=wss://tm.be.testnet.vega.xyz/
-1
View File
@@ -1,5 +1,4 @@
# App configuration variables
NX_CHAIN_EXPLORER_URL=https://explorer.vega.trading/.netlify/functions/chain-explorer-api
NX_TENDERMINT_URL=http://localhost:26607/
NX_TENDERMINT_WEBSOCKET_URL=wss://localhost:26607/websocket
NX_VEGA_ENV=CUSTOM
+14 -15
View File
@@ -45,21 +45,20 @@ yarn nx run explorer:serve --env={env} # e.g. stagnet3
There are a few different configuration options offered for this app:
| **Flag** | **Purpose** |
| -------------------------------- | --------------------------------------------------------------- | --- |
| `NX_CHAIN_EXPLORER_URL` | The URL of the chain explorer service for decoding transactions |
| `NX_TENDERMINT_URL` | The Tendermint REST URL for the Vega consesus engine |
| `NX_TENDERMINT_WEBSOCKET_URL` | The Tendermint Websocket URL for the Vega consensus engine |
| `NX_VEGA_ENV` | The name of the currently connected vega environment | |
| `NX_EXPLORER_ASSETS` | Enable the assets page for the explorer |
| `NX_EXPLORER_GENESIS` | Enable the genesis page for the explorer |
| `NX_EXPLORER_GOVERNANCE` | Enable the governance page for the explorer |
| `NX_EXPLORER_MARKETS` | Enable the markets page for the explorer |
| `NX_EXPLORER_ORACLES` | Enable the oracles page for the explorer |
| `NX_EXPLORER_TXS_LIST` | Enable the transactions list page for the explorer |
| `NX_EXPLORER_NETWORK_PARAMETERS` | Enable the network parameters page for the explorer |
| `NX_EXPLORER_PARTIES` | Enable the parties page for the explorer |
| `NX_EXPLORER_VALIDATORS` | Enable the validators page for the explorer |
| **Flag** | **Purpose** |
| -------------------------------- | ---------------------------------------------------------- | --- |
| `NX_TENDERMINT_URL` | The Tendermint REST URL for the Vega consesus engine |
| `NX_TENDERMINT_WEBSOCKET_URL` | The Tendermint Websocket URL for the Vega consensus engine |
| `NX_VEGA_ENV` | The name of the currently connected vega environment | |
| `NX_EXPLORER_ASSETS` | Enable the assets page for the explorer |
| `NX_EXPLORER_GENESIS` | Enable the genesis page for the explorer |
| `NX_EXPLORER_GOVERNANCE` | Enable the governance page for the explorer |
| `NX_EXPLORER_MARKETS` | Enable the markets page for the explorer |
| `NX_EXPLORER_ORACLES` | Enable the oracles page for the explorer |
| `NX_EXPLORER_TXS_LIST` | Enable the transactions list page for the explorer |
| `NX_EXPLORER_NETWORK_PARAMETERS` | Enable the network parameters page for the explorer |
| `NX_EXPLORER_PARTIES` | Enable the parties page for the explorer |
| `NX_EXPLORER_VALIDATORS` | Enable the validators page for the explorer |
## Testing
+1
View File
@@ -1,4 +1,5 @@
/* eslint-disable */
process.env.TZ = 'UTC';
export default {
displayName: 'explorer',
preset: '../../jest.preset.js',
@@ -0,0 +1,31 @@
import { addDecimalsFormatNumber } from '@vegaprotocol/react-helpers';
import { AssetLink } from '../links';
import { useExplorerAssetQuery } from '../links/asset-link/__generated__/Asset';
export type AssetBalanceProps = {
assetId: string;
price: string;
};
/**
* Given a market ID and a price it will fetch the market
* and format the price in that market's decimal places.
*/
const AssetBalance = ({ assetId, price }: AssetBalanceProps) => {
const { data } = useExplorerAssetQuery({
variables: { id: assetId },
});
const label =
data && data.asset?.decimals
? addDecimalsFormatNumber(price, data.asset.decimals)
: price;
return (
<div className="inline-block">
<span>{label}</span> <AssetLink id={data?.asset?.id || ''} />
</div>
);
};
export default AssetBalance;
@@ -1,4 +1,4 @@
import React, { useMemo } from 'react';
import { useMemo } from 'react';
import type { ReactNode } from 'react';
import { Panel } from '../panel';
import {
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -21,7 +21,7 @@ export const EthExplorerLink = ({
const link = `${DATA_SOURCES.ethExplorerUrl}/${type}/${id}`;
return (
<a
className="underline external"
className="underline external font-mono"
target="_blank"
rel="noopener noreferrer"
{...props}
@@ -1,9 +1,15 @@
query ExplorerMarket($id: ID!) {
market(id: $id) {
id
decimalPlaces
tradableInstrument {
instrument {
name
product {
... on Future {
quoteName
}
}
}
}
state
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -8,16 +8,22 @@ export type ExplorerMarketQueryVariables = Types.Exact<{
}>;
export type ExplorerMarketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string } } } | null };
export type ExplorerMarketQuery = { __typename?: 'Query', market?: { __typename?: 'Market', id: string, decimalPlaces: number, state: Types.MarketState, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string, product: { __typename?: 'Future', quoteName: string } } } } | null };
export const ExplorerMarketDocument = gql`
query ExplorerMarket($id: ID!) {
market(id: $id) {
id
decimalPlaces
tradableInstrument {
instrument {
name
product {
... on Future {
quoteName
}
}
}
}
state
@@ -4,10 +4,11 @@ import type { MockedResponse } from '@apollo/client/testing';
import { render } from '@testing-library/react';
import MarketLink from './market-link';
import { ExplorerMarketDocument } from './__generated__/Market';
import { GraphQLError } from 'graphql';
function renderComponent(id: string, mock: MockedResponse[]) {
function renderComponent(id: string, mocks: MockedResponse[]) {
return (
<MockedProvider mocks={mock}>
<MockedProvider mocks={mocks} addTypename={false}>
<MemoryRouter>
<MarketLink id={id} />
</MemoryRouter>
@@ -21,6 +22,26 @@ describe('Market link component', () => {
expect(res.getByText('123')).toBeInTheDocument();
});
it('Renders the ID with an emoji on error', async () => {
const mock = {
request: {
query: ExplorerMarketDocument,
variables: {
id: '456',
},
},
result: {
errors: [new GraphQLError('No such market')],
},
};
const res = render(renderComponent('456', [mock]));
// The ID
expect(res.getByText('456')).toBeInTheDocument();
// The emoji
expect(await res.findByRole('img')).toBeInTheDocument();
});
it('Renders the market name when the query returns a result', async () => {
const mock = {
request: {
@@ -33,10 +54,14 @@ describe('Market link component', () => {
data: {
market: {
id: '123',
decimalPlaces: 5,
state: 'irrelevant-test-data',
tradableInstrument: {
instrument: {
name: 'test-label',
product: {
quoteName: 'dai',
},
},
},
},
@@ -4,6 +4,7 @@ import { useExplorerMarketQuery } from './__generated__/Market';
import { Link } from 'react-router-dom';
import type { ComponentProps } from 'react';
import { t } from '@vegaprotocol/react-helpers';
export type MarketLinkProps = Partial<ComponentProps<typeof Link>> & {
id: string;
@@ -15,14 +16,25 @@ export type MarketLinkProps = Partial<ComponentProps<typeof Link>> & {
* it will use the ID instead
*/
const MarketLink = ({ id, ...props }: MarketLinkProps) => {
const { data } = useExplorerMarketQuery({
const { data, error, loading } = useExplorerMarketQuery({
variables: { id },
});
let label = id;
let label = <span>{id}</span>;
if (data?.market?.tradableInstrument.instrument.name) {
label = data.market.tradableInstrument.instrument.name;
if (!loading) {
if (data?.market?.tradableInstrument.instrument.name) {
label = <span>{data.market.tradableInstrument.instrument.name}</span>;
} else if (error) {
label = (
<div title={t('Unknown market')}>
<span role="img" aria-label="Unknown market" className="img">
</span>
&nbsp;{id}
</div>
);
}
}
return (
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -22,7 +22,7 @@ const NodeLink = ({ id, ...props }: NodeLinkProps) => {
return (
<Link className="underline" {...props} to={`/${Routes.VALIDATORS}#${id}`}>
{label}
<code>{label}</code>
</Link>
);
};
@@ -10,7 +10,11 @@ export type PartyLinkProps = Partial<ComponentProps<typeof Link>> & {
const PartyLink = ({ id, ...props }: PartyLinkProps) => {
return (
<Link className="underline" {...props} to={`/${Routes.PARTIES}/${id}`}>
<Link
className="underline font-mono"
{...props}
to={`/${Routes.PARTIES}/${id}`}
>
{id}
</Link>
);
@@ -0,0 +1,34 @@
fragment ExplorerDeterministicOrderFields on Order {
id
type
reference
status
version
createdAt
updatedAt
expiresAt
timeInForce
price
side
remaining
size
rejectionReason
party {
id
}
market {
id
decimalPlaces
tradableInstrument {
instrument {
name
}
}
}
}
query ExplorerDeterministicOrder($orderId: ID!, $version: Int) {
orderByID(id: $orderId, version: $version) {
...ExplorerDeterministicOrderFields
}
}
@@ -0,0 +1,81 @@
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type ExplorerDeterministicOrderFieldsFragment = { __typename?: 'Order', id: string, type?: Types.OrderType | null, reference: string, status: Types.OrderStatus, version: string, createdAt: any, updatedAt?: any | null, expiresAt?: any | null, timeInForce: Types.OrderTimeInForce, price: string, side: Types.Side, remaining: string, size: string, rejectionReason?: Types.OrderRejectionReason | null, party: { __typename?: 'Party', id: string }, market: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string } } } };
export type ExplorerDeterministicOrderQueryVariables = Types.Exact<{
orderId: Types.Scalars['ID'];
version?: Types.InputMaybe<Types.Scalars['Int']>;
}>;
export type ExplorerDeterministicOrderQuery = { __typename?: 'Query', orderByID: { __typename?: 'Order', id: string, type?: Types.OrderType | null, reference: string, status: Types.OrderStatus, version: string, createdAt: any, updatedAt?: any | null, expiresAt?: any | null, timeInForce: Types.OrderTimeInForce, price: string, side: Types.Side, remaining: string, size: string, rejectionReason?: Types.OrderRejectionReason | null, party: { __typename?: 'Party', id: string }, market: { __typename?: 'Market', id: string, decimalPlaces: number, tradableInstrument: { __typename?: 'TradableInstrument', instrument: { __typename?: 'Instrument', name: string } } } } };
export const ExplorerDeterministicOrderFieldsFragmentDoc = gql`
fragment ExplorerDeterministicOrderFields on Order {
id
type
reference
status
version
createdAt
updatedAt
expiresAt
timeInForce
price
side
remaining
size
rejectionReason
party {
id
}
market {
id
decimalPlaces
tradableInstrument {
instrument {
name
}
}
}
}
`;
export const ExplorerDeterministicOrderDocument = gql`
query ExplorerDeterministicOrder($orderId: ID!, $version: Int) {
orderByID(id: $orderId, version: $version) {
...ExplorerDeterministicOrderFields
}
}
${ExplorerDeterministicOrderFieldsFragmentDoc}`;
/**
* __useExplorerDeterministicOrderQuery__
*
* To run a query within a React component, call `useExplorerDeterministicOrderQuery` and pass it any options that fit your needs.
* When your component renders, `useExplorerDeterministicOrderQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useExplorerDeterministicOrderQuery({
* variables: {
* orderId: // value for 'orderId'
* version: // value for 'version'
* },
* });
*/
export function useExplorerDeterministicOrderQuery(baseOptions: Apollo.QueryHookOptions<ExplorerDeterministicOrderQuery, ExplorerDeterministicOrderQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<ExplorerDeterministicOrderQuery, ExplorerDeterministicOrderQueryVariables>(ExplorerDeterministicOrderDocument, options);
}
export function useExplorerDeterministicOrderLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerDeterministicOrderQuery, ExplorerDeterministicOrderQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ExplorerDeterministicOrderQuery, ExplorerDeterministicOrderQueryVariables>(ExplorerDeterministicOrderDocument, options);
}
export type ExplorerDeterministicOrderQueryHookResult = ReturnType<typeof useExplorerDeterministicOrderQuery>;
export type ExplorerDeterministicOrderLazyQueryHookResult = ReturnType<typeof useExplorerDeterministicOrderLazyQuery>;
export type ExplorerDeterministicOrderQueryResult = Apollo.QueryResult<ExplorerDeterministicOrderQuery, ExplorerDeterministicOrderQueryVariables>;
@@ -0,0 +1,153 @@
import type { components } from '../../../types/explorer';
import type { MockedResponse } from '@apollo/client/testing';
import { MockedProvider } from '@apollo/client/testing';
import { MemoryRouter } from 'react-router-dom';
import AmendOrderDetails from './amend-order-details';
import { ExplorerDeterministicOrderDocument } from './__generated__/Order';
import { render } from '@testing-library/react';
import * as Schema from '@vegaprotocol/types';
import { ExplorerMarketDocument } from '../links/market-link/__generated__/Market';
type Amend = components['schemas']['v1OrderAmendment'];
function renderAmendOrderDetails(
id: string,
version: number,
amend: Amend,
mocks: MockedResponse[]
) {
return render(
<MockedProvider mocks={mocks} addTypename={false}>
<MemoryRouter>
<AmendOrderDetails version={version} id={id} amend={amend} />
</MemoryRouter>
</MockedProvider>
);
}
function renderExistingAmend(id: string, version: number, amend: Amend) {
const mocks = [
{
request: {
query: ExplorerDeterministicOrderDocument,
variables: {
orderId: '123',
version: 1,
},
},
result: {
data: {
orderByID: {
__typename: 'Order',
id: '123',
type: 'GTT',
status: Schema.OrderStatus.STATUS_ACTIVE,
version: version,
createdAt: '123',
updatedAt: '456',
expiresAt: '789',
timeInForce: Schema.OrderTimeInForce.TIME_IN_FORCE_GTC,
price: '200',
side: 'BUY',
remaining: '99',
rejectionReason: 'rejection',
reference: '123',
size: '100',
party: {
__typename: 'Party',
id: '234',
},
market: {
__typename: 'Market',
id: '789',
decimalPlaces: '5',
tradableInstrument: {
instrument: {
name: 'test',
},
},
},
},
},
},
},
{
request: {
query: ExplorerMarketDocument,
variables: {
id: '789',
},
},
result: {
data: {
market: {
id: '789',
decimalPlaces: 5,
state: 'irrelevant-test-data',
tradableInstrument: {
instrument: {
name: 'test-label',
product: {
quoteName: 'dai',
},
},
},
},
},
},
},
];
return renderAmendOrderDetails(id, version, amend, mocks);
}
describe('Amend order details', () => {
it('Renders price if price changed', async () => {
const amend: Amend = {
sizeDelta: '123',
};
const res = renderExistingAmend('123', 1, amend);
expect(await res.findByText('New size')).toBeInTheDocument();
});
it('Renders Reference if provided', async () => {
const amend: Amend = {
peggedReference: 'PEGGED_REFERENCE_MID',
};
const res = renderExistingAmend('123', 1, amend);
expect(await res.findByText('New reference')).toBeInTheDocument();
expect(await res.findByText('Mid')).toBeInTheDocument();
});
it('Renders offset if provided: positive', async () => {
const amend: Amend = {
peggedOffset: '1',
};
const res = renderExistingAmend('123', 1, amend);
expect(await res.findByText('New offset')).toBeInTheDocument();
expect(await res.findByText('1')).toBeInTheDocument();
});
it('Renders positive price if provided', async () => {
const amend: Amend = {
price: '7879',
};
const res = renderExistingAmend('123', 1, amend);
expect(await res.findByText('New price')).toBeInTheDocument();
expect(await res.findByText('7879')).toBeInTheDocument();
});
it('Renders negative price if provided', async () => {
const amend: Amend = {
price: '-7879',
};
const res = renderExistingAmend('123', 1, amend);
expect(await res.findByText('New price')).toBeInTheDocument();
expect(await res.findByText('-7879')).toBeInTheDocument();
});
});
@@ -0,0 +1,139 @@
import { t } from '@vegaprotocol/react-helpers';
import { useExplorerDeterministicOrderQuery } from './__generated__/Order';
import { MarketLink } from '../links';
import PriceInMarket from '../price-in-market/price-in-market';
import { Time } from '../time';
import { sideText, peggedReference } from './lib/order-labels';
import type { components } from '../../../types/explorer';
import { VegaColours } from '@vegaprotocol/tailwindcss-config';
import { wrapperClasses } from './deterministic-order-details';
export interface AmendOrderDetailsProps {
id: string;
amend: components['schemas']['v1OrderAmendment'];
// Version to fetch, with 0 being 'latest' and 1 being 'first'. Defaults to 0
version?: number;
}
export function getSideDeltaColour(delta: string): string {
if (delta.charAt(0) === '-') {
return VegaColours.pink.DEFAULT;
} else {
return VegaColours.green.DEFAULT;
}
}
/**
* This component renders the changes to an order made in an amend. It's very
* similar to the deterministic-order-details component, and should probably
* eventually be merged in to that view. However the APIs to make that experience
* work nicely are not available, so instead of making 1 complex component, it's
* currently 2 similar components.
*
* @param param0
* @returns
*/
const AmendOrderDetails = ({
id,
version = 0,
amend,
}: AmendOrderDetailsProps) => {
const { data, error } = useExplorerDeterministicOrderQuery({
variables: { orderId: id, version },
});
if (error || (data && !data.orderByID)) {
return (
<div className={wrapperClasses}>
<div className="mb-12 lg:mb-0">
<div className="relative block rounded-lg px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5">
{t('Order not found')}
</h2>
<p className="text-gray-500 mb-12">
{t('No order created from this transaction')}
</p>
</div>
</div>
</div>
);
}
if (!data || !data.orderByID) {
return null;
}
const o = data.orderByID;
return (
<div className={wrapperClasses}>
<div className="mb-12 lg:mb-0">
<div className="relative block px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5">
{t('Edits to ')}
{sideText[o.side]}
{t(' order')}
</h2>
<p className="text-gray-500 mb-4">
In <MarketLink id={o.market.id} />, updated at{' '}
<Time date={o.updatedAt} />.
</p>
<div className="grid md:grid-cols-4 gap-x-6">
{amend.sizeDelta && amend.sizeDelta !== '0' ? (
<div className="mb-12 md:mb-0">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('New size')}
</h2>
<h5
className={`text-lg font-medium text-gray-500 mb-0 capitalize ${getSideDeltaColour(
amend.sizeDelta
)}`}
>
{amend.sizeDelta}
</h5>
</div>
) : null}
{amend.price && amend.price !== '0' ? (
<div className="">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('New price')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
<PriceInMarket price={amend.price} marketId={o.market.id} />
</h5>
</div>
) : null}
{amend.peggedReference &&
amend.peggedReference !== 'PEGGED_REFERENCE_UNSPECIFIED' ? (
<div className="">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('New reference')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
{peggedReference[amend.peggedReference]}
</h5>
</div>
) : null}
{amend.peggedOffset ? (
<div className="">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('New offset')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
{amend.peggedOffset}
</h5>
</div>
) : null}
</div>
</div>
</div>
</div>
);
};
export default AmendOrderDetails;
@@ -0,0 +1,123 @@
import { t } from '@vegaprotocol/react-helpers';
import { useExplorerDeterministicOrderQuery } from './__generated__/Order';
import { MarketLink } from '../links';
import PriceInMarket from '../price-in-market/price-in-market';
import { Time } from '../time';
import { sideText, statusText, tifFull, tifShort } from './lib/order-labels';
export interface DeterministicOrderDetailsProps {
id: string;
// Version to fetch, with 0 being 'latest' and 1 being 'first'. Defaults to 0
version?: number;
}
export const wrapperClasses =
'grid lg:grid-cols-1 flex items-center max-w-xl border border-zinc-200 dark:border-zinc-800 rounded-md pv-2 ph-5 mb-5';
/**
* This component renders the *current* details for an order
*
* An important part of this component is that unlike most of the rest of the Explorer,
* it is displaying 'live' data. With the current APIs it's impossible to get the state
* of the order at a specific point in time. While one day that might be possible, this
* order component is not built with that in mind.
*
* @param param0
* @returns
*/
const DeterministicOrderDetails = ({
id,
version = 0,
}: DeterministicOrderDetailsProps) => {
const { data, error } = useExplorerDeterministicOrderQuery({
variables: { orderId: id, version },
});
if (error || (data && !data.orderByID)) {
return (
<div className={wrapperClasses}>
<div className="mb-12 lg:mb-0">
<div className="relative block rounded-lg px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5">
{t('Order not found')}
</h2>
<p className="text-gray-500 mb-12">
{t('No order created from this transaction')}
</p>
</div>
</div>
</div>
);
}
if (!data || !data.orderByID) {
return null;
}
const o = data.orderByID;
return (
<div className={wrapperClasses}>
<div className="mb-12 lg:mb-0">
<div className="relative block px-3 py-6 md:px-6 lg:-mr-7">
<h2 className="text-3xl font-bold mb-4 display-5">
<abbr title={tifFull[o.timeInForce]} className="bb-dotted mr-2">
{tifShort[o.timeInForce]}
</abbr>
{sideText[o.side]}
<span className="mx-5 text-base">@</span>
<PriceInMarket price={o.price} marketId={o.market.id} />
</h2>
<p className="text-gray-500 mb-4">
In <MarketLink id={o.market.id} /> at <Time date={o.createdAt} />.
</p>
{o.reference ? (
<p className="text-gray-500 mb-4">
<span>{t('Reference')}</span>: {o.reference}
</p>
) : null}
<div className="grid md:grid-cols-4 gap-x-6">
{version !== 0 ? null : (
<div className="mb-12 md:mb-0">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('Status')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0 capitalize">
{statusText[o.status]}
</h5>
</div>
)}
<div className="mb-12 md:mb-0">
<h2 className="text-2xl font-bold text-dark mb-4">{t('Size')}</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
{o.size}
</h5>
</div>
{version !== 0 ? null : (
<div className="">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('Remaining')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
{o.remaining}
</h5>
</div>
)}
<div className="">
<h2 className="text-2xl font-bold text-dark mb-4">
{t('Version')}
</h2>
<h5 className="text-lg font-medium text-gray-500 mb-0">
{o.version}
</h5>
</div>
</div>
</div>
</div>
</div>
);
};
export default DeterministicOrderDetails;
@@ -0,0 +1,49 @@
import { t } from '@vegaprotocol/react-helpers';
import type * as Schema from '@vegaprotocol/types';
export interface DeterministicOrderDetailsProps {
id: string;
// Version to fetch, with 0 being 'latest' and 1 being 'first'. Defaults to 0
version?: number;
}
export const statusText: Record<Schema.OrderStatus, string> = {
STATUS_ACTIVE: t('Active'),
STATUS_CANCELLED: t('Cancelled'),
STATUS_EXPIRED: t('Expired'),
STATUS_FILLED: t('Filled'),
STATUS_PARKED: t('Parked'),
// Intentionally vague - table shows partial fills
STATUS_PARTIALLY_FILLED: t('Active'),
STATUS_REJECTED: t('Rejected'),
STATUS_STOPPED: t('Stopped'),
};
export const sideText: Record<Schema.Side, string> = {
SIDE_BUY: t('Buy'),
SIDE_SELL: t('Sell'),
};
export const tifShort: Record<Schema.OrderTimeInForce, string> = {
TIME_IN_FORCE_FOK: t('FOK'),
TIME_IN_FORCE_GFA: t('GFA'),
TIME_IN_FORCE_GFN: t('GFN'),
TIME_IN_FORCE_GTC: t('GTC'),
TIME_IN_FORCE_GTT: t('GTT'),
TIME_IN_FORCE_IOC: t('IOC'),
};
export const tifFull: Record<Schema.OrderTimeInForce, string> = {
TIME_IN_FORCE_FOK: t('Fill or Kill'),
TIME_IN_FORCE_GFA: t('Good for Auction'),
TIME_IN_FORCE_GFN: t('Good for Normal'),
TIME_IN_FORCE_GTC: t("Good 'til Cancel"),
TIME_IN_FORCE_GTT: t("Good 'til Time"),
TIME_IN_FORCE_IOC: t('Immediate or Cancel'),
};
export const peggedReference: Record<Schema.PeggedReference, string> = {
PEGGED_REFERENCE_BEST_ASK: 'Best Ask',
PEGGED_REFERENCE_BEST_BID: 'Best Bid',
PEGGED_REFERENCE_MID: 'Mid',
};
@@ -0,0 +1,92 @@
import { MemoryRouter } from 'react-router-dom';
import { MockedProvider } from '@apollo/client/testing';
import type { MockedResponse } from '@apollo/client/testing';
import { render } from '@testing-library/react';
import PriceInMarket from './price-in-market';
import { ExplorerMarketDocument } from '../links/market-link/__generated__/Market';
function renderComponent(
price: string,
marketId: string,
mocks: MockedResponse[]
) {
return (
<MockedProvider mocks={mocks} addTypename={false}>
<MemoryRouter>
<PriceInMarket marketId={marketId} price={price} />
</MemoryRouter>
</MockedProvider>
);
}
describe('Price in Market component', () => {
it('Renders the raw price when there is no market data', () => {
const res = render(renderComponent('100', '123', []));
expect(res.getByText('100')).toBeInTheDocument();
});
it('Renders the formatted price when market data is fetched', async () => {
const mock = {
request: {
query: ExplorerMarketDocument,
variables: {
id: '123',
},
},
result: {
data: {
market: {
id: '123',
decimalPlaces: 2,
state: 'irrelevant-test-data',
tradableInstrument: {
instrument: {
name: 'test dai',
product: {
__typename: 'Future',
quoteName: 'dai',
},
},
},
},
},
},
};
const res = render(renderComponent('100', '123', [mock]));
expect(await res.findByText('1.00')).toBeInTheDocument();
expect(await res.findByText('dai')).toBeInTheDocument();
});
it('Leaves the market id when the market is not found', async () => {
const mock = {
request: {
query: ExplorerMarketDocument,
variables: {
id: '123',
},
},
error: new Error('No such market'),
};
const res = render(renderComponent('100', '123', [mock]));
expect(await res.findByText('100')).toBeInTheDocument();
});
it('Renders `Market` instead of a price for market orders: 0 price', () => {
const res = render(renderComponent('0', '123', []));
expect(res.getByText('Market')).toBeInTheDocument();
});
it('Renders `Market` instead of a price for market orders: undefined price', () => {
const res = render(
renderComponent(undefined as unknown as string, '123', [])
);
expect(res.getByText('Market')).toBeInTheDocument();
});
it('Renders `Market` instead of a price for market orders: empty price', () => {
const res = render(renderComponent('', '123', []));
expect(res.getByText('Market')).toBeInTheDocument();
});
});
@@ -0,0 +1,47 @@
import { addDecimalsFormatNumber, t } from '@vegaprotocol/react-helpers';
import isUndefined from 'lodash/isUndefined';
import { useExplorerMarketQuery } from '../links/market-link/__generated__/Market';
import get from 'lodash/get';
export type PriceInMarketProps = {
marketId: string;
price: string;
};
/**
* Given a market ID and a price it will fetch the market
* and format the price in that market's decimal places.
*/
const PriceInMarket = ({ marketId, price }: PriceInMarketProps) => {
const { data } = useExplorerMarketQuery({
variables: { id: marketId },
});
let label = price;
if (data && data.market?.decimalPlaces) {
label = addDecimalsFormatNumber(price, data.market.decimalPlaces);
}
const suffix = get(
data,
'market.tradableInstrument.instrument.product.quoteName',
''
);
if (isUndefined(price) || price === '' || price === '0') {
return (
<span>
<abbr title={'Best available price'}>{t('Market')}</abbr> {suffix}
</span>
);
} else {
return (
<div className="inline-block">
<span>{label}</span> <span>{suffix}</span>
</div>
);
}
};
export default PriceInMarket;
@@ -7,6 +7,7 @@ interface RenderFetchedProps {
error: Error | undefined;
loading: boolean | undefined;
className?: string;
errorMessage?: string;
}
export const RenderFetched = ({
@@ -14,6 +15,7 @@ export const RenderFetched = ({
loading,
children,
className,
errorMessage = t('Error retrieving data'),
}: RenderFetchedProps) => {
if (loading) {
return (
@@ -22,11 +24,7 @@ export const RenderFetched = ({
}
if (error) {
return (
<StatusMessage className={className}>
{t('Error retrieving data')}
</StatusMessage>
);
return <StatusMessage className={className}>{errorMessage}</StatusMessage>;
}
return children;
@@ -1,4 +1,4 @@
import React, { useCallback, useState } from 'react';
import { useCallback, useState } from 'react';
import { t } from '@vegaprotocol/react-helpers';
import { Button, Input, InputError } from '@vegaprotocol/ui-toolkit';
import { useForm } from 'react-hook-form';
@@ -69,7 +69,7 @@ export const Search = () => {
placeholder={t('Enter block number, party id or transaction hash')}
/>
{error?.message && (
<div className="bg-white border border-t-0 border-accent absolute top-[100%] flex-1 w-full pb-2 px-2 rounded-b">
<div className="bg-white border border-t-0 border-accent absolute top-[100%] flex-1 w-full pb-2 px-2 rounded-b text-black">
<InputError data-testid="search-error" intent="danger">
{error.message}
</InputError>
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -1,37 +0,0 @@
import { t } from '@vegaprotocol/react-helpers';
import React from 'react';
import type { TendermintBlockchainResponse } from '../../routes/blocks/tendermint-blockchain-response';
import { BlockData } from '../blocks';
import { TxsPerBlock } from './txs-per-block';
interface TxsProps {
data: TendermintBlockchainResponse | undefined;
className?: string;
}
export const BlockTxsData = ({ data, className }: TxsProps) => {
if (!data?.result) {
// Data for the block has already been fetched at this point, so no errors
// or loading to deal with. This is specifically the case
// where the data object is not undefined, but lacks a result.
return <div className={className}>{t('No data')}</div>;
}
return (
<ul
aria-label={t(
`Showing ${data.result?.block_metas.length} most recently loaded blocks and transactions`
)}
className={className}
>
{data.result?.block_metas?.map((block, index) => {
return (
<li key={index} data-testid="transactions-list">
<BlockData block={block} className="mb-12" />
<TxsPerBlock blockHeight={block.header.height} />
</li>
);
})}
</ul>
);
};
@@ -1,4 +1,4 @@
import { Schema as Types } from '@vegaprotocol/types';
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
@@ -8,7 +8,7 @@ export type ExplorerNodeVoteQueryVariables = Types.Exact<{
}>;
export type ExplorerNodeVoteQuery = { __typename?: 'Query', withdrawal?: { __typename?: 'Withdrawal', id: string, status: Types.WithdrawalStatus, createdTimestamp: string, withdrawnTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null, deposit?: { __typename?: 'Deposit', id: string, status: Types.DepositStatus, createdTimestamp: string, creditedTimestamp?: string | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null };
export type ExplorerNodeVoteQuery = { __typename?: 'Query', withdrawal?: { __typename?: 'Withdrawal', id: string, status: Types.WithdrawalStatus, createdTimestamp: any, withdrawnTimestamp?: any | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null, deposit?: { __typename?: 'Deposit', id: string, status: Types.DepositStatus, createdTimestamp: any, creditedTimestamp?: any | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null };
export const ExplorerNodeVoteDocument = gql`
@@ -0,0 +1,75 @@
import * as Types from '@vegaprotocol/types';
import { gql } from '@apollo/client';
import * as Apollo from '@apollo/client';
const defaultOptions = {} as const;
export type ExplorerNodeVoteQueryVariables = Types.Exact<{
id: Types.Scalars['ID'];
}>;
export type ExplorerNodeVoteQuery = { __typename?: 'Query', withdrawal?: { __typename?: 'Withdrawal', id: string, status: Types.WithdrawalStatus, createdTimestamp: any, withdrawnTimestamp?: any | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null, deposit?: { __typename?: 'Deposit', id: string, status: Types.DepositStatus, createdTimestamp: any, creditedTimestamp?: any | null, txHash?: string | null, asset: { __typename?: 'Asset', id: string, name: string, decimals: number }, party: { __typename?: 'Party', id: string } } | null };
export const ExplorerNodeVoteDocument = gql`
query ExplorerNodeVote($id: ID!) {
withdrawal(id: $id) {
id
status
createdTimestamp
withdrawnTimestamp
txHash
asset {
id
name
decimals
}
party {
id
}
}
deposit(id: $id) {
id
status
createdTimestamp
creditedTimestamp
txHash
asset {
id
name
decimals
}
party {
id
}
}
}
`;
/**
* __useExplorerNodeVoteQuery__
*
* To run a query within a React component, call `useExplorerNodeVoteQuery` and pass it any options that fit your needs.
* When your component renders, `useExplorerNodeVoteQuery` returns an object from Apollo Client that contains loading, error, and data properties
* you can use to render your UI.
*
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options;
*
* @example
* const { data, loading, error } = useExplorerNodeVoteQuery({
* variables: {
* id: // value for 'id'
* },
* });
*/
export function useExplorerNodeVoteQuery(baseOptions: Apollo.QueryHookOptions<ExplorerNodeVoteQuery, ExplorerNodeVoteQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useQuery<ExplorerNodeVoteQuery, ExplorerNodeVoteQueryVariables>(ExplorerNodeVoteDocument, options);
}
export function useExplorerNodeVoteLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions<ExplorerNodeVoteQuery, ExplorerNodeVoteQueryVariables>) {
const options = {...defaultOptions, ...baseOptions}
return Apollo.useLazyQuery<ExplorerNodeVoteQuery, ExplorerNodeVoteQueryVariables>(ExplorerNodeVoteDocument, options);
}
export type ExplorerNodeVoteQueryHookResult = ReturnType<typeof useExplorerNodeVoteQuery>;
export type ExplorerNodeVoteLazyQueryHookResult = ReturnType<typeof useExplorerNodeVoteLazyQuery>;
export type ExplorerNodeVoteQueryResult = Apollo.QueryResult<ExplorerNodeVoteQuery, ExplorerNodeVoteQueryVariables>;
@@ -0,0 +1,453 @@
import { render } from '@testing-library/react';
import type { BlockExplorerTransactionResult } from '../../../../routes/types/block-explorer-response';
import { ChainEvent } from '.';
const baseMock: Partial<BlockExplorerTransactionResult> = {
block: '1',
index: 1,
hash: '123',
submitter: '123',
type: '1',
code: 1,
cursor: '1',
};
jest.mock('./tx-builtin-deposit', () => ({
TxDetailsChainEventBuiltinDeposit: () => (
<span>TxDetailsChainEventBuiltinDeposit</span>
),
}));
jest.mock('./tx-builtin-withdrawal', () => ({
TxDetailsChainEventBuiltinWithdrawal: () => (
<span>TxDetailsChainEventBuiltinWithdrawal</span>
),
}));
jest.mock('./tx-erc20-deposit', () => ({
TxDetailsChainEventDeposit: () => <span>TxDetailsChainEventDeposit</span>,
}));
jest.mock('./tx-erc20-withdrawal', () => ({
TxDetailsChainEventWithdrawal: () => (
<span>TxDetailsChainEventWithdrawal</span>
),
}));
jest.mock('./tx-erc20-asset-list', () => ({
TxDetailsChainEventErc20AssetList: () => (
<span>TxDetailsChainEventErc20AssetList</span>
),
}));
jest.mock('./tx-erc20-asset-delist', () => ({
TxDetailsChainEventErc20AssetDelist: () => (
<span>TxDetailsChainEventErc20AssetDelist</span>
),
}));
jest.mock('./tx-erc20-asset-limits-updated', () => ({
TxDetailsChainEventErc20AssetLimitsUpdated: () => (
<span>TxDetailsChainEventErc20LimitsUpdated</span>
),
}));
jest.mock('./tx-erc20-bridge-pause', () => ({
TxDetailsChainEventErc20BridgePause: () => (
<span>TxDetailsChainEventErc20BridgeEvent</span>
),
}));
jest.mock('./tx-multisig-signer', () => ({
TxDetailsChainMultisigSigner: () => <span>TxDetailsChainMultisigSigner</span>,
}));
jest.mock('./tx-multisig-threshold', () => ({
TxDetailsChainMultisigThreshold: () => (
<span>TxDetailsChainMultisigThreshold</span>
),
}));
jest.mock('./tx-stake-deposit', () => ({
TxDetailsChainEventStakeDeposit: () => (
<span>TxDetailsChainStakeDeposit</span>
),
}));
jest.mock('./tx-stake-remove', () => ({
TxDetailsChainEventStakeRemove: () => <span>TxDetailsChainStakeRemove</span>,
}));
jest.mock('./tx-stake-totalsupply', () => ({
TxDetailsChainEventStakeTotalSupply: () => (
<span>TxDetailsChainStakeTotalSupply</span>
),
}));
describe('Chain Event: Chain Event selects the right component for the event', () => {
it('Returns a Built In Deposit event for a built in deposit', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
builtin: {
deposit: {
amount: '',
partyId: '',
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainEventBuiltinDeposit')).toBeVisible();
});
it('Returns a Built In Deposit event for a built in withdrawal', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
builtin: {
withdrawal: {
amount: '',
partyId: '',
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(
screen.getByText('TxDetailsChainEventBuiltinWithdrawal')
).toBeVisible();
});
it('Returns a Built In Deposit event for an ERC20 deposit', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
deposit: {
amount: '',
targetPartyId: '',
sourceEthereumAddress: '',
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainEventDeposit')).toBeVisible();
});
it('Returns a Built In Deposit event for an ERC20 withdrawal', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
withdrawal: {
referenceNonce: '',
targetEthereumAddress: '',
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainEventWithdrawal')).toBeVisible();
});
it('Returns a Asset List event view for a list', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
assetList: {
assetSource: '',
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainEventErc20AssetList')).toBeVisible();
});
it('Returns a Asset Delist event view for a delist', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
assetDelist: {
vegaAssetId: '',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(
screen.getByText('TxDetailsChainEventErc20AssetDelist')
).toBeVisible();
});
it('Returns a Asset Limits Update event view for a update', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
assetLimitsUpdated: {
lifetimeLimits: '100',
withdrawThreshold: '100',
vegaAssetId: '',
sourceEthereumAddress: '0x000',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(
screen.getByText('TxDetailsChainEventErc20LimitsUpdated')
).toBeVisible();
});
it('Returns a Bridge Pause event view when a pause event happens', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
bridgeStopped: true,
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(
screen.getByText('TxDetailsChainEventErc20BridgeEvent')
).toBeVisible();
});
it('Returns a Bridge Pause event view when a resume event happens', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20: {
bridgeResumed: true,
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(
screen.getByText('TxDetailsChainEventErc20BridgeEvent')
).toBeVisible();
});
it('Returns a multsig signer view when a multisig signer is added', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20Multisig: {
signerAdded: {
blockTime: '100',
newSigner: '0x000',
nonce: '123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainMultisigSigner')).toBeVisible();
});
it('Returns a multsig signer view when a multisig signer is removed', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20Multisig: {
signerRemoved: {
blockTime: '100',
oldSigner: '0x000',
nonce: '123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainMultisigSigner')).toBeVisible();
});
it('Returns a multsig signer view when a multisig threshold change event occurs', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
erc20Multisig: {
thresholdSet: {
blockTime: '100',
newThreshold: 100,
nonce: '123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainMultisigThreshold')).toBeVisible();
});
it('Returns a stake deposit view when a stake arrives', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
stakingEvent: {
stakeDeposited: {
blockTime: '100',
amount: '100',
vegaPublicKey: '12345',
ethereumAddress: '0x123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainStakeDeposit')).toBeVisible();
});
it('Returns a stake removed view when a stake goes', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
stakingEvent: {
stakeRemoved: {
blockTime: '100',
amount: '100',
vegaPublicKey: '12345',
ethereumAddress: '0x123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainStakeRemove')).toBeVisible();
});
it('Returns a stake total supply view when the supply of the staking asset changes', () => {
const commandMock: Partial<BlockExplorerTransactionResult> = {
command: {
chainEvent: {
stakingEvent: {
totalSupply: {
totalSupply: '12345',
tokenAddress: '0x123',
},
},
},
},
};
const mock = Object.assign(
{},
baseMock,
commandMock
) as BlockExplorerTransactionResult;
const screen = render(<ChainEvent txData={mock} />);
expect(screen.getByText('TxDetailsChainStakeTotalSupply')).toBeVisible();
});
});

Some files were not shown because too many files have changed in this diff Show More