Merge branch 'master' into mononaut/blockchain-scroll
This commit is contained in:
@@ -144,10 +144,12 @@ export class BlockComponent implements OnInit, OnDestroy {
|
||||
for (const block of blocks) {
|
||||
if (block.id === this.blockHash) {
|
||||
this.block = block;
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
if (block?.extras?.reward != undefined) {
|
||||
this.fees = block.extras.reward / 100000000 - this.blockSubsidy;
|
||||
if (block.extras) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
if (block?.extras?.reward != undefined) {
|
||||
this.fees = block.extras.reward / 100000000 - this.blockSubsidy;
|
||||
}
|
||||
}
|
||||
} else if (block.height === this.block?.height) {
|
||||
this.block.stale = true;
|
||||
@@ -246,8 +248,10 @@ export class BlockComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
this.updateAuditAvailableFromBlockHeight(block.height);
|
||||
this.block = block;
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
if (block.extras) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
}
|
||||
this.blockHeight = block.height;
|
||||
this.lastBlockHeight = this.blockHeight;
|
||||
this.nextBlockHeight = block.height + 1;
|
||||
|
||||
@@ -113,8 +113,10 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
|
||||
const animate = this.chainTip != null && latestHeight > this.chainTip;
|
||||
|
||||
for (const block of blocks) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
if (block?.extras) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
}
|
||||
}
|
||||
|
||||
this.blocks = blocks;
|
||||
@@ -251,7 +253,7 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
|
||||
if (height >= 0) {
|
||||
this.cacheService.loadBlock(height);
|
||||
block = this.cacheService.getCachedBlock(height) || null;
|
||||
if (block) {
|
||||
if (block?.extras) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
}
|
||||
@@ -293,8 +295,10 @@ export class BlockchainBlocksComponent implements OnInit, OnChanges, OnDestroy {
|
||||
onBlockLoaded(block: BlockExtended) {
|
||||
const blockIndex = this.height - block.height;
|
||||
if (blockIndex >= 0 && blockIndex < this.blocks.length) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
if (block?.extras) {
|
||||
block.extras.minFee = this.getMinBlockFee(block);
|
||||
block.extras.maxFee = this.getMaxBlockFee(block);
|
||||
}
|
||||
this.blocks[blockIndex] = block;
|
||||
this.blockStyles[blockIndex] = this.getStyleForBlock(block, blockIndex);
|
||||
}
|
||||
|
||||
@@ -84,10 +84,10 @@ export class BlocksList implements OnInit {
|
||||
.pipe(
|
||||
switchMap((blocks) => {
|
||||
if (blocks[0].height <= this.lastBlockHeight) {
|
||||
return [null]; // Return an empty stream so the last pipe is not executed
|
||||
return of([]); // Return an empty stream so the last pipe is not executed
|
||||
}
|
||||
this.lastBlockHeight = blocks[0].height;
|
||||
return blocks;
|
||||
return of(blocks);
|
||||
})
|
||||
)
|
||||
])
|
||||
|
||||
@@ -26,6 +26,8 @@ try {
|
||||
}
|
||||
}
|
||||
|
||||
const githubSecret = process.env.GITHUB_TOKEN;
|
||||
|
||||
function download(filename, url) {
|
||||
https.get(url, (response) => {
|
||||
if (response.statusCode < 200 || response.statusCode > 299) {
|
||||
@@ -55,6 +57,12 @@ function downloadMiningPoolLogos$() {
|
||||
headers: {'user-agent': 'node.js'}
|
||||
};
|
||||
|
||||
if (githubSecret) {
|
||||
console.log('Downloading the mining pool logos with authentication');
|
||||
options.headers['authorization'] = `Bearer ${githubSecret}`;
|
||||
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
|
||||
}
|
||||
|
||||
https.get(options, (response) => {
|
||||
const chunks_of_data = [];
|
||||
|
||||
@@ -109,6 +117,13 @@ function downloadPromoVideoSubtiles$() {
|
||||
headers: {'user-agent': 'node.js'}
|
||||
};
|
||||
|
||||
if (githubSecret) {
|
||||
console.log('Downloading the promo video subtitles with authentication');
|
||||
options.headers['authorization'] = `Bearer ${githubSecret}`;
|
||||
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
|
||||
}
|
||||
|
||||
|
||||
https.get(options, (response) => {
|
||||
const chunks_of_data = [];
|
||||
|
||||
@@ -163,6 +178,12 @@ function downloadPromoVideo$() {
|
||||
headers: {'user-agent': 'node.js'}
|
||||
};
|
||||
|
||||
if (githubSecret) {
|
||||
console.log('Downloading the promo videos with authentication');
|
||||
options.headers['authorization'] = `Bearer ${githubSecret}`;
|
||||
options.headers['X-GitHub-Api-Version'] = '2022-11-28';
|
||||
}
|
||||
|
||||
https.get(options, (response) => {
|
||||
const chunks_of_data = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user