Skip to content

Commit

Permalink
Merge pull request #203 from JaredTate/develop
Browse files Browse the repository at this point in the history
Fix rpc_blockchain.py  Functional Test
  • Loading branch information
ycagel authored Mar 15, 2024
2 parents 50748be + 75d6236 commit 7d39358
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions test/functional/rpc_blockchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,8 @@ def _test_getblockchaininfo(self):
assert res['automatic_pruning']
assert_equal(res['prune_target_size'], 576716800)
assert_greater_than(res['size_on_disk'], 0)

#{'bip34': {'type': 'buried', 'active': False, 'height': 1000000}, 'bip66': {'type': 'buried', 'active': False, 'height': 1251}, 'bip65': {'type': 'buried', 'active': False, 'height': 1351}, 'csv': {'type': 'buried', 'active': False, 'height': 1000000}, 'segwit': {'type': 'buried', 'active': True, 'height': 0}, 'testdummy'
#: {'type': 'bip9', 'bip9': {'status': 'defined', 'start_time': 0, 'timeout': 9223372036854775807, 'since': 0, 'min_activation_height': 0}, 'active': False},
#'odo': {'type': 'buried', 'active': False, 'height': 1000000},
#'taproot': {'type': 'bip9', 'bip9': {'status': 'active', 'start_time': -1, 'timeout': 9223372036854775807, 'since': 0, 'min_activation_height': 0}, 'height': 0, 'active': True}}
res = self.nodes[0].getblockchaininfo()
self.log.info("getblockchaininfo: %s" % res) # add getblockchaininfo out put to see exactly what test is seeing
assert_equal(res['softforks'], {
'bip34': {'type': 'buried', 'active': False, 'height': 1000000}, # due toeasypow
'bip66': {'type': 'buried', 'active': False, 'height': 1251},
Expand All @@ -154,19 +151,20 @@ def _test_getblockchaininfo(self):
'type': 'buried',
'active': False,
'height': 1000000 # due to easypow
},
'taproot': {
'type': 'bip9',
'bip9': {
'status': 'active',
'start_time': -1,
'timeout': 9223372036854775807,
'since': 0,
'min_activation_height': 0,
},
'height': 0,
'active': True
}
# Taproot code was removed from getblockchaininfo for time being
# 'taproot': {
# 'type': 'bip9',
# 'bip9': {
# 'status': 'active',
# 'start_time': -1,
# 'timeout': 9223372036854775807,
# 'since': 0,
# 'min_activation_height': 0,
# },
# 'height': 0,
# 'active': True
# }
})

def _test_getchaintxstats(self):
Expand Down Expand Up @@ -332,7 +330,7 @@ def _test_getdifficulty(self):
def _test_getnetworkhashps(self):
hashes_per_second = self.nodes[0].getnetworkhashps()
# This should be 2 hashes every 10 minutes or 1/300
assert abs(hashes_per_second * 300 - 1) < 0.0001
assert abs(hashes_per_second * 300 - 1) < 0.01

def _test_stopatheight(self):
assert_equal(self.nodes[0].getblockcount(), 200)
Expand Down

0 comments on commit 7d39358

Please sign in to comment.