Skip to content

Commit

Permalink
Merge pull request #1690 from spacemeshos/tweak-node-event-smesher-ids
Browse files Browse the repository at this point in the history
Display SmesherID for any NodeEvent that contain it
  • Loading branch information
brusherru authored Mar 14, 2024
2 parents 0f534d4 + bc6f6bd commit f2304d2
Show file tree
Hide file tree
Showing 19 changed files with 152 additions and 45 deletions.
3 changes: 1 addition & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[submodule "vendor/api"]
path = vendor/api
url = https://github.com/spacemeshos/api
branch = api-v2
url = https://github.com/spacemeshos/api
6 changes: 6 additions & 0 deletions api/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { DebugServiceClient as _spacemesh_v1_DebugServiceClient, DebugServi
import type { GlobalStateServiceClient as _spacemesh_v1_GlobalStateServiceClient, GlobalStateServiceDefinition as _spacemesh_v1_GlobalStateServiceDefinition } from './spacemesh/v1/GlobalStateService';
import type { MeshServiceClient as _spacemesh_v1_MeshServiceClient, MeshServiceDefinition as _spacemesh_v1_MeshServiceDefinition } from './spacemesh/v1/MeshService';
import type { NodeServiceClient as _spacemesh_v1_NodeServiceClient, NodeServiceDefinition as _spacemesh_v1_NodeServiceDefinition } from './spacemesh/v1/NodeService';
import type { PostInfoServiceClient as _spacemesh_v1_PostInfoServiceClient, PostInfoServiceDefinition as _spacemesh_v1_PostInfoServiceDefinition } from './spacemesh/v1/PostInfoService';
import type { PostServiceClient as _spacemesh_v1_PostServiceClient, PostServiceDefinition as _spacemesh_v1_PostServiceDefinition } from './spacemesh/v1/PostService';
import type { SmesherServiceClient as _spacemesh_v1_SmesherServiceClient, SmesherServiceDefinition as _spacemesh_v1_SmesherServiceDefinition } from './spacemesh/v1/SmesherService';
import type { TransactionServiceClient as _spacemesh_v1_TransactionServiceClient, TransactionServiceDefinition as _spacemesh_v1_TransactionServiceDefinition } from './spacemesh/v1/TransactionService';
Expand Down Expand Up @@ -91,6 +92,7 @@ export interface ProtoGrpcType {
AppEventStreamResponse: MessageTypeDefinition
Block: MessageTypeDefinition
BuildResponse: MessageTypeDefinition
ChangeLogLevelRequest: MessageTypeDefinition
CheckpointStreamRequest: MessageTypeDefinition
CheckpointStreamResponse: MessageTypeDefinition
CoinbaseResponse: MessageTypeDefinition
Expand Down Expand Up @@ -182,6 +184,7 @@ export interface ProtoGrpcType {
ParseTransactionResponse: MessageTypeDefinition
PeerInfo: MessageTypeDefinition
PostConfigResponse: MessageTypeDefinition
PostInfoService: SubtypeConstructor<typeof grpc.Client, _spacemesh_v1_PostInfoServiceClient> & { service: _spacemesh_v1_PostInfoServiceDefinition }
PostService: SubtypeConstructor<typeof grpc.Client, _spacemesh_v1_PostServiceClient> & { service: _spacemesh_v1_PostServiceDefinition }
PostSetupOpts: MessageTypeDefinition
PostSetupProvider: MessageTypeDefinition
Expand All @@ -190,6 +193,9 @@ export interface ProtoGrpcType {
PostSetupStatus: MessageTypeDefinition
PostSetupStatusResponse: MessageTypeDefinition
PostSetupStatusStreamResponse: MessageTypeDefinition
PostState: MessageTypeDefinition
PostStatesRequest: MessageTypeDefinition
PostStatesResponse: MessageTypeDefinition
Proof: MessageTypeDefinition
ProofMetadata: MessageTypeDefinition
Proposal: MessageTypeDefinition
Expand Down
12 changes: 12 additions & 0 deletions api/generated/spacemesh/v1/ChangeLogLevelRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Original file: vendor/api/spacemesh/v1/debug_types.proto


export interface ChangeLogLevelRequest {
'module'?: (string);
'level'?: (string);
}

export interface ChangeLogLevelRequest__Output {
'module': (string);
'level': (string);
}
13 changes: 13 additions & 0 deletions api/generated/spacemesh/v1/DebugService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type { AccountsRequest as _spacemesh_v1_AccountsRequest, AccountsRequest_
import type { AccountsResponse as _spacemesh_v1_AccountsResponse, AccountsResponse__Output as _spacemesh_v1_AccountsResponse__Output } from '../../spacemesh/v1/AccountsResponse';
import type { ActiveSetRequest as _spacemesh_v1_ActiveSetRequest, ActiveSetRequest__Output as _spacemesh_v1_ActiveSetRequest__Output } from '../../spacemesh/v1/ActiveSetRequest';
import type { ActiveSetResponse as _spacemesh_v1_ActiveSetResponse, ActiveSetResponse__Output as _spacemesh_v1_ActiveSetResponse__Output } from '../../spacemesh/v1/ActiveSetResponse';
import type { ChangeLogLevelRequest as _spacemesh_v1_ChangeLogLevelRequest, ChangeLogLevelRequest__Output as _spacemesh_v1_ChangeLogLevelRequest__Output } from '../../spacemesh/v1/ChangeLogLevelRequest';
import type { Empty as _google_protobuf_Empty, Empty__Output as _google_protobuf_Empty__Output } from '../../google/protobuf/Empty';
import type { NetworkInfoResponse as _spacemesh_v1_NetworkInfoResponse, NetworkInfoResponse__Output as _spacemesh_v1_NetworkInfoResponse__Output } from '../../spacemesh/v1/NetworkInfoResponse';
import type { Proposal as _spacemesh_v1_Proposal, Proposal__Output as _spacemesh_v1_Proposal__Output } from '../../spacemesh/v1/Proposal';
Expand All @@ -29,6 +30,15 @@ export interface DebugServiceClient extends grpc.Client {
activeSet(argument: _spacemesh_v1_ActiveSetRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_ActiveSetResponse__Output) => void): grpc.ClientUnaryCall;
activeSet(argument: _spacemesh_v1_ActiveSetRequest, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_ActiveSetResponse__Output) => void): grpc.ClientUnaryCall;

ChangeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
ChangeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
ChangeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
ChangeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
changeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
changeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
changeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;
changeLogLevel(argument: _spacemesh_v1_ChangeLogLevelRequest, callback: (error?: grpc.ServiceError, result?: _google_protobuf_Empty__Output) => void): grpc.ClientUnaryCall;

NetworkInfo(argument: _google_protobuf_Empty, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_NetworkInfoResponse__Output) => void): grpc.ClientUnaryCall;
NetworkInfo(argument: _google_protobuf_Empty, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_NetworkInfoResponse__Output) => void): grpc.ClientUnaryCall;
NetworkInfo(argument: _google_protobuf_Empty, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_NetworkInfoResponse__Output) => void): grpc.ClientUnaryCall;
Expand All @@ -50,6 +60,8 @@ export interface DebugServiceHandlers extends grpc.UntypedServiceImplementation

ActiveSet: grpc.handleUnaryCall<_spacemesh_v1_ActiveSetRequest__Output, _spacemesh_v1_ActiveSetResponse>;

ChangeLogLevel: grpc.handleUnaryCall<_spacemesh_v1_ChangeLogLevelRequest__Output, _google_protobuf_Empty>;

NetworkInfo: grpc.handleUnaryCall<_google_protobuf_Empty__Output, _spacemesh_v1_NetworkInfoResponse>;

ProposalsStream: grpc.handleServerStreamingCall<_google_protobuf_Empty__Output, _spacemesh_v1_Proposal>;
Expand All @@ -59,6 +71,7 @@ export interface DebugServiceHandlers extends grpc.UntypedServiceImplementation
export interface DebugServiceDefinition extends grpc.ServiceDefinition {
Accounts: MethodDefinition<_spacemesh_v1_AccountsRequest, _spacemesh_v1_AccountsResponse, _spacemesh_v1_AccountsRequest__Output, _spacemesh_v1_AccountsResponse__Output>
ActiveSet: MethodDefinition<_spacemesh_v1_ActiveSetRequest, _spacemesh_v1_ActiveSetResponse, _spacemesh_v1_ActiveSetRequest__Output, _spacemesh_v1_ActiveSetResponse__Output>
ChangeLogLevel: MethodDefinition<_spacemesh_v1_ChangeLogLevelRequest, _google_protobuf_Empty, _spacemesh_v1_ChangeLogLevelRequest__Output, _google_protobuf_Empty__Output>
NetworkInfo: MethodDefinition<_google_protobuf_Empty, _spacemesh_v1_NetworkInfoResponse, _google_protobuf_Empty__Output, _spacemesh_v1_NetworkInfoResponse__Output>
ProposalsStream: MethodDefinition<_google_protobuf_Empty, _spacemesh_v1_Proposal, _google_protobuf_Empty__Output, _spacemesh_v1_Proposal__Output>
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventAtxPubished.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export interface EventAtxPubished {
'id'?: (Buffer | Uint8Array | string);
'wait'?: (_google_protobuf_Duration | null);
'until'?: (_google_protobuf_Timestamp | null);
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventAtxPubished__Output {
Expand All @@ -17,4 +18,5 @@ export interface EventAtxPubished__Output {
'id': (Buffer);
'wait': (_google_protobuf_Duration__Output | null);
'until': (_google_protobuf_Timestamp__Output | null);
'smesher': (Buffer);
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventEligibilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface EventEligibilities {
'atx'?: (Buffer | Uint8Array | string);
'activeSetSize'?: (number);
'eligibilities'?: (_spacemesh_v1_ProposalEligibility)[];
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventEligibilities__Output {
Expand All @@ -16,4 +17,5 @@ export interface EventEligibilities__Output {
'atx': (Buffer);
'activeSetSize': (number);
'eligibilities': (_spacemesh_v1_ProposalEligibility__Output)[];
'smesher': (Buffer);
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventInitComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@


export interface EventInitComplete {
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventInitComplete__Output {
'smesher': (Buffer);
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventPoetWaitProof.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export interface EventPoetWaitProof {
'target'?: (number);
'wait'?: (_google_protobuf_Duration | null);
'until'?: (_google_protobuf_Timestamp | null);
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventPoetWaitProof__Output {
'publish': (number);
'target': (number);
'wait': (_google_protobuf_Duration__Output | null);
'until': (_google_protobuf_Timestamp__Output | null);
'smesher': (Buffer);
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventPoetWaitRound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ export interface EventPoetWaitRound {
'publish'?: (number);
'wait'?: (_google_protobuf_Duration | null);
'until'?: (_google_protobuf_Timestamp | null);
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventPoetWaitRound__Output {
'current': (number);
'publish': (number);
'wait': (_google_protobuf_Duration__Output | null);
'until': (_google_protobuf_Timestamp__Output | null);
'smesher': (Buffer);
}
2 changes: 2 additions & 0 deletions api/generated/spacemesh/v1/EventProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
export interface EventProposal {
'layer'?: (number);
'proposal'?: (Buffer | Uint8Array | string);
'smesher'?: (Buffer | Uint8Array | string);
}

export interface EventProposal__Output {
'layer': (number);
'proposal': (Buffer);
'smesher': (Buffer);
}
27 changes: 27 additions & 0 deletions api/generated/spacemesh/v1/PostInfoService.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Original file: vendor/api/spacemesh/v1/post.proto

import type * as grpc from '@grpc/grpc-js'
import type { MethodDefinition } from '@grpc/proto-loader'
import type { PostStatesRequest as _spacemesh_v1_PostStatesRequest, PostStatesRequest__Output as _spacemesh_v1_PostStatesRequest__Output } from '../../spacemesh/v1/PostStatesRequest';
import type { PostStatesResponse as _spacemesh_v1_PostStatesResponse, PostStatesResponse__Output as _spacemesh_v1_PostStatesResponse__Output } from '../../spacemesh/v1/PostStatesResponse';

export interface PostInfoServiceClient extends grpc.Client {
PostStates(argument: _spacemesh_v1_PostStatesRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
PostStates(argument: _spacemesh_v1_PostStatesRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
PostStates(argument: _spacemesh_v1_PostStatesRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
PostStates(argument: _spacemesh_v1_PostStatesRequest, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
postStates(argument: _spacemesh_v1_PostStatesRequest, metadata: grpc.Metadata, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
postStates(argument: _spacemesh_v1_PostStatesRequest, metadata: grpc.Metadata, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
postStates(argument: _spacemesh_v1_PostStatesRequest, options: grpc.CallOptions, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;
postStates(argument: _spacemesh_v1_PostStatesRequest, callback: (error?: grpc.ServiceError, result?: _spacemesh_v1_PostStatesResponse__Output) => void): grpc.ClientUnaryCall;

}

export interface PostInfoServiceHandlers extends grpc.UntypedServiceImplementation {
PostStates: grpc.handleUnaryCall<_spacemesh_v1_PostStatesRequest__Output, _spacemesh_v1_PostStatesResponse>;

}

export interface PostInfoServiceDefinition extends grpc.ServiceDefinition {
PostStates: MethodDefinition<_spacemesh_v1_PostStatesRequest, _spacemesh_v1_PostStatesResponse, _spacemesh_v1_PostStatesRequest__Output, _spacemesh_v1_PostStatesResponse__Output>
}
22 changes: 22 additions & 0 deletions api/generated/spacemesh/v1/PostState.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Original file: vendor/api/spacemesh/v1/post_types.proto


// Original file: vendor/api/spacemesh/v1/post_types.proto

export enum _spacemesh_v1_PostState_State {
_UNUSED = 0,
IDLE = 1,
PROVING = 2,
}

export interface PostState {
'id'?: (Buffer | Uint8Array | string);
'state'?: (_spacemesh_v1_PostState_State | keyof typeof _spacemesh_v1_PostState_State);
'name'?: (string);
}

export interface PostState__Output {
'id': (Buffer);
'state': (_spacemesh_v1_PostState_State);
'name': (string);
}
8 changes: 8 additions & 0 deletions api/generated/spacemesh/v1/PostStatesRequest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Original file: vendor/api/spacemesh/v1/post_types.proto


export interface PostStatesRequest {
}

export interface PostStatesRequest__Output {
}
11 changes: 11 additions & 0 deletions api/generated/spacemesh/v1/PostStatesResponse.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// Original file: vendor/api/spacemesh/v1/post_types.proto

import type { PostState as _spacemesh_v1_PostState, PostState__Output as _spacemesh_v1_PostState__Output } from '../../spacemesh/v1/PostState';

export interface PostStatesResponse {
'states'?: (_spacemesh_v1_PostState)[];
}

export interface PostStatesResponse__Output {
'states': (_spacemesh_v1_PostState__Output)[];
}
4 changes: 3 additions & 1 deletion api/generated/spacemesh/v2alpha1/ActivationsCountRequest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@

export interface ActivationsCountRequest {
'epoch'?: (number);
'_epoch'?: "epoch";
}

export interface ActivationsCountRequest__Output {
'epoch': (number);
'epoch'?: (number);
'_epoch': "epoch";
}
45 changes: 4 additions & 41 deletions app/screens/node/NodeEventActivityRow.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import React from 'react';
import { NodeEvent } from '../../../shared/types';
import ErrorMessage from '../../basicComponents/ErrorMessage';
import { getEventType, toHexString } from '../../../shared/utils';
import { getEventType } from '../../../shared/utils';
import { CustomTimeAgo } from '../../basicComponents';
import Address, { AddressType } from '../../components/common/Address';
import { getNodeEventStage } from './nodeEventUtils';

const withTime = (str: string, now: number, wait?: number) =>
Expand Down Expand Up @@ -36,12 +35,6 @@ const getEventErrorMessage = (event: NodeEvent) => {
}
};

const ensureSmesherIdType = (s: string | Buffer | Uint8Array | undefined) => {
if (!s) return null;
if (typeof s === 'string') return s;
return toHexString(s);
};

export default (event: NodeEvent) => {
if (event && event.failure) {
return <ErrorMessage>{getEventErrorMessage(event)}</ErrorMessage>;
Expand All @@ -51,17 +44,7 @@ export default (event: NodeEvent) => {
}
switch (getEventType(event)) {
case 'initStart': {
const smesherId = ensureSmesherIdType(event.initStart?.smesher);
if (!smesherId) {
return 'Started PoS data initialization';
} else {
return (
<>
Started PoS data initialization for
<Address type={AddressType.SMESHER} address={smesherId} isHex />
</>
);
}
return 'Started PoS data initialization';
}
case 'initComplete':
return 'Completed PoS data initialization';
Expand All @@ -85,30 +68,10 @@ export default (event: NodeEvent) => {
);
}
case 'postStart': {
const smesherId = ensureSmesherIdType(event.postStart?.smesher);
if (!smesherId) {
return "Generating PoST proof for the PoET's challenge";
} else {
return (
<>
Generating PoST proof for the PoET&apos;s challenge for
<Address type={AddressType.SMESHER} address={smesherId} isHex />
</>
);
}
return "Generating PoST proof for the PoET's challenge";
}
case 'postComplete': {
const smesherId = ensureSmesherIdType(event.postComplete?.smesher);
if (!smesherId) {
return 'Finished generating PoST proof';
} else {
return (
<>
Finished generating PoST proof for
<Address type={AddressType.SMESHER} address={smesherId} isHex />
</>
);
}
return 'Finished generating PoST proof';
}
case 'atxPublished':
return 'Published activation. Waiting for the next epoch';
Expand Down
24 changes: 24 additions & 0 deletions app/screens/node/NodeEventsLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ import { RootState } from '../../types';
import { NodeEvent } from '../../../shared/types';
import { epochByLayer, nextEpochTime } from '../../../shared/layerUtils';
import { BackButton, CorneredContainer } from '../../components/common';
import { getEventPayload, toHexString } from '../../../shared/utils';
import { safeReactKey, setRef } from '../../infra/utils';
import { MainPath } from '../../routerPaths';
import Address, { AddressType } from '../../components/common/Address';
import { getNodeEventStatusColor } from './nodeEventUtils';
import NodeEventActivityRow from './NodeEventActivityRow';

Expand Down Expand Up @@ -118,6 +120,27 @@ const NoWrap = styled.span`
white-space: nowrap;
`;

const ensureSmesherIdType = (s: string | Buffer | Uint8Array | undefined) => {
if (!s) return null;
if (typeof s === 'string') return s;
return toHexString(s);
};

const renderSmesherID = (e: NodeEvent) => {
const payload = getEventPayload(e);
if (!payload || !('smesher' in payload)) {
return null;
}
const smesherId = ensureSmesherIdType(payload.smesher);
if (!smesherId) return null;
return (
<EventText>
Smesher&nbsp;ID:&nbsp;
<Address type={AddressType.SMESHER} address={smesherId} isHex />
</EventText>
);
};

const NodeEventsLog = ({ history }: RouteComponentProps) => {
const status = useSelector((state: RootState) => state.node.status);
const genesisTime = useSelector(
Expand Down Expand Up @@ -179,6 +202,7 @@ const NodeEventsLog = ({ history }: RouteComponentProps) => {
<CustomTimeAgo time={e.timestamp} />
</NoWrap>
<EventText>{NodeEventActivityRow(e)}</EventText>
{renderSmesherID(e)}
</TextWrapper>
</EventRow>
);
Expand Down
8 changes: 8 additions & 0 deletions shared/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,14 @@ export const getEventType = (event: NodeEvent): Event['details'] => {
return eventType;
};

export const getEventPayload = (event: NodeEvent) => {
const eventName = getEventType(event);
if (!eventName) {
throw new Error(`Cannot get NodeEvent payload: ${JSON.stringify(event)}`);
}
return event[eventName];
};

export const generateGenesisID = (genesisTime: string, extraData: string) => {
return `${toHexString(hash(genesisTime + extraData)).substring(0, 40)}`;
};
Expand Down
2 changes: 1 addition & 1 deletion vendor/api
Submodule api updated 41 files
+2 βˆ’0 buf.yaml
+3 βˆ’3 release/go/go.mod
+6 βˆ’6 release/go/go.sum
+154 βˆ’96 release/go/spacemesh/v1/admin_types.pb.go
+35 βˆ’27 release/go/spacemesh/v1/debug.pb.go
+85 βˆ’0 release/go/spacemesh/v1/debug.pb.gw.go
+37 βˆ’0 release/go/spacemesh/v1/debug_grpc.pb.go
+170 βˆ’95 release/go/spacemesh/v1/debug_types.pb.go
+29 βˆ’19 release/go/spacemesh/v1/post.pb.go
+139 βˆ’0 release/go/spacemesh/v1/post.pb.gw.go
+90 βˆ’0 release/go/spacemesh/v1/post_grpc.pb.go
+283 βˆ’29 release/go/spacemesh/v1/post_types.pb.go
+0 βˆ’425 release/go/spacemesh/v2alpha1/account.pb.go
+0 βˆ’171 release/go/spacemesh/v2alpha1/account.pb.gw.go
+0 βˆ’107 release/go/spacemesh/v2alpha1/account_grpc.pb.go
+45 βˆ’43 release/go/spacemesh/v2alpha1/activation.pb.go
+0 βˆ’261 release/go/spacemesh/v2alpha1/block.pb.go
+0 βˆ’434 release/go/spacemesh/v2alpha1/layer.pb.go
+0 βˆ’171 release/go/spacemesh/v2alpha1/layer.pb.gw.go
+0 βˆ’107 release/go/spacemesh/v2alpha1/layer_grpc.pb.go
+0 βˆ’281 release/go/spacemesh/v2alpha1/network.pb.go
+0 βˆ’171 release/go/spacemesh/v2alpha1/network.pb.gw.go
+0 βˆ’107 release/go/spacemesh/v2alpha1/network_grpc.pb.go
+0 βˆ’346 release/go/spacemesh/v2alpha1/node.pb.go
+0 βˆ’171 release/go/spacemesh/v2alpha1/node.pb.gw.go
+0 βˆ’107 release/go/spacemesh/v2alpha1/node_grpc.pb.go
+0 βˆ’1,940 release/go/spacemesh/v2alpha1/tx.pb.go
+0 βˆ’538 release/go/spacemesh/v2alpha1/tx.pb.gw.go
+0 βˆ’333 release/go/spacemesh/v2alpha1/tx_grpc.pb.go
+8 βˆ’1 spacemesh/v1/admin_types.proto
+2 βˆ’0 spacemesh/v1/debug.proto
+6 βˆ’0 spacemesh/v1/debug_types.proto
+6 βˆ’0 spacemesh/v1/post.proto
+30 βˆ’0 spacemesh/v1/post_types.proto
+0 βˆ’29 spacemesh/v2alpha1/account.proto
+1 βˆ’1 spacemesh/v2alpha1/activation.proto
+0 βˆ’16 spacemesh/v2alpha1/block.proto
+0 βˆ’34 spacemesh/v2alpha1/layer.proto
+0 βˆ’19 spacemesh/v2alpha1/network.proto
+0 βˆ’25 spacemesh/v2alpha1/node.proto
+0 βˆ’155 spacemesh/v2alpha1/tx.proto

0 comments on commit f2304d2

Please sign in to comment.