Merge pull request #932 from MiguelMedeiros/fix-empty-mempool-blocks
Fix: mempool empty block.
This commit is contained in:
		
						commit
						b39767196b
					
				@ -18,6 +18,12 @@ describe('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', () => {
 | 
			
		||||
            cy.visit(`${basePath}`);
 | 
			
		||||
            cy.waitForSkeletonGone();
 | 
			
		||||
 | 
			
		||||
@ -24,6 +24,12 @@ describe('Mainnet', () => {
 | 
			
		||||
 | 
			
		||||
    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', () => {
 | 
			
		||||
            cy.visit('/status');
 | 
			
		||||
            cy.get('#mempool-block-0').should('be.visible');
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,12 @@ describe('Signet', () => {
 | 
			
		||||
        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', () => {
 | 
			
		||||
        cy.mockMempoolSocket();
 | 
			
		||||
        cy.visit("/signet");
 | 
			
		||||
 | 
			
		||||
@ -17,6 +17,12 @@ describe('Testnet', () => {
 | 
			
		||||
        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', () => {
 | 
			
		||||
        cy.mockMempoolSocket();
 | 
			
		||||
        cy.visit("/testnet");
 | 
			
		||||
 | 
			
		||||
@ -88,12 +88,17 @@ export class MempoolBlocksComponent implements OnInit, OnDestroy {
 | 
			
		||||
              block.blink = specialBlocks[block.height] ? true : false;
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
          const stringifiedBlocks = JSON.stringify(mempoolBlocks);
 | 
			
		||||
          this.mempoolBlocksFull = JSON.parse(stringifiedBlocks);
 | 
			
		||||
          this.mempoolBlocks = this.reduceMempoolBlocksToFitScreen(JSON.parse(stringifiedBlocks));
 | 
			
		||||
 | 
			
		||||
          if (!mempoolBlocks.length) {
 | 
			
		||||
            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.calculateTransactionPosition();
 | 
			
		||||
 | 
			
		||||
          return this.mempoolBlocks;
 | 
			
		||||
        })
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user