Sort chains by node count

This commit is contained in:
maciejhirsz
2018-07-12 16:04:04 +02:00
parent 47b80ad30e
commit ea8d7ad77d
10 changed files with 63 additions and 25 deletions
+11 -2
View File
@@ -1,5 +1,14 @@
import { Opaque } from './helpers';
import { NodeId, NodeDetails, NodeStats, BlockNumber, BlockDetails, Timestamp, ChainLabel } from './types';
import {
NodeId,
NodeCount,
NodeDetails,
NodeStats,
BlockNumber,
BlockDetails,
Timestamp,
ChainLabel
} from './types';
export const Actions = {
BestBlock: 0 as 0,
@@ -54,7 +63,7 @@ export namespace Variants {
export interface AddedChainMessage extends MessageBase {
action: typeof Actions.AddedChain;
payload: ChainLabel;
payload: [ChainLabel, NodeCount];
}
export interface RemovedChainMessage extends MessageBase {
+1
View File
@@ -12,6 +12,7 @@ export type BlockHash = Opaque<string, 'BlockHash'>;
export type Milliseconds = Opaque<number, 'Milliseconds'>;
export type Timestamp = Opaque<Milliseconds, 'Timestamp'>;
export type PropagationTime = Opaque<Milliseconds, 'PropagationTime'>;
export type NodeCount = Opaque<number, 'NodeCount'>;
export type PeerCount = Opaque<number, 'PeerCount'>;
export type TransactionCount = Opaque<number, 'TransactionCount'>;