Skip to content

Commit

Permalink
test: DashGov.measureSecondsPerBlock(snapshot)
Browse files Browse the repository at this point in the history
  • Loading branch information
coolaj86 committed Aug 2, 2024
1 parent 85dbe1d commit e5793ad
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/calc-seconds-per-block.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"use strict";

let DashGov = require("../");

let secondsPerBlock = DashGov.estimateSecondsPerBlock();
if (secondsPerBlock !== DashGov._AVG_SECS_PER_BLOCK) {
throw new Error(
`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)`,
);
}

console.info(
`PASS: DashGov.estimateSecondsPerBlock() == ${DashGov._AVG_SECS_PER_BLOCK}`,
);
console.info(`PASS: DashGov.measureSecondsPerBlock(snapshot)`);

0 comments on commit e5793ad

Please sign in to comment.