Add separate config for mainnet, testnet and signet.
This commit is contained in:
		
							parent
							
								
									75459729ad
								
							
						
					
					
						commit
						2cd98c7c04
					
				@ -17,6 +17,8 @@
 | 
				
			|||||||
  "LIQUID_WEBSITE_URL": "https://liquid.network",
 | 
					  "LIQUID_WEBSITE_URL": "https://liquid.network",
 | 
				
			||||||
  "BISQ_WEBSITE_URL": "https://bisq.markets",
 | 
					  "BISQ_WEBSITE_URL": "https://bisq.markets",
 | 
				
			||||||
  "MINING_DASHBOARD": true,
 | 
					  "MINING_DASHBOARD": true,
 | 
				
			||||||
  "BLOCK_AUDIT_START_HEIGHT": 0,
 | 
					  "MAINNET_BLOCK_AUDIT_START_HEIGHT": 0,
 | 
				
			||||||
 | 
					  "TESTNET_BLOCK_AUDIT_START_HEIGHT": 0,
 | 
				
			||||||
 | 
					  "SIGNET_BLOCK_AUDIT_START_HEIGHT": 0,
 | 
				
			||||||
  "LIGHTNING": false
 | 
					  "LIGHTNING": false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -154,9 +154,7 @@ export class BlockComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
        if (history.state.data && history.state.data.block) {
 | 
					        if (history.state.data && history.state.data.block) {
 | 
				
			||||||
          this.blockHeight = history.state.data.block.height;
 | 
					          this.blockHeight = history.state.data.block.height;
 | 
				
			||||||
          if (this.blockHeight < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) {
 | 
					          this.updateAuditDataMissingFromBlockHeight(this.blockHeight);
 | 
				
			||||||
            this.auditDataMissing = true;
 | 
					 | 
				
			||||||
          }
 | 
					 | 
				
			||||||
          return of(history.state.data.block);
 | 
					          return of(history.state.data.block);
 | 
				
			||||||
        } else {
 | 
					        } else {
 | 
				
			||||||
          this.isLoadingBlock = true;
 | 
					          this.isLoadingBlock = true;
 | 
				
			||||||
@ -218,9 +216,7 @@ export class BlockComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
            this.apiService.getBlockAudit$(block.previousblockhash);
 | 
					            this.apiService.getBlockAudit$(block.previousblockhash);
 | 
				
			||||||
          }, 100);
 | 
					          }, 100);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (block.height < this.stateService.env.BLOCK_AUDIT_START_HEIGHT) {
 | 
					        this.updateAuditDataMissingFromBlockHeight(block.height);
 | 
				
			||||||
          this.auditDataMissing = true;
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
        this.block = block;
 | 
					        this.block = block;
 | 
				
			||||||
        this.blockHeight = block.height;
 | 
					        this.blockHeight = block.height;
 | 
				
			||||||
        this.lastBlockHeight = this.blockHeight;
 | 
					        this.lastBlockHeight = this.blockHeight;
 | 
				
			||||||
@ -590,4 +586,23 @@ export class BlockComponent implements OnInit, OnDestroy {
 | 
				
			|||||||
      this.hoverTx = null;
 | 
					      this.hoverTx = null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  updateAuditDataMissingFromBlockHeight(blockHeight: number): void {
 | 
				
			||||||
 | 
					    switch (this.stateService.network) {
 | 
				
			||||||
 | 
					      case 'testnet':
 | 
				
			||||||
 | 
					        if (blockHeight < this.stateService.env.TESTNET_BLOCK_AUDIT_START_HEIGHT) {
 | 
				
			||||||
 | 
					          this.auditDataMissing = true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      case 'signet':
 | 
				
			||||||
 | 
					        if (blockHeight < this.stateService.env.SIGNET_BLOCK_AUDIT_START_HEIGHT) {
 | 
				
			||||||
 | 
					          this.auditDataMissing = true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        break;
 | 
				
			||||||
 | 
					      default:
 | 
				
			||||||
 | 
					        if (blockHeight < this.stateService.env.MAINNET_BLOCK_AUDIT_START_HEIGHT) {
 | 
				
			||||||
 | 
					          this.auditDataMissing = true;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -39,7 +39,9 @@ export interface Env {
 | 
				
			|||||||
  BISQ_WEBSITE_URL: string;
 | 
					  BISQ_WEBSITE_URL: string;
 | 
				
			||||||
  MINING_DASHBOARD: boolean;
 | 
					  MINING_DASHBOARD: boolean;
 | 
				
			||||||
  LIGHTNING: boolean;
 | 
					  LIGHTNING: boolean;
 | 
				
			||||||
  BLOCK_AUDIT_START_HEIGHT: number;
 | 
					  MAINNET_BLOCK_AUDIT_START_HEIGHT: number;
 | 
				
			||||||
 | 
					  TESTNET_BLOCK_AUDIT_START_HEIGHT: number;
 | 
				
			||||||
 | 
					  SIGNET_BLOCK_AUDIT_START_HEIGHT: number;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const defaultEnv: Env = {
 | 
					const defaultEnv: Env = {
 | 
				
			||||||
@ -65,7 +67,9 @@ const defaultEnv: Env = {
 | 
				
			|||||||
  'BISQ_WEBSITE_URL': 'https://bisq.markets',
 | 
					  'BISQ_WEBSITE_URL': 'https://bisq.markets',
 | 
				
			||||||
  'MINING_DASHBOARD': true,
 | 
					  'MINING_DASHBOARD': true,
 | 
				
			||||||
  'LIGHTNING': false,
 | 
					  'LIGHTNING': false,
 | 
				
			||||||
  'BLOCK_AUDIT_START_HEIGHT': 0,
 | 
					  'MAINNET_BLOCK_AUDIT_START_HEIGHT': 0,
 | 
				
			||||||
 | 
					  'TESTNET_BLOCK_AUDIT_START_HEIGHT': 0,
 | 
				
			||||||
 | 
					  'SIGNET_BLOCK_AUDIT_START_HEIGHT': 0,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@Injectable({
 | 
					@Injectable({
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user