From 9df490373b515f9c16b76a2e52a24796169154a0 Mon Sep 17 00:00:00 2001 From: nymkappa Date: Fri, 28 Jan 2022 14:31:33 +0900 Subject: [PATCH] Fixes post rebase --- backend/package.json | 3 +- backend/src/api/database-migration.ts | 11 ------- backend/src/index.ts | 1 + .../integration/mainnet/mainnet.spec.ts | 29 +++++++++---------- frontend/mempool-frontend-config.sample.json | 1 + .../src/app/interfaces/node-api.interface.ts | 2 -- 6 files changed, 16 insertions(+), 31 deletions(-) diff --git a/backend/package.json b/backend/package.json index 594e25427..a5c9a32ff 100644 --- a/backend/package.json +++ b/backend/package.json @@ -25,8 +25,7 @@ "build": "npm run tsc", "start": "node --max-old-space-size=2048 dist/index.js", "start-production": "node --max-old-space-size=4096 dist/index.js", - "test": "echo \"Error: no test specified\" && exit 1", - "migrate-pools": "npm run tsc ; node dist/api/pools-parser.js" + "test": "echo \"Error: no test specified\" && exit 1" }, "dependencies": { "@mempool/bitcoin": "^3.0.3", diff --git a/backend/src/api/database-migration.ts b/backend/src/api/database-migration.ts index baa518598..24ecc03cf 100644 --- a/backend/src/api/database-migration.ts +++ b/backend/src/api/database-migration.ts @@ -353,17 +353,6 @@ class DatabaseMigration { ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`; } - private getCreatePoolsTableQuery(): string { - return `CREATE TABLE IF NOT EXISTS pools ( - id int(11) NOT NULL AUTO_INCREMENT, - name varchar(50) NOT NULL, - link varchar(255) NOT NULL, - addresses text NOT NULL, - regexes text NOT NULL, - PRIMARY KEY (id) - ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;`; - } - private getCreateBlocksTableQuery(): string { return `CREATE TABLE IF NOT EXISTS blocks ( height int(11) unsigned NOT NULL, diff --git a/backend/src/index.ts b/backend/src/index.ts index 5b3cdc9c2..ec7e96162 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -89,6 +89,7 @@ class Server { await checkDbConnection(); try { await databaseMigration.$initializeOrMigrateDatabase(); + await poolsParser.migratePoolsJson(); } catch (e) { throw new Error(e instanceof Error ? e.message : 'Error'); } diff --git a/frontend/cypress/integration/mainnet/mainnet.spec.ts b/frontend/cypress/integration/mainnet/mainnet.spec.ts index d04f4d287..752617092 100644 --- a/frontend/cypress/integration/mainnet/mainnet.spec.ts +++ b/frontend/cypress/integration/mainnet/mainnet.spec.ts @@ -371,22 +371,19 @@ describe('Mainnet', () => { cy.get('.blockchain-wrapper').should('not.visible'); }); - it('loads genesis block and click on the arrow left', () => { - cy.viewport('macbook-16'); - cy.visit('/block/0'); - cy.waitForSkeletonGone(); - cy.waitForPageIdle(); - cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); - cy.get('[ngbtooltip="Previous Block"] > .ng-fa-icon > .svg-inline--fa').should('not.exist'); - cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').click().then(() => { - cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); - cy.get('[ngbtooltip="Previous Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); - }); - }); + it('loads genesis block and click on the arrow left', () => { + cy.viewport('macbook-16'); + cy.visit('/block/0'); + cy.waitForSkeletonGone(); + cy.waitForPageIdle(); + cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); + cy.get('[ngbtooltip="Previous Block"] > .ng-fa-icon > .svg-inline--fa').should('not.exist'); + cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').click().then(() => { + cy.get('[ngbtooltip="Next Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); + cy.get('[ngbtooltip="Previous Block"] > .ng-fa-icon > .svg-inline--fa').should('be.visible'); }); }); - it('loads skeleton when changes between networks', () => { cy.visit('/'); cy.waitForSkeletonGone(); @@ -417,11 +414,11 @@ describe('Mainnet', () => { cy.get(':nth-child(3) > #bitcoin-block-0').should('not.exist'); }); - it('loads the blocks screen', () => { + it('loads the pools screen', () => { cy.visit('/'); cy.waitForSkeletonGone(); - cy.get('#btn-blocks').click().then(() => { - cy.waitForPageIdle(); + cy.get('#btn-pools').click().then(() => { + cy.wait(1000); }); }); diff --git a/frontend/mempool-frontend-config.sample.json b/frontend/mempool-frontend-config.sample.json index 139c55962..0715cb0bd 100644 --- a/frontend/mempool-frontend-config.sample.json +++ b/frontend/mempool-frontend-config.sample.json @@ -10,6 +10,7 @@ "NGINX_PROTOCOL": "http", "NGINX_HOSTNAME": "127.0.0.1", "NGINX_PORT": "80", + "BLOCK_WEIGHT_UNITS": 4000000, "MEMPOOL_BLOCKS_AMOUNT": 8, "BASE_MODULE": "mempool", "MEMPOOL_WEBSITE_URL": "https://mempool.space", diff --git a/frontend/src/app/interfaces/node-api.interface.ts b/frontend/src/app/interfaces/node-api.interface.ts index 4b56d4319..6d87f648d 100644 --- a/frontend/src/app/interfaces/node-api.interface.ts +++ b/frontend/src/app/interfaces/node-api.interface.ts @@ -72,8 +72,6 @@ export interface PoolsStats { pools: SinglePoolStats[]; } -export interface ITranslators { [language: string]: string; } - export interface MiningStats { lastEstimatedHashrate: string, blockCount: number,