File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 10
10
- getbestblockhash
11
11
- getblockhash
12
12
- getblockheader
13
+ - getchaintxstats
13
14
- getnetworkhashps
14
15
- verifychain
15
16
@@ -35,12 +36,21 @@ def __init__(self):
35
36
self .num_nodes = 1
36
37
37
38
def run_test (self ):
39
+ self ._test_getchaintxstats ()
38
40
self ._test_gettxoutsetinfo ()
39
41
self ._test_getblockheader ()
40
42
self ._test_getdifficulty ()
41
43
self ._test_getnetworkhashps ()
42
44
self .nodes [0 ].verifychain (4 , 0 )
43
45
46
+ def _test_getchaintxstats (self ):
47
+ chaintxstats = self .nodes [0 ].getchaintxstats (1 )
48
+ # 200 txs plus genesis tx
49
+ assert_equal (chaintxstats ['txcount' ], 201 )
50
+ # tx rate should be 1 per 10 minutes, or 1/600
51
+ # we have to round because of binary math
52
+ assert_equal (round (chaintxstats ['txrate' ] * 600 , 10 ), Decimal (1 ))
53
+
44
54
def _test_gettxoutsetinfo (self ):
45
55
node = self .nodes [0 ]
46
56
res = node .gettxoutsetinfo ()
You can’t perform that action at this time.
0 commit comments