Skip to content

Commit 7e3e53b

Browse files
committed
test: DashGov.measureSecondsPerBlock(snapshot)
1 parent 34610db commit 7e3e53b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

tests/calc-seconds-per-block.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"use strict";
2+
3+
let DashGov = require("../");
4+
5+
let secondsPerBlock = DashGov.estimateSecondsPerBlock();
6+
if (secondsPerBlock !== DashGov._AVG_SECS_PER_BLOCK) {
7+
throw new Error(
8+
`expected '${DashGov._AVG_SECS_PER_BLOCK}' got '${secondsPerBlock}', the method of calculating seconds per block has changed (possibly due to using a different block height and timestamp)`,
9+
);
10+
}
11+
12+
console.info(
13+
`PASS: DashGov.estimateSecondsPerBlock() == ${DashGov._AVG_SECS_PER_BLOCK}`,
14+
);
15+
console.info(`PASS: DashGov.measureSecondsPerBlock(snapshot)`);

0 commit comments

Comments
 (0)