diff --git a/apps/governance-e2e/.env b/apps/governance-e2e/.env index 7463399fc..de1f22211 100644 --- a/apps/governance-e2e/.env +++ b/apps/governance-e2e/.env @@ -13,6 +13,8 @@ NX_LOCAL_PROVIDER_URL=http://localhost:8545/ NX_VEGA_WALLET_URL=http://localhost:1789 NX_VEGA_DOCS_URL=https://docs.vega.xyz/mainnet NX_TRANCHES_SERVICE_URL=https://tranches-stagnet3-k8s.ops.vega.xyz +NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json +NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions #Test configuration variables CYPRESS_FAIRGROUND=false diff --git a/apps/governance-e2e/src/integration/view/home.cy.ts b/apps/governance-e2e/src/integration/view/home.cy.ts index 0cce3da85..248a765b4 100644 --- a/apps/governance-e2e/src/integration/view/home.cy.ts +++ b/apps/governance-e2e/src/integration/view/home.cy.ts @@ -6,159 +6,203 @@ context('Home Page - verify elements on page', { tags: '@smoke' }, function () { cy.get('nav', { timeout: 10000 }).should('be.visible'); }); - describe('with wallets disconnected', function () { - describe('Links and buttons', function () { - it('should have link for proposal page', function () { - cy.getByTestId('home-proposals').within(() => { - cy.get('[href="/proposals"]') - .should('exist') - .and('have.text', 'Browse, vote, and propose'); - }); - }); - it('should show open or enacted proposals with proposal summary', function () { - cy.get('body').then(($body) => { - if (!$body.find('[data-testid="proposals-list-item"]').length) { - cy.createMarket(); - cy.reload(); - waitForSpinner(); - } - }); - cy.getByTestId('proposals-list-item') - .should('have.length.at.least', 1) - .first() - .within(() => { - cy.getByTestId('proposal-title') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('proposal-type') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('proposal-description') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('proposal-details') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('proposal-status') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('vote-details') - .invoke('text') - .should('not.be.empty'); - cy.getByTestId('view-proposal-btn').should('be.visible'); - }); - }); - it('should have external link for governance', function () { - cy.getByTestId('home-proposals').within(() => { - cy.getByTestId('external-link') - .should('have.attr', 'href') - .and('contain', 'https://vega.xyz/governance'); - }); - }); - it('should have link for validator page', function () { - cy.getByTestId('home-validators').within(() => { - cy.get('[href="/validators"]') - .first() - .should('exist') - .and('have.text', 'Browse, and stake'); - }); - }); - it('should have external link for validators', function () { - cy.getByTestId('home-validators').within(() => { - cy.getByTestId('external-link') - .should('have.attr', 'href') - .and( - 'contain', - 'https://community.vega.xyz/c/mainnet-validator-candidates' - ); - }); - }); - it('should have information on active nodes', function () { - cy.getByTestId('node-information') - .first() - .should('contain.text', '2') - .and('contain.text', 'active nodes'); - }); - it('should have information on consensus nodes', function () { - cy.getByTestId('node-information') - .last() - .should('contain.text', '2') - .and('contain.text', 'consensus nodes'); - }); - it('should contain link to specific validators', function () { - cy.getByTestId('validators') - .should('have.length', '2') - .each(($validator) => { - cy.wrap($validator).find('a').should('have.attr', 'href'); - }); - }); - it('should have link for rewards page', function () { - cy.getByTestId('home-rewards').within(() => { - cy.get('[href="/rewards"]') - .first() - .should('exist') - .and('have.text', 'See rewards'); - }); - }); - it('should have link for withdrawal page', function () { - cy.getByTestId('home-vega-token').within(() => { - cy.get('[href="/token/withdraw"]') - .first() - .should('exist') - .and('have.text', 'Manage tokens'); - }); + describe('Links and buttons', function () { + it('should have link for proposal page', function () { + cy.getByTestId('home-proposals').within(() => { + cy.get('[href="/proposals"]') + .should('exist') + .and('have.text', 'Browse, vote, and propose'); }); }); - describe('Mobile view - navigation bar', function () { - before('Change to mobile resolution', function () { - cy.viewport('iphone-xr'); - }); - - it('should have burger button', () => { - cy.getByTestId('button-menu-drawer').should('be.visible').click(); - cy.getByTestId('menu-drawer').should('be.visible'); - }); - - it('should have link for proposal page', function () { - cy.getByTestId('menu-drawer').within(() => { - cy.get('[href="/proposals"]') - .should('exist') - .and('have.text', 'Proposals'); + it('should display announcement banner', function () { + cy.getByTestId('app-announcement') + .should('be.visible') + .within(() => { + cy.getByTestId('external-link').should('exist'); }); + cy.getByTestId('app-announcement-close').should('be.visible').click(); + cy.getByTestId('app-announcement').should('not.exist'); + }); + + it('should show open or enacted proposals with proposal summary', function () { + cy.get('body').then(($body) => { + if (!$body.find('[data-testid="proposals-list-item"]').length) { + cy.createMarket(); + cy.reload(); + waitForSpinner(); + } }); - it('should have link for validator page', function () { - cy.getByTestId('menu-drawer').within(() => { - cy.get('[href="/validators"]') + cy.getByTestId('proposals-list-item') + .should('have.length.at.least', 1) + .first() + .within(() => { + cy.getByTestId('proposal-title') + .invoke('text') + .should('not.be.empty'); + cy.getByTestId('proposal-type').invoke('text').should('not.be.empty'); + cy.getByTestId('proposal-description') + .invoke('text') + .should('not.be.empty'); + cy.getByTestId('proposal-details') + .invoke('text') + .should('not.be.empty'); + cy.getByTestId('proposal-status') + .invoke('text') + .should('not.be.empty'); + cy.getByTestId('vote-details').invoke('text').should('not.be.empty'); + cy.getByTestId('view-proposal-btn').should('be.visible'); + }); + }); + + it('should have external link for governance', function () { + cy.getByTestId('home-proposals').within(() => { + cy.getByTestId('external-link') + .should('have.attr', 'href') + .and('contain', 'https://vega.xyz/governance'); + }); + }); + + it('should have link for validator page', function () { + cy.getByTestId('home-validators').within(() => { + cy.get('[href="/validators"]') + .first() + .should('exist') + .and('have.text', 'Browse, and stake'); + }); + }); + + it('should have external link for validators', function () { + cy.getByTestId('home-validators').within(() => { + cy.getByTestId('external-link') + .should('have.attr', 'href') + .and( + 'contain', + 'https://community.vega.xyz/c/mainnet-validator-candidates' + ); + }); + }); + + it('should have information on active nodes', function () { + cy.getByTestId('node-information') + .first() + .should('contain.text', '2') + .and('contain.text', 'active nodes'); + }); + + it('should have information on consensus nodes', function () { + cy.getByTestId('node-information') + .last() + .should('contain.text', '2') + .and('contain.text', 'consensus nodes'); + }); + + it('should contain link to specific validators', function () { + cy.getByTestId('validators') + .should('have.length', '2') + .each(($validator) => { + cy.wrap($validator).find('a').should('have.attr', 'href'); + }); + }); + + it('should have link for rewards page', function () { + cy.getByTestId('home-rewards').within(() => { + cy.get('[href="/rewards"]') + .first() + .should('exist') + .and('have.text', 'See rewards'); + }); + }); + + it('should have link for withdrawal page', function () { + cy.getByTestId('home-vega-token').within(() => { + cy.get('[href="/token/withdraw"]') + .first() + .should('exist') + .and('have.text', 'Manage tokens'); + }); + }); + + it('should display network data', function () { + cy.getByTestId('git-network-data') + .should('contain.text', 'Reading network data from') + .within(() => { + cy.get('span') .first() - .should('exist') - .and('have.text', 'Validators'); + .should('have.text', 'http://localhost:3028/query'); + cy.getByTestId('link').should('exist'); }); - }); + }); - it('should have link for rewards page', function () { - cy.getByTestId('menu-drawer').within(() => { - cy.get('[href="/rewards"]') - .first() - .should('exist') - .and('have.text', 'Rewards'); + it('should display eth data', function () { + cy.getByTestId('git-eth-data') + .should('contain.text', 'Reading Ethereum data from') + .within(() => { + cy.get('span').should('have.text', 'http://localhost:8545'); }); - }); - it('should have link for withdrawal page', function () { - cy.getByTestId('menu-drawer').within(() => { - cy.get('[href="/token/withdraw"]') - .first() - .should('exist') - .and('have.text', 'Withdraw'); - }); - }); + }); - after(function () { - cy.viewport( - Cypress.config('viewportWidth'), - Cypress.config('viewportHeight') - ); + it('should contain link for known issues on Github', function () { + cy.getByTestId('git-info').within(() => { + cy.contains('Known issues and feedback on') + .find('[data-testid="link"]') + .should( + 'have.attr', + 'href', + 'https://github.com/vegaprotocol/feedback/discussions' + ); }); }); }); + + describe('Mobile view - navigation bar', function () { + before('Change to mobile resolution', function () { + cy.viewport('iphone-xr'); + }); + + it('should have burger button', () => { + cy.getByTestId('button-menu-drawer').should('be.visible').click(); + cy.getByTestId('menu-drawer').should('be.visible'); + }); + + it('should have link for proposal page', function () { + cy.getByTestId('menu-drawer').within(() => { + cy.get('[href="/proposals"]') + .should('exist') + .and('have.text', 'Proposals'); + }); + }); + it('should have link for validator page', function () { + cy.getByTestId('menu-drawer').within(() => { + cy.get('[href="/validators"]') + .first() + .should('exist') + .and('have.text', 'Validators'); + }); + }); + + it('should have link for rewards page', function () { + cy.getByTestId('menu-drawer').within(() => { + cy.get('[href="/rewards"]') + .first() + .should('exist') + .and('have.text', 'Rewards'); + }); + }); + it('should have link for withdrawal page', function () { + cy.getByTestId('menu-drawer').within(() => { + cy.get('[href="/token/withdraw"]') + .first() + .should('exist') + .and('have.text', 'Withdraw'); + }); + }); + + after(function () { + cy.viewport( + Cypress.config('viewportWidth'), + Cypress.config('viewportHeight') + ); + }); + }); }); diff --git a/apps/governance/.env.capsule b/apps/governance/.env.capsule index 37f49fcd2..eeb84ea5b 100644 --- a/apps/governance/.env.capsule +++ b/apps/governance/.env.capsule @@ -5,6 +5,7 @@ NX_ETHERSCAN_URL=https://sepolia.etherscan.io NX_FAIRGROUND=false NX_VEGA_NETWORKS='{"DEVNET":"https://dev.token.vega.xyz","STAGNET3":"https://stagnet3.token.vega.xyz","TESTNET":"https://token.fairground.wtf","MAINNET":"https://token.vega.xyz"}' NX_GITHUB_FEEDBACK_URL=https://github.com/vegaprotocol/feedback/discussions +NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/fairground/announcements.json NX_VEGA_CONFIG_URL='' NX_VEGA_URL=http://localhost:3028/query @@ -16,7 +17,6 @@ NX_VEGA_WALLET_URL=http://localhost:1789 NX_VEGA_DOCS_URL=https://docs.vega.xyz/testnet NX_DELEGATIONS_PAGINATION=50 NX_TRANCHES_SERVICE_URL=https://tranches-stagnet3-k8s.ops.vega.xyz -NX_ANNOUNCEMENTS_CONFIG_URL=https://raw.githubusercontent.com/vegaprotocol/announcements/main/announcements.json #Test configuration variables CYPRESS_FAIRGROUND=false diff --git a/apps/static/src/assets/mainnet-tranches.json b/apps/static/src/assets/mainnet-tranches.json index 668bed319..1ca6d5ab0 100644 --- a/apps/static/src/assets/mainnet-tranches.json +++ b/apps/static/src/assets/mainnet-tranches.json @@ -561,7 +561,7 @@ "tranche_end": "2023-04-06T00:00:00.000Z", "total_added": "14099", "total_removed": "165.10784124668", - "locked_amount": "2384.8071072281962495", + "locked_amount": "1247.56462776284332054", "deposits": [ { "amount": "30", @@ -3349,7 +3349,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "86666.297", "total_removed": "0", - "locked_amount": "58943.4260728205234523893", + "locked_amount": "58349.7031275271807221145", "deposits": [ { "amount": "86666.297", @@ -3415,7 +3415,7 @@ "tranche_end": "2023-06-01T00:00:00.000Z", "total_added": "2500", "total_removed": "0", - "locked_amount": "841.2577584452585", + "locked_amount": "806.91026276963785", "deposits": [ { "amount": "2500", @@ -3536,7 +3536,7 @@ "tranche_end": "2023-09-01T00:00:00.000Z", "total_added": "17500", "total_removed": "0", - "locked_amount": "14574.79556662640875", + "locked_amount": "14336.97649330716525", "deposits": [ { "amount": "12500", @@ -3803,7 +3803,7 @@ "tranche_end": "2023-08-01T00:00:00.000Z", "total_added": "37500", "total_removed": "11668.32172695", - "locked_amount": "25326.70541743400625", + "locked_amount": "24808.64650475752125", "deposits": [ { "amount": "7500", @@ -4112,7 +4112,7 @@ "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "129999.45", "total_removed": "0", - "locked_amount": "58889.6476130753215522965", + "locked_amount": "58296.4663652644736979915", "deposits": [ { "amount": "129999.45", @@ -4145,7 +4145,7 @@ "tranche_end": "2024-04-01T00:00:00.000Z", "total_added": "54144.7663", "total_removed": "0", - "locked_amount": "54144.7663", + "locked_amount": "53810.8835054071292707386", "deposits": [ { "amount": "54144.7663", @@ -4178,7 +4178,7 @@ "tranche_end": "2023-09-03T00:00:00.000Z", "total_added": "62600", "total_removed": "0", - "locked_amount": "26625.33467782851442", + "locked_amount": "26196.482198122780824", "deposits": [ { "amount": "10000", @@ -4371,7 +4371,7 @@ "tranche_end": "2023-09-17T00:00:00.000Z", "total_added": "5000", "total_removed": "0", - "locked_amount": "2318.4049974632165", + "locked_amount": "2284.15160451547415", "deposits": [ { "amount": "5000", @@ -4582,7 +4582,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "97499.58", "total_removed": "0", - "locked_amount": "987.46011252320075420058", + "locked_amount": "405.60456575344483061187", "deposits": [ { "amount": "97499.58", @@ -4615,7 +4615,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "135173.4239508", "total_removed": "133818.54965292963650862", - "locked_amount": "1349.6874959427382120583231388", + "locked_amount": "554.3914166779487086967342868", "deposits": [ { "amount": "135173.4239508", @@ -4672,7 +4672,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "32499.86", "total_removed": "0", - "locked_amount": "415.4074168144787082168", + "locked_amount": "170.63083639627856110929", "deposits": [ { "amount": "32499.86", @@ -4705,7 +4705,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "10833.29", "total_removed": "0", - "locked_amount": "135.2110831549561525247", + "locked_amount": "55.53868148454478352929", "deposits": [ { "amount": "10833.29", @@ -4738,7 +4738,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "22749.93", "total_removed": "4720.860935375", - "locked_amount": "505.4492276832454581195", + "locked_amount": "207.61599572971184611278", "deposits": [ { "amount": "6500", @@ -4890,7 +4890,7 @@ "tranche_end": "2023-05-01T00:00:00.000Z", "total_added": "22500", "total_removed": "6244.98110415", - "locked_amount": "3759.55916206261545", + "locked_amount": "3448.723814456722875", "deposits": [ { "amount": "7500", @@ -5308,7 +5308,7 @@ "tranche_end": "2023-06-02T00:00:00.000Z", "total_added": "1939928.38", "total_removed": "928642.9598472029154", - "locked_amount": "330816.5968674758056088834", + "locked_amount": "317526.7710493525900617104", "deposits": [ { "amount": "1852091.69", @@ -10796,7 +10796,7 @@ "tranche_id": 11, "tranche_start": "2021-09-03T00:00:00.000Z", "tranche_end": "2022-09-03T00:00:00.000Z", - "total_added": "57188.000000000000000003", + "total_added": "57213.000000000000000003", "total_removed": "48157.21518131551", "locked_amount": "0", "deposits": [ @@ -10815,6 +10815,11 @@ "user": "0xE9F41a0090fcc7eaf626037003AAD44B17098E7C", "tx": "0x971e9bcaace01278dc20ecd83d5de588d15be22c1797f4934cfd2ffb357a95ef" }, + { + "amount": "25", + "user": "0x363D3d06d70761c34D6EfEB25E409A9549E6970D", + "tx": "0x180cd3aca2d716aa233483a9a52b02e83d9ac88716ca85d998269965c7a01a96" + }, { "amount": "150", "user": "0xEb01fF124D71b6C7E6613fd6E0A86c28C733F008", @@ -22603,6 +22608,21 @@ "withdrawn_tokens": "0", "remaining_tokens": "472" }, + { + "address": "0x363D3d06d70761c34D6EfEB25E409A9549E6970D", + "deposits": [ + { + "amount": "25", + "user": "0x363D3d06d70761c34D6EfEB25E409A9549E6970D", + "tranche_id": 11, + "tx": "0x180cd3aca2d716aa233483a9a52b02e83d9ac88716ca85d998269965c7a01a96" + } + ], + "withdrawals": [], + "total_tokens": "25", + "withdrawn_tokens": "0", + "remaining_tokens": "25" + }, { "address": "0xEb01fF124D71b6C7E6613fd6E0A86c28C733F008", "deposits": [ @@ -39021,7 +39041,7 @@ "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "3732368.4671", "total_removed": "700133.348465855088393", - "locked_amount": "532851.256008774290412798337", + "locked_amount": "512429.420752227829460135708", "deposits": [ { "amount": "1998.95815", @@ -40402,8 +40422,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-12-05T00:00:00.000Z", "total_added": "15870102.715470999700000001", - "total_removed": "813651.96014483668060452", - "locked_amount": "7189143.92712736043441309136733409486645037", + "total_removed": "814470.78267520605435452", + "locked_amount": "7116729.41051479466949006868895061288618547", "deposits": [ { "amount": "16249.93", @@ -40932,6 +40952,11 @@ "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", "tx": "0x83497ea22d041f3b818b20cc112250ea3e38dc24b89a0bc5fee7198d6399a9cc" }, + { + "amount": "818.82253036937375", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tx": "0x58bac20de3636c17156dcb64322cc7612c48f553d941bc039c796ef4167eeeb5" + }, { "amount": "545.4204142199725", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -42950,6 +42975,12 @@ "tranche_id": 2, "tx": "0x83497ea22d041f3b818b20cc112250ea3e38dc24b89a0bc5fee7198d6399a9cc" }, + { + "amount": "818.82253036937375", + "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", + "tranche_id": 2, + "tx": "0x58bac20de3636c17156dcb64322cc7612c48f553d941bc039c796ef4167eeeb5" + }, { "amount": "545.4204142199725", "user": "0x20CD77B9FC2f1fEDfb6F184E25f7127BFE991C8b", @@ -44326,8 +44357,8 @@ } ], "total_tokens": "259998.8875", - "withdrawn_tokens": "142195.97974307557425", - "remaining_tokens": "117802.90775692442575" + "withdrawn_tokens": "143014.802273444948", + "remaining_tokens": "116984.085226555052" }, { "address": "0x89051CAb67Bc7F8CC44F7e270c6EDaf1EC57676c", @@ -46672,8 +46703,8 @@ "tranche_start": "2021-11-05T00:00:00.000Z", "tranche_end": "2023-05-05T00:00:00.000Z", "total_added": "14597706.0446472999", - "total_removed": "5796006.190908996961970156", - "locked_amount": "915526.544116288479207984933532503", + "total_removed": "5802489.518043560526965506", + "locked_amount": "848673.9247506211806821697552292785", "deposits": [ { "amount": "129284.449", @@ -46922,6 +46953,21 @@ "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", "tx": "0xf7c393e9346520e22750d3065cb66f49e315599b24406aed2b9570b5a25babe0" }, + { + "amount": "5343.35381683275644592", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tx": "0x5a00c2a54f777e2d2ac0f487c6978d4c0edd8a2b146636e45ba94c6988a330f8" + }, + { + "amount": "4.83182614679928618", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tx": "0x14811c8d77a39b0331cb2fdc96049b462916877050cc73143c494277304c2496" + }, + { + "amount": "1135.14149158400926325", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tx": "0xae9047ab72d73da1001c570a12dddc5e82fd523454c1b377928e008da9bdfa85" + }, { "amount": "755.482067130393772", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -50082,6 +50128,12 @@ "tranche_id": 3, "tx": "0xf7c393e9346520e22750d3065cb66f49e315599b24406aed2b9570b5a25babe0" }, + { + "amount": "1135.14149158400926325", + "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", + "tranche_id": 3, + "tx": "0xae9047ab72d73da1001c570a12dddc5e82fd523454c1b377928e008da9bdfa85" + }, { "amount": "755.482067130393772", "user": "0x4Aa3c35F6CC2d507E5C18205ee57099A4C80B19b", @@ -52760,8 +52812,8 @@ } ], "total_tokens": "359123.469575", - "withdrawn_tokens": "336567.43498450983251575", - "remaining_tokens": "22556.03459049016748425" + "withdrawn_tokens": "337702.576476093841779", + "remaining_tokens": "21420.893098906158221" }, { "address": "0xBdd412797c1B78535Afc5F71503b91fAbD0160fB", @@ -53009,6 +53061,18 @@ "tranche_id": 3, "tx": "0x55259c6fbd43ea2b1e081dc4964c6785ed4d03bb0cafc49de2f07685b056f487" }, + { + "amount": "5343.35381683275644592", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tranche_id": 3, + "tx": "0x5a00c2a54f777e2d2ac0f487c6978d4c0edd8a2b146636e45ba94c6988a330f8" + }, + { + "amount": "4.83182614679928618", + "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", + "tranche_id": 3, + "tx": "0x14811c8d77a39b0331cb2fdc96049b462916877050cc73143c494277304c2496" + }, { "amount": "80421.5336580481619385", "user": "0x66827bCD635f2bB1779d68c46aEB16541bCA6ba8", @@ -53341,8 +53405,8 @@ } ], "total_tokens": "1266324.603486", - "withdrawn_tokens": "1183921.35061421307696042", - "remaining_tokens": "82403.25287178692303958" + "withdrawn_tokens": "1189269.53625719263269252", + "remaining_tokens": "77055.06722880736730748" }, { "address": "0xC5d9221EB9c28A69859264c0A2Fe0d3272228296", @@ -54171,7 +54235,7 @@ "tranche_end": "2023-04-05T00:00:00.000Z", "total_added": "5778205.3912159303", "total_removed": "3381706.364737906998719578", - "locked_amount": "44826.6710986056946985124448000769", + "locked_amount": "18412.7968659549219832486449580318", "deposits": [ { "amount": "552496.6455", @@ -56298,8 +56362,8 @@ "tranche_start": "2022-06-05T00:00:00.000Z", "tranche_end": "2023-06-05T00:00:00.000Z", "total_added": "472355.6199999996", - "total_removed": "39906.7861606897949", - "locked_amount": "84433.32742222470651024894266868", + "total_removed": "40152.1324861581949", + "locked_amount": "81197.370889637811460062778488072", "deposits": [ { "amount": "3000", @@ -62963,6 +63027,21 @@ "user": "0x96d882E908C06cD697Ea07266Fb8D14ae129A50b", "tx": "0x93540a3930099c8b54157bb83ae50c8ced993009ae2091888f85704e6f13869c" }, + { + "amount": "164.310191526", + "user": "0xfA580dabBa10A5Ef817C7dc26Aaa5fF579D45a9D", + "tx": "0xf1df34ff15a8c7238e188632cf69532edb92f0d8203bf3031e5d19338cb5a9ca" + }, + { + "amount": "58.7761643844", + "user": "0xED71B9A9b5633e9d31A0986693658CBbf23c3c1B", + "tx": "0xda5812fda239af9581d2d60c8f4b959e0a8cc5466e5422c5b8fa9df72435d3bc" + }, + { + "amount": "22.259969558", + "user": "0x28FC83947F02f59Cb36b40f97f2D32BBC5D00585", + "tx": "0x14da65fbf5ae2f3a593036daa58b3353ab88fc22666e5514f9160e252ad2fdf9" + }, { "amount": "154.812094114", "user": "0x27e2254A2A8c9c9D1321E5Fe64cAD88e7A4f0ba7", @@ -82209,6 +82288,12 @@ } ], "withdrawals": [ + { + "amount": "58.7761643844", + "user": "0xED71B9A9b5633e9d31A0986693658CBbf23c3c1B", + "tranche_id": 5, + "tx": "0xda5812fda239af9581d2d60c8f4b959e0a8cc5466e5422c5b8fa9df72435d3bc" + }, { "amount": "20.679657534", "user": "0xED71B9A9b5633e9d31A0986693658CBbf23c3c1B", @@ -82223,8 +82308,8 @@ } ], "total_tokens": "180", - "withdrawn_tokens": "89.6315011398", - "remaining_tokens": "90.3684988602" + "withdrawn_tokens": "148.4076655242", + "remaining_tokens": "31.5923344758" }, { "address": "0x68927b7A4A360f5B615e104BA2cA2E264a563A33", @@ -82938,10 +83023,17 @@ "tx": "0xc8541da6a57f410b6faba47a5e5184bae700193b7bd042914fffc562114d92f5" } ], - "withdrawals": [], + "withdrawals": [ + { + "amount": "164.310191526", + "user": "0xfA580dabBa10A5Ef817C7dc26Aaa5fF579D45a9D", + "tranche_id": 5, + "tx": "0xf1df34ff15a8c7238e188632cf69532edb92f0d8203bf3031e5d19338cb5a9ca" + } + ], "total_tokens": "200", - "withdrawn_tokens": "0", - "remaining_tokens": "200" + "withdrawn_tokens": "164.310191526", + "remaining_tokens": "35.689808474" }, { "address": "0x40c9DF6b867cA219c0Ab4C2E390E8B919Be52e7e", @@ -84498,6 +84590,12 @@ } ], "withdrawals": [ + { + "amount": "22.259969558", + "user": "0x28FC83947F02f59Cb36b40f97f2D32BBC5D00585", + "tranche_id": 5, + "tx": "0x14da65fbf5ae2f3a593036daa58b3353ab88fc22666e5514f9160e252ad2fdf9" + }, { "amount": "17.060806698", "user": "0x28FC83947F02f59Cb36b40f97f2D32BBC5D00585", @@ -84530,8 +84628,8 @@ } ], "total_tokens": "200", - "withdrawn_tokens": "142.641089548", - "remaining_tokens": "57.358910452" + "withdrawn_tokens": "164.901059106", + "remaining_tokens": "35.098940894" }, { "address": "0xBef628af8547cE5264835F32487055a7e3dF393D", diff --git a/libs/fills/src/lib/fills-table.spec.tsx b/libs/fills/src/lib/fills-table.spec.tsx index c68567ea4..f1ee45630 100644 --- a/libs/fills/src/lib/fills-table.spec.tsx +++ b/libs/fills/src/lib/fills-table.spec.tsx @@ -7,7 +7,6 @@ import type { Trade } from './fills-data-provider'; import { FillsTable, getFeesBreakdown } from './fills-table'; import { generateFill } from './test-helpers'; -import { MemoryRouter } from 'react-router-dom'; describe('FillsTable', () => { let defaultFill: PartialDeep; @@ -37,11 +36,7 @@ describe('FillsTable', () => { it('correct columns are rendered', async () => { await act(async () => { - render( - - - - ); + render(); }); const headers = screen.getAllByRole('columnheader'); @@ -72,11 +67,7 @@ describe('FillsTable', () => { liquidityFee: '2', }, }); - render( - - - - ); + render(); const cells = screen.getAllByRole('gridcell'); const expectedValues = [ buyerFill.market?.tradableInstrument.instrument.name || '', @@ -109,11 +100,7 @@ describe('FillsTable', () => { liquidityFee: '1', }, }); - render( - - - - ); + render(); const cells = screen.getAllByRole('gridcell'); const expectedValues = [ @@ -142,9 +129,7 @@ describe('FillsTable', () => { aggressor: Schema.Side.SIDE_SELL, }); const { rerender } = render( - - - + ); expect( screen @@ -158,11 +143,7 @@ describe('FillsTable', () => { }, aggressor: Schema.Side.SIDE_BUY, }); - rerender( - - - - ); + rerender(); expect( screen @@ -179,11 +160,7 @@ describe('FillsTable', () => { }, aggressor: Schema.Side.SIDE_SELL, }); - render( - - - - ); + render(); const feeCell = screen .getAllByRole('gridcell') diff --git a/libs/orders/src/lib/components/order-list/order-list.spec.tsx b/libs/orders/src/lib/components/order-list/order-list.spec.tsx index 3d4f56538..20f66106e 100644 --- a/libs/orders/src/lib/components/order-list/order-list.spec.tsx +++ b/libs/orders/src/lib/components/order-list/order-list.spec.tsx @@ -13,7 +13,6 @@ import { limitOrder, marketOrder, } from '../mocks/generate-orders'; -import { MemoryRouter } from 'react-router-dom'; // Mock theme switcher to get around inconsistent mocking of zustand // stores @@ -37,11 +36,9 @@ const generateJsx = ( ) => { return ( - - - - - + + + ); }; diff --git a/libs/positions/src/lib/positions-table.spec.tsx b/libs/positions/src/lib/positions-table.spec.tsx index dc71063c7..e5fa8cddb 100644 --- a/libs/positions/src/lib/positions-table.spec.tsx +++ b/libs/positions/src/lib/positions-table.spec.tsx @@ -6,7 +6,6 @@ import type { Position } from './positions-data-providers'; import * as Schema from '@vegaprotocol/types'; import { PositionStatus, PositionStatusMapping } from '@vegaprotocol/types'; import type { ICellRendererParams } from 'ag-grid-community'; -import { MemoryRouter } from 'react-router-dom'; const singleRow: Position = { marketName: 'ETH/BTC (31 july 2022)', @@ -38,9 +37,7 @@ const singleRowData = [singleRow]; it('should render successfully', async () => { await act(async () => { const { baseElement } = render( - - - + ); expect(baseElement).toBeTruthy(); }); @@ -48,11 +45,7 @@ it('should render successfully', async () => { it('render correct columns', async () => { await act(async () => { - render( - - - - ); + render(); }); const headers = screen.getAllByRole('columnheader'); @@ -76,11 +69,7 @@ it('render correct columns', async () => { it('renders market name', async () => { await act(async () => { - render( - - - - ); + render(); }); expect(screen.getByText('ETH/BTC (31 july 2022)')).toBeTruthy(); }); @@ -91,11 +80,7 @@ it('Does not fail if the market name does not match the split pattern', async () Object.assign({}, singleRow, { marketName: breakingMarketName }), ]; await act(async () => { - render( - - - - ); + render(); }); expect(screen.getByText(breakingMarketName)).toBeTruthy(); @@ -105,9 +90,7 @@ it('add color and sign to amount, displays positive notional value', async () => let result: RenderResult; await act(async () => { result = render( - - - + ); }); let cells = screen.getAllByRole('gridcell'); @@ -118,12 +101,10 @@ it('add color and sign to amount, displays positive notional value', async () => expect(cells[1].textContent).toEqual('1,230.0'); await act(async () => { result.rerender( - - - + ); }); cells = screen.getAllByRole('gridcell'); @@ -137,9 +118,7 @@ it('displays mark price', async () => { let result: RenderResult; await act(async () => { result = render( - - - + ); }); @@ -148,18 +127,16 @@ it('displays mark price', async () => { await act(async () => { result.rerender( - - - + ); }); @@ -169,11 +146,7 @@ it('displays mark price', async () => { it('displays leverage', async () => { await act(async () => { - render( - - - - ); + render(); }); const cells = screen.getAllByRole('gridcell'); expect(cells[6].textContent).toEqual('1.1'); @@ -181,11 +154,7 @@ it('displays leverage', async () => { it('displays allocated margin', async () => { await act(async () => { - render( - - - - ); + render(); }); const cells = screen.getAllByRole('gridcell'); const cell = cells[7]; @@ -194,11 +163,7 @@ it('displays allocated margin', async () => { it('displays realised and unrealised PNL', async () => { await act(async () => { - render( - - - - ); + render(); }); const cells = screen.getAllByRole('gridcell'); expect(cells[9].textContent).toEqual('4.56'); @@ -207,15 +172,13 @@ it('displays realised and unrealised PNL', async () => { it('displays close button', async () => { await act(async () => { render( - - { - return; - }} - isReadOnly={false} - /> - + { + return; + }} + isReadOnly={false} + /> ); }); const cells = screen.getAllByRole('gridcell'); @@ -225,15 +188,13 @@ it('displays close button', async () => { it('do not display close button if openVolume is zero', async () => { await act(async () => { render( - - { - return; - }} - isReadOnly={false} - /> - + { + return; + }} + isReadOnly={false} + /> ); }); const cells = screen.getAllByRole('gridcell');