Merge branch 'master' into natsoni/acceleration-timeline

This commit is contained in:
natsoni 2024-07-04 20:55:45 +09:00 committed by GitHub
commit bdd51a0f4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 43 additions and 19 deletions

View file

@ -23,7 +23,7 @@
"rust-gbt": "file:./rust-gbt", "rust-gbt": "file:./rust-gbt",
"socks-proxy-agent": "~7.0.0", "socks-proxy-agent": "~7.0.0",
"typescript": "~4.9.3", "typescript": "~4.9.3",
"ws": "~8.17.1" "ws": "~8.18.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/code-frame": "^7.18.6", "@babel/code-frame": "^7.18.6",
@ -7690,9 +7690,9 @@
} }
}, },
"node_modules/ws": { "node_modules/ws": {
"version": "8.17.1", "version": "8.18.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
}, },
@ -13424,9 +13424,9 @@
} }
}, },
"ws": { "ws": {
"version": "8.17.1", "version": "8.18.0",
"resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
"integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
"requires": {} "requires": {}
}, },
"y18n": { "y18n": {

View file

@ -52,7 +52,7 @@
"redis": "^4.6.6", "redis": "^4.6.6",
"socks-proxy-agent": "~7.0.0", "socks-proxy-agent": "~7.0.0",
"typescript": "~4.9.3", "typescript": "~4.9.3",
"ws": "~8.17.1" "ws": "~8.18.0"
}, },
"devDependencies": { "devDependencies": {
"@babel/code-frame": "^7.18.6", "@babel/code-frame": "^7.18.6",

View file

@ -353,6 +353,9 @@ class MempoolBlocks {
for (const txid of Object.keys(candidates?.txs ?? mempool)) { for (const txid of Object.keys(candidates?.txs ?? mempool)) {
if (txid in mempool) { if (txid in mempool) {
mempool[txid].cpfpDirty = false; mempool[txid].cpfpDirty = false;
mempool[txid].ancestors = [];
mempool[txid].descendants = [];
mempool[txid].bestDescendant = null;
} }
} }
for (const [txid, rate] of rates) { for (const [txid, rate] of rates) {

View file

@ -364,7 +364,7 @@
</ng-template> </ng-template>
<ng-template [ngIf]="error"> <ng-template [ngIf]="error">
<app-http-error [error]="error"> <app-http-error [error]="error">
<span i18n="error.general-loading-data">Error loading data.</span> <span i18n="block.error.loading-block-data">Error loading block data.</span>
</app-http-error> </app-http-error>
</ng-template> </ng-template>

View file

@ -81,11 +81,13 @@ export class BlocksList implements OnInit {
}) })
).subscribe(); ).subscribe();
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
this.keyNavigationSubscription = this.stateService.keyNavigation$ this.keyNavigationSubscription = this.stateService.keyNavigation$
.pipe( .pipe(
filter((event) => event.key === prevKey || event.key === nextKey),
tap((event) => { tap((event) => {
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
if (event.key === prevKey && this.page > 1) { if (event.key === prevKey && this.page > 1) {
this.page--; this.page--;
this.isLoading = true; this.isLoading = true;

View file

@ -45,7 +45,7 @@
</div> </div>
</div> </div>
<div ngbDropdown class="w-33" *ngIf="stateService.env.ACCELERATOR"> <div ngbDropdown class="w-33" *ngIf="stateService.env.ACCELERATOR && isMainnet">
<button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="accelerator.accelerations">Accelerations</button> <button class="btn btn-primary w-100" id="dropdownBasic1" ngbDropdownToggle i18n="accelerator.accelerations">Accelerations</button>
<div ngbDropdownMenu aria-labelledby="dropdownBasic1"> <div ngbDropdownMenu aria-labelledby="dropdownBasic1">
<a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/acceleration/fees' | relativeUrl]" <a class="dropdown-item" routerLinkActive="active" [routerLink]="['/graphs/acceleration/fees' | relativeUrl]"

View file

@ -9,6 +9,7 @@ import { WebsocketService } from '../../services/websocket.service';
}) })
export class GraphsComponent implements OnInit { export class GraphsComponent implements OnInit {
flexWrap = false; flexWrap = false;
isMainnet = this.stateService.isMainnet();
constructor( constructor(
public stateService: StateService, public stateService: StateService,

View file

@ -73,11 +73,13 @@ export class RecentPegsListComponent implements OnInit {
}), }),
).subscribe(); ).subscribe();
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
this.keyNavigationSubscription = this.stateService.keyNavigation$ this.keyNavigationSubscription = this.stateService.keyNavigation$
.pipe( .pipe(
filter((event) => event.key === prevKey || event.key === nextKey),
tap((event) => { tap((event) => {
const prevKey = this.dir === 'ltr' ? 'ArrowLeft' : 'ArrowRight';
const nextKey = this.dir === 'ltr' ? 'ArrowRight' : 'ArrowLeft';
if (event.key === prevKey && this.page > 1) { if (event.key === prevKey && this.page > 1) {
this.page--; this.page--;
this.isLoading = true; this.isLoading = true;

View file

@ -71,7 +71,6 @@
<a ngbDropdownItem *ngIf="env.SIGNET_ENABLED" class="signet" [class.active]="network.val === 'signet'" [routerLink]="networkPaths['signet'] || '/signet'"><app-svg-images name="signet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Signet</a> <a ngbDropdownItem *ngIf="env.SIGNET_ENABLED" class="signet" [class.active]="network.val === 'signet'" [routerLink]="networkPaths['signet'] || '/signet'"><app-svg-images name="signet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Signet</a>
<a ngbDropdownItem *ngIf="env.TESTNET_ENABLED" class="testnet" [class.active]="network.val === 'testnet'" [routerLink]="networkPaths['testnet'] || '/testnet'"><app-svg-images name="testnet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet3</a> <a ngbDropdownItem *ngIf="env.TESTNET_ENABLED" class="testnet" [class.active]="network.val === 'testnet'" [routerLink]="networkPaths['testnet'] || '/testnet'"><app-svg-images name="testnet" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet3</a>
<a ngbDropdownItem *ngIf="env.TESTNET4_ENABLED" class="testnet4" [class.active]="network.val === 'testnet4'" [routerLink]="networkPaths['testnet4'] || '/testnet4'"><app-svg-images name="testnet4" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet4 <span class="badge badge-pill badge-warning beta-network" i18n="beta">beta</span></a> <a ngbDropdownItem *ngIf="env.TESTNET4_ENABLED" class="testnet4" [class.active]="network.val === 'testnet4'" [routerLink]="networkPaths['testnet4'] || '/testnet4'"><app-svg-images name="testnet4" width="22" height="22" viewBox="0 0 65 65" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Testnet4 <span class="badge badge-pill badge-warning beta-network" i18n="beta">beta</span></a>
<h6 *ngIf="env.LIQUID_ENABLED" class="dropdown-header" i18n="master-page.layer2-networks-header">Layer 2 Networks</h6>
<a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquid'] || '')" ngbDropdownItem *ngIf="env.LIQUID_ENABLED" class="liquid" [class.active]="network.val === 'liquid'"><app-svg-images name="liquid" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid</a> <a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquid'] || '')" ngbDropdownItem *ngIf="env.LIQUID_ENABLED" class="liquid" [class.active]="network.val === 'liquid'"><app-svg-images name="liquid" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid</a>
<a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquidtestnet'] || '/testnet')" ngbDropdownItem *ngIf="env.LIQUID_TESTNET_ENABLED" class="liquidtestnet" [class.active]="network.val === 'liquid'"><app-svg-images name="liquidtestnet" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid Testnet</a> <a [href]="env.LIQUID_WEBSITE_URL + urlLanguage + (networkPaths['liquidtestnet'] || '/testnet')" ngbDropdownItem *ngIf="env.LIQUID_TESTNET_ENABLED" class="liquidtestnet" [class.active]="network.val === 'liquid'"><app-svg-images name="liquidtestnet" width="22" height="22" viewBox="0 0 125 125" style="width: 25px; height: 25px;" class="mainnet mr-1"></app-svg-images> Liquid Testnet</a>
</div> </div>

View file

@ -1,6 +1,6 @@
<app-indexing-progress></app-indexing-progress> <app-indexing-progress></app-indexing-progress>
<div class="container-xl"> <div class="container-xl" *ngIf="!error; else errorTemplate">
<!-- Pool overview --> <!-- Pool overview -->
<div *ngIf="poolStats$ | async as poolStats; else loadingMain"> <div *ngIf="poolStats$ | async as poolStats; else loadingMain">
@ -459,4 +459,11 @@
<ng-template #emptyTd> <ng-template #emptyTd>
<td class="text-center"></td> <td class="text-center"></td>
</ng-template>
<ng-template #errorTemplate>
<br>
<app-http-error [error]="error">
<span i18n="pool.error.loading-pool-data">Error loading pool data.</span>
</app-http-error>
</ng-template> </ng-template>

View file

@ -9,6 +9,7 @@ import { StateService } from '../../services/state.service';
import { selectPowerOfTen } from '../../bitcoin.utils'; import { selectPowerOfTen } from '../../bitcoin.utils';
import { formatNumber } from '@angular/common'; import { formatNumber } from '@angular/common';
import { SeoService } from '../../services/seo.service'; import { SeoService } from '../../services/seo.service';
import { HttpErrorResponse } from '@angular/common/http';
interface AccelerationTotal { interface AccelerationTotal {
cost: number, cost: number,
@ -33,6 +34,7 @@ export class PoolComponent implements OnInit {
blocks$: Observable<BlockExtended[]>; blocks$: Observable<BlockExtended[]>;
oobFees$: Observable<AccelerationTotal[]>; oobFees$: Observable<AccelerationTotal[]>;
isLoading = true; isLoading = true;
error: HttpErrorResponse | null = null;
chartOptions: EChartsOption = {}; chartOptions: EChartsOption = {};
chartInitOptions = { chartInitOptions = {
@ -105,6 +107,10 @@ export class PoolComponent implements OnInit {
} }
return this.apiService.getPoolBlocks$(this.slug, this.blocks[this.blocks.length - 1]?.height); return this.apiService.getPoolBlocks$(this.slug, this.blocks[this.blocks.length - 1]?.height);
}), }),
catchError((err) => {
this.error = err;
return of([]);
}),
tap((newBlocks) => { tap((newBlocks) => {
this.blocks = this.blocks.concat(newBlocks); this.blocks = this.blocks.concat(newBlocks);
}), }),

View file

@ -410,6 +410,10 @@ export class StateService {
return this.network === 'liquid' || this.network === 'liquidtestnet'; return this.network === 'liquid' || this.network === 'liquidtestnet';
} }
isMainnet(): boolean {
return this.env.ROOT_NETWORK === '' && this.network === '';
}
isAnyTestnet(): boolean { isAnyTestnet(): boolean {
return ['testnet', 'testnet4', 'signet', 'liquidtestnet'].includes(this.network); return ['testnet', 'testnet4', 'signet', 'liquidtestnet'].includes(this.network);
} }

View file

@ -4,6 +4,6 @@ import { Pipe, PipeTransform } from '@angular/core';
@Pipe({ name: 'httpErrorMsg' }) @Pipe({ name: 'httpErrorMsg' })
export class HttpErrorPipe implements PipeTransform { export class HttpErrorPipe implements PipeTransform {
transform(e: HttpErrorResponse | null): string { transform(e: HttpErrorResponse | null): string {
return e ? `${e.status}: ${e.statusText}` : ''; return e ? `${e.status} ${e.statusText}: ${e.error}` : '';
} }
} }

View file

@ -2,8 +2,8 @@
"OFFICIAL_MEMPOOL_SPACE": true, "OFFICIAL_MEMPOOL_SPACE": true,
"TESTNET_ENABLED": true, "TESTNET_ENABLED": true,
"TESTNET4_ENABLED": true, "TESTNET4_ENABLED": true,
"LIQUID_ENABLED": true, "LIQUID_ENABLED": false,
"LIQUID_TESTNET_ENABLED": true, "LIQUID_TESTNET_ENABLED": false,
"BISQ_ENABLED": true, "BISQ_ENABLED": true,
"BISQ_SEPARATE_BACKEND": true, "BISQ_SEPARATE_BACKEND": true,
"SIGNET_ENABLED": true, "SIGNET_ENABLED": true,