diff options
author | Fabian Jahr <fjahr@protonmail.com> | 2020-09-06 00:22:19 +0200 |
---|---|---|
committer | Fabian Jahr <fjahr@protonmail.com> | 2022-10-23 01:33:41 +0200 |
commit | 2ca5a496c2f3cbcc63ea15fa05c1658e7f527bbc (patch) | |
tree | dddf50c34e7b573be29b446d6e3e40aeaf7d563c /test/functional/rpc_getblockstats.py | |
parent | cb94db119f4643f49da63520d64efc99fb0c0795 (diff) |
rpc: Improve getblockstats
- Fix getblockstats for block height 0 which previously returned an error.
- Introduce alternative utxo_*_actual statistics which exclude unspendables: Genesis block, BIP30, unspendable outputs
- Update test data
- Explicitly test Genesis block results
Diffstat (limited to 'test/functional/rpc_getblockstats.py')
-rwxr-xr-x | test/functional/rpc_getblockstats.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/rpc_getblockstats.py b/test/functional/rpc_getblockstats.py index 1ea1ee5659..1372cf95da 100755 --- a/test/functional/rpc_getblockstats.py +++ b/test/functional/rpc_getblockstats.py @@ -161,6 +161,14 @@ class GetblockstatsTest(BitcoinTestFramework): assert_raises_rpc_error(-1, 'getblockstats hash_or_height ( stats )', self.nodes[0].getblockstats, '00', 1, 2) assert_raises_rpc_error(-1, 'getblockstats hash_or_height ( stats )', self.nodes[0].getblockstats) + self.log.info('Test block height 0') + genesis_stats = self.nodes[0].getblockstats(0) + assert_equal(genesis_stats["blockhash"], "0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206") + assert_equal(genesis_stats["utxo_increase"], 1) + assert_equal(genesis_stats["utxo_size_inc"], 117) + assert_equal(genesis_stats["utxo_increase_actual"], 0) + assert_equal(genesis_stats["utxo_size_inc_actual"], 0) + if __name__ == '__main__': GetblockstatsTest().main() |