Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "frontend",
"version": "0.8.8",
"version": "0.8.9",
"scripts": {
"install:deps": "npm install",
"start": "npm install && ng serve --configuration local --open",
Expand Down Expand Up @@ -29,7 +29,7 @@
"@ngrx/effects": "^16.2.0",
"@ngrx/router-store": "^16.2.0",
"@ngrx/store": "^16.2.0",
"@openmina/shared": "^0.96.0",
"@openmina/shared": "^0.100.0",
"base-x": "^5.0.0",
"buffer": "^6.0.3",
"d3": "^7.8.4",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ export class BenchmarksWalletsEffects extends MinaRustBaseEffect<BenchmarksWalle
switchMap(({ action }) => this.benchmarksService.getAccounts().pipe(
switchMap(payload => {
const actions = [];
actions.push({ type: BENCHMARKS_WALLETS_GET_WALLETS_SUCCESS, payload });
if (action.payload?.initialRequest) {
actions.push({ type: BENCHMARKS_WALLETS_GET_ALL_TXS });
}
actions.push({ type: BENCHMARKS_WALLETS_GET_WALLETS_SUCCESS, payload });
return actions;
}),
)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import { RustService } from '@core/services/rust.service';
import {
MempoolTransaction,
MempoolTransactionKind,
SignedCommand,
SignedCommand, ZkappCommand,
} from '@shared/types/mempool/mempool-transaction.type';
import { getTimeFromMemo, removeUnicodeEscapes } from '@shared/helpers/transaction.helper';
import { ONE_BILLION } from '@openmina/shared';
import { any, ONE_BILLION } from '@openmina/shared';

export const WALLETS: { privateKey: string, publicKey: string }[] = [
{
Expand Down Expand Up @@ -4082,21 +4082,28 @@ export class BenchmarksWalletsService {
}

getAllIncludedTransactions(): Observable<MempoolTransaction[]> {
return this.rust.get<{ SignedCommand: SignedCommand }[]>('/best-chain-user-commands').pipe(
return this.rust.get<Array<{ SignedCommand: SignedCommand } | {
ZkappCommand: ZkappCommand
}>>('/best-chain-user-commands').pipe(
map(data => this.mapTxPoolResponse(data)),
);
}

private mapTxPoolResponse(response: { SignedCommand: SignedCommand }[]): MempoolTransaction[] {
return response.map(tx => ({
kind: MempoolTransactionKind.PAYMENT,
sender: tx.SignedCommand.payload.common.fee_payer_pk,
fee: Number(tx.SignedCommand.payload.common.fee),
nonce: Number(tx.SignedCommand.payload.common.nonce),
memo: removeUnicodeEscapes(tx.SignedCommand.payload.common.memo),
transactionData: tx.SignedCommand,
sentFromStressingTool: tx.SignedCommand.payload.common.memo.includes('S.T.'),
sentByMyBrowser: tx.SignedCommand.payload.common.memo.includes(localStorage.getItem('browserId')),
} as MempoolTransaction));
private mapTxPoolResponse(response: Array<{ SignedCommand: SignedCommand } | {
ZkappCommand: ZkappCommand
}>): MempoolTransaction[] {
return response
.filter(tx => !!any(tx).SignedCommand)
.map(tx => tx as { SignedCommand: SignedCommand })
.map((tx: { SignedCommand: SignedCommand }) => ({
kind: MempoolTransactionKind.PAYMENT,
sender: tx.SignedCommand.payload.common.fee_payer_pk,
fee: Number(tx.SignedCommand.payload.common.fee),
nonce: Number(tx.SignedCommand.payload.common.nonce),
memo: removeUnicodeEscapes(tx.SignedCommand.payload.common.memo),
transactionData: tx.SignedCommand,
sentFromStressingTool: tx.SignedCommand.payload.common.memo.includes('S.T.'),
sentByMyBrowser: tx.SignedCommand.payload.common.memo.includes(localStorage.getItem('browserId')),
} as MempoolTransaction));
}
}
1 change: 0 additions & 1 deletion frontend/src/app/features/benchmarks/wallets/mock.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ export class BlockProductionOverviewSlotsComponent extends StoreDispatcher imple
private getSlotText(d: BlockProductionOverviewSlot): string {
let text = '';
if (d.finished) {
text = 'Slot not won';
text = 'Block by another producer';
}

if (d.canonical) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,15 @@
</div>
</div>
<div class="flex-column pl-12 pr-12">
<!-- <div class="fx-row-vert-cent flex-between h-lg">-->
<!-- <span class="tertiary">Mina Explorer</span>-->
<!-- <button class="btn-primary"-->
<!-- (click)="viewInMinaExplorer()"-->
<!-- [disabled]="!slot?.hash">View in Explorer-->
<!-- </button>-->
<!-- </div>-->
<div class="fx-row-vert-cent flex-between h-lg">
<span class="tertiary">Mina Explorer</span>
<button class="btn-primary fx-row-vert-cent"
(click)="viewInMinaExplorer()"
[disabled]="!slot?.hash">
<span class="mina-icon f-18 primary icon-300 mr-5">open_in_new</span>
View in Explorer
</button>
</div>
<div class="fx-row-vert-cent flex-between h-lg">
<span class="tertiary">Consensus</span>
<ng-container *ngIf="slot?.status === BlockProductionWonSlotsStatus.Canonical">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { any, hasValue, noMillisFormat, ONE_THOUSAND, SecDurationConfig, toReada
import { filter } from 'rxjs';
import { BlockProductionWonSlotsActions } from '@block-production/won-slots/block-production-won-slots.actions';
import { AppSelectors } from '@app/app.state';
import { CONFIG } from '@shared/constants/config';

@Component({
selector: 'mina-block-production-won-slots-side-panel',
Expand Down Expand Up @@ -68,7 +69,7 @@ export class BlockProductionWonSlotsSidePanelComponent extends StoreDispatcher i

private listenToActiveNode(): void {
this.select(AppSelectors.activeNode, (node) => {
this.minaExplorer = node.minaExplorerNetwork;
this.minaExplorer = node.minaExplorerNetwork ?? CONFIG.globalConfig?.minaExplorerNetwork;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export class BlockProductionWonSlotsTableComponent extends MinaTableRustWrapper<
{ name: 'status', sort: 'message' },
{ name: 'age', sort: 'slotTime' },
{ name: 'height' },
{ name: 'global slot', sort: 'globalSlot' },
{ name: 'global slot', sort: 'globalSlot', tooltip: 'Global slot since hard fork' },
{ name: 'epoch slot', sort: 'slotInEpoch' },
{ name: 'transactions', sort: 'transactionsTotal' },
{ name: 'SNARKs', sort: 'completedWorksCount' },
Expand All @@ -57,7 +57,7 @@ export class BlockProductionWonSlotsTableComponent extends MinaTableRustWrapper<
}

protected override setupTable(): void {
this.table.gridTemplateColumns = [210, 140, 90, 110, 120, 120, 120, 120, 150, 150];
this.table.gridTemplateColumns = [210, 140, 90, 140, 120, 120, 120, 120, 150, 150];
this.table.propertyForActiveCheck = 'globalSlot';
this.table.thGroupsTemplate = this.thGroupsTemplate;
this.table.sortAction = BlockProductionWonSlotsActions.sort;
Expand Down
13 changes: 13 additions & 0 deletions frontend/src/app/layout/toolbar/loading.reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ import {
NETWORK_BOOTSTRAP_STATS_INIT,
} from '@network/bootstrap-stats/network-bootstrap-stats.actions';
import { BLOCK_PRODUCTION_PREFIX } from '@block-production/block-production.actions';
import {
BENCHMARKS_WALLETS_GET_ALL_TXS,
BENCHMARKS_WALLETS_GET_ALL_TXS_SUCCESS,
BENCHMARKS_WALLETS_GET_WALLETS, BENCHMARKS_WALLETS_GET_WALLETS_SUCCESS,
} from '@benchmarks/wallets/benchmarks-wallets.actions';

export type LoadingState = string[];

Expand Down Expand Up @@ -75,6 +80,9 @@ export function loadingReducer(state: LoadingState = initialState, action: Featu

case NETWORK_NODE_DHT_INIT:
case NETWORK_BOOTSTRAP_STATS_INIT:

case BENCHMARKS_WALLETS_GET_WALLETS:
case BENCHMARKS_WALLETS_GET_ALL_TXS:
return add(state, action);

/* ------------ REMOVE ------------ */
Expand Down Expand Up @@ -142,6 +150,11 @@ export function loadingReducer(state: LoadingState = initialState, action: Featu
case NETWORK_BOOTSTRAP_STATS_CLOSE:
return remove(state, [NETWORK_BOOTSTRAP_STATS_INIT]);

case BENCHMARKS_WALLETS_GET_WALLETS_SUCCESS:
return remove(state, BENCHMARKS_WALLETS_GET_WALLETS);
case BENCHMARKS_WALLETS_GET_ALL_TXS_SUCCESS:
return remove(state, BENCHMARKS_WALLETS_GET_ALL_TXS);

default:
return state;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
import { MinaNetwork } from '@shared/types/core/mina/mina.type';

export interface MinaEnv {
production: boolean;
configs: MinaNode[];
identifier?: string;
globalConfig?: {
features?: FeaturesConfig;
canAddNodes?: boolean;
minaExplorerNetwork?: MinaNetwork;
};
}

Expand All @@ -14,7 +17,7 @@ export interface MinaNode {
memoryProfiler?: string;
debugger?: string;
features?: FeaturesConfig;
minaExplorerNetwork?: 'mainnet' | 'devnet';
minaExplorerNetwork?: MinaNetwork;
isCustom?: boolean;
isWebNode?: boolean;
}
Expand Down
1 change: 1 addition & 0 deletions frontend/src/app/shared/types/core/mina/mina.type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type MinaNetwork = 'mainnet' | 'devnet';
Loading
Loading