Merge pull request #932 from MiguelMedeiros/fix-empty-mempool-blocks
Fix: mempool empty block.
This commit is contained in:
commit
cfec9345c8
@ -18,6 +18,12 @@ describe('Liquid', () => {
|
|||||||
|
|
||||||
if (baseModule === 'mempool' || baseModule === 'liquid') {
|
if (baseModule === 'mempool' || baseModule === 'liquid') {
|
||||||
|
|
||||||
|
it('check first mempool block after skeleton loads', () => {
|
||||||
|
cy.visit(`${basePath}`);
|
||||||
|
cy.waitForSkeletonGone();
|
||||||
|
cy.get('#mempool-block-0 > .blockLink').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('loads the dashboard', () => {
|
it('loads the dashboard', () => {
|
||||||
cy.visit(`${basePath}`);
|
cy.visit(`${basePath}`);
|
||||||
cy.waitForSkeletonGone();
|
cy.waitForSkeletonGone();
|
||||||
|
@ -24,6 +24,12 @@ describe('Mainnet', () => {
|
|||||||
|
|
||||||
if (baseModule === 'mempool') {
|
if (baseModule === 'mempool') {
|
||||||
|
|
||||||
|
it('check first mempool block after skeleton loads', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.waitForSkeletonGone();
|
||||||
|
cy.get('#mempool-block-0 > .blockLink').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('loads the status screen', () => {
|
it('loads the status screen', () => {
|
||||||
cy.visit('/status');
|
cy.visit('/status');
|
||||||
cy.get('#mempool-block-0').should('be.visible');
|
cy.get('#mempool-block-0').should('be.visible');
|
||||||
|
@ -17,6 +17,12 @@ describe('Signet', () => {
|
|||||||
cy.waitForSkeletonGone();
|
cy.waitForSkeletonGone();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('check first mempool block after skeleton loads', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.waitForSkeletonGone();
|
||||||
|
cy.get('#mempool-block-0 > .blockLink').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('loads the dashboard with the skeleton blocks', () => {
|
it('loads the dashboard with the skeleton blocks', () => {
|
||||||
cy.mockMempoolSocket();
|
cy.mockMempoolSocket();
|
||||||
cy.visit("/signet");
|
cy.visit("/signet");
|
||||||
|
@ -17,6 +17,12 @@ describe('Testnet', () => {
|
|||||||
cy.waitForSkeletonGone();
|
cy.waitForSkeletonGone();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('check first mempool block after skeleton loads', () => {
|
||||||
|
cy.visit('/');
|
||||||
|
cy.waitForSkeletonGone();
|
||||||
|
cy.get('#mempool-block-0 > .blockLink').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
it('loads the dashboard with the skeleton blocks', () => {
|
it('loads the dashboard with the skeleton blocks', () => {
|
||||||
cy.mockMempoolSocket();
|
cy.mockMempoolSocket();
|
||||||
cy.visit("/testnet");
|
cy.visit("/testnet");
|
||||||
|
@ -88,12 +88,17 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
|
|||||||
block.blink = specialBlocks[block.height] ? true : false;
|
block.blink = specialBlocks[block.height] ? true : false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const stringifiedBlocks = JSON.stringify(mempoolBlocks);
|
|
||||||
this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
|
if (!mempoolBlocks.length) {
|
||||||
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
|
const emptyBlock = [{ index: 0, blockSize: 0, blockVSize: 0, feeRange: [0, 0], medianFee: 0, nTx: 0, totalFees: 0 }];
|
||||||
|
this.mempoolBlocks = emptyBlock;
|
||||||
|
} else {
|
||||||
|
const stringifiedBlocks = JSON.stringify(mempoolBlocks);
|
||||||
|
this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
|
||||||
|
this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
|
||||||
|
}
|
||||||
this.updateMempoolBlockStyles();
|
this.updateMempoolBlockStyles();
|
||||||
this.calculateTransactionPosition();
|
this.calculateTransactionPosition();
|
||||||
|
|
||||||
return this.mempoolBlocks;
|
return this.mempoolBlocks;
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user