File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change 10
10
- getbestblockhash
11
11
- getblockhash
12
12
- getblockheader
13
+ - getnetworkhashps
13
14
- verifychain
14
15
15
16
Tests correspond to code in rpc/blockchain.cpp.
@@ -45,6 +46,7 @@ def run_test(self):
45
46
self ._test_gettxoutsetinfo ()
46
47
self ._test_getblockheader ()
47
48
self ._test_getdifficulty ()
49
+ self ._test_getnetworkhashps ()
48
50
self .nodes [0 ].verifychain (4 , 0 )
49
51
50
52
def _test_gettxoutsetinfo (self ):
@@ -91,5 +93,10 @@ def _test_getdifficulty(self):
91
93
# binary => decimal => binary math is why we do this check
92
94
assert abs (difficulty * 2 ** 31 - 1 ) < 0.0001
93
95
96
+ def _test_getnetworkhashps (self ):
97
+ hashes_per_second = self .nodes [0 ].getnetworkhashps ()
98
+ # This should be 2 hashes every 10 minutes or 1/300
99
+ assert abs (hashes_per_second * 300 - 1 ) < 0.0001
100
+
94
101
if __name__ == '__main__' :
95
102
BlockchainTest ().main ()
You can’t perform that action at this time.
0 commit comments