functional_tests: fix game update messing up checks

This commit is contained in:
Crypto City 2020-08-02 13:01:13 +00:00
parent fb5dd77afa
commit 3b23655a5f

View File

@ -2950,6 +2950,11 @@ class CCTest():
print('Testing reorg')
res = daemon.get_info()
height = res.height
blocks = (GAME_UPDATE_FREQUENCY * 8000 - height) % GAME_UPDATE_FREQUENCY + 1
self.generate_blocks('TF1MMBg4zx18SnZC6oswCRB7DzdVeUKce5NdCMSWUHNY4wNvNhzmFj4WqZY2bFj8R1REAWR3qAH5zD7sjXyHz3tVayzHSswqymx', blocks)
state0 = self.get_state()
assert len(self.reorg_root_hash) == 64
@ -2994,7 +2999,7 @@ class CCTest():
n_mined = 0
while True:
n_mined += 100
res = second_daemon.generateblocks('TF1MMEY5v2dN49XKNCKCdBqmTMM6GdZZA5UBbDgTewaUd3c2jDazN5yKrG1BBHX3UyPqKD9hrh3DpPTDmWiCmsuRpePT1MTaPxm', 100)
res = second_daemon.generateblocks('TF1MMEY5v2dN49XKNCKCdBqmTMM6GdZZA5UBbDgTewaUd3c2jDazN5yKrG1BBHX3UyPqKD9hrh3DpPTDmWiCmsuRpePT1MTaPxm', 1)
res = second_daemon.get_info()
if res.cumulative_difficulty > cumulative_difficulty:
break
@ -3021,7 +3026,7 @@ class CCTest():
second_daemon.in_peers(0)
# mine on the third daemon, which still has the original chain
res = third_daemon.generateblocks('TF1MMEY5v2dN49XKNCKCdBqmTMM6GdZZA5UBbDgTewaUd3c2jDazN5yKrG1BBHX3UyPqKD9hrh3DpPTDmWiCmsuRpePT1MTaPxm', n_mined + 100)
res = third_daemon.generateblocks('TF1MMEY5v2dN49XKNCKCdBqmTMM6GdZZA5UBbDgTewaUd3c2jDazN5yKrG1BBHX3UyPqKD9hrh3DpPTDmWiCmsuRpePT1MTaPxm', n_mined + 1)
res = third_daemon.get_info()
cumulative_difficulty = res.cumulative_difficulty