mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-15 23:25:35 +00:00
88f736d180
The scores are lightly processed from their internal representation. Example usage: ``` $ yarn backend; $ node bin/sourcecred.js load sourcecred/sourcecred $ node bin/sourcecred.js scores sourcecred/sourcecred > scores.json ``` The data structure is as follows: ```js export type NodeOutput = {| +id: string, +totalCred: number, +intervalCred: $ReadOnlyArray<number>, |}; export type ScoreOutput = Compatible<{| +users: $ReadOnlyArray<NodeOutput>, +intervals: $ReadOnlyArray<Interval>, |}>; ``` Test plan: I added sharness tests at `sharness/test_cli_scores.t`. In the past, we've used javascript tests for CLI commands. However, those are pretty time-consuming to write, and are less robust than simply running the command from bash. Check the snapshot for a sense of what the new data format looks like. Also, the snapshot updater now updates this snapshot too. Relevant for #1047. Thanks to @Beanow for feedback on the output format and design. Thanks to @wchargin for help in code review.