aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcoFalke <[email protected]>2017-06-05 16:25:12 +0200
committerMarcoFalke <[email protected]>2017-06-05 16:25:18 +0200
commitc871f323b418fac27bf834843ca26985010df53f (patch)
tree648801c7a5a7c75f68aa177b85f44a82bc8ffd58
parentMerge #10422: Fix timestamp in fee estimate debug message (diff)
parent[test] Add test for getchaintxstats (diff)
downloaddiscoin-c871f323b418fac27bf834843ca26985010df53f.tar.xz
discoin-c871f323b418fac27bf834843ca26985010df53f.zip
Merge #10515: [test] Add test for getchaintxstats
cc36b5e [test] Add test for getchaintxstats (Jimmy Song) Tree-SHA512: a992b55f945118ad7410ab8d7ae7d2696e94a2d4a861d633f4501c439364027e2fddd522cb8b5ed3eb621ec4ed0e9fc683e0139aa6c2e2e27c361640f85f1876
-rwxr-xr-xtest/functional/blockchain.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/blockchain.py b/test/functional/blockchain.py
index 4bfd3ee67..5ada3e629 100755
--- a/test/functional/blockchain.py
+++ b/test/functional/blockchain.py
@@ -10,6 +10,7 @@ Test the following RPCs:
- getbestblockhash
- getblockhash
- getblockheader
+ - getchaintxstats
- getnetworkhashps
- verifychain
@@ -35,12 +36,21 @@ class BlockchainTest(BitcoinTestFramework):
self.num_nodes = 1
def run_test(self):
+ self._test_getchaintxstats()
self._test_gettxoutsetinfo()
self._test_getblockheader()
self._test_getdifficulty()
self._test_getnetworkhashps()
self.nodes[0].verifychain(4, 0)
+ def _test_getchaintxstats(self):
+ chaintxstats = self.nodes[0].getchaintxstats(1)
+ # 200 txs plus genesis tx
+ assert_equal(chaintxstats['txcount'], 201)
+ # tx rate should be 1 per 10 minutes, or 1/600
+ # we have to round because of binary math
+ assert_equal(round(chaintxstats['txrate'] * 600, 10), Decimal(1))
+
def _test_gettxoutsetinfo(self):
node = self.nodes[0]
res = node.gettxoutsetinfo()