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
+3 -2
View File
@@ -1,6 +1,7 @@
import * as WebSocket from 'ws';
import * as EventEmitter from 'events';
import Node from './Node';
import Chain from './Chain';
import { timestamp, Maybe, FeedMessage, Types, idGenerator } from '@dotstats/common';
const nextId = idGenerator<Types.FeedId>();
@@ -66,10 +67,10 @@ export default class Feed {
};
}
public static addedChain(label: Types.ChainLabel): FeedMessage.Message {
public static addedChain(chain: Chain): FeedMessage.Message {
return {
action: Actions.AddedChain,
payload: label
payload: [chain.label, chain.nodeCount]
};
}