We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 82c8341 commit 07e76ebCopy full SHA for 07e76eb
tests/calc-next-superblock.js
@@ -0,0 +1,28 @@
1
+"use strict";
2
+
3
+let DashGov = require("../");
4
5
+let tests = [
6
+ [
7
+ 2115106 - DashGov.SUPERBLOCK_INTERVAL,
8
+ 2126848 - DashGov.SUPERBLOCK_INTERVAL,
9
+ ],
10
+ [2115106, 2126848],
11
+ [2126847, 2126848],
12
+ [2126848, 2126848 + DashGov.SUPERBLOCK_INTERVAL],
13
+ [2126849, 2126848 + DashGov.SUPERBLOCK_INTERVAL],
14
+];
15
16
+for (let test of tests) {
17
+ let height = test[0];
18
+ let expected = test[1];
19
20
+ let superblock = DashGov.getNextSuperblock(height);
21
+ if (superblock !== expected) {
22
+ throw new Error(
23
+ `expected superblock for height ${height} to be ${expected}, but got ${superblock}`,
24
+ );
25
+ }
26
+}
27
28
+console.info(`PASS: DashGov.getNextSuperblock(height)`);
0 commit comments