Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Non-stopped simulator causing other tests to fail #578

Merged
merged 1 commit into from
Apr 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hathor/simulator/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def _apply_patches(cls):

def verify_pow(self: BaseTransaction, *args: Any, **kwargs: Any) -> None:
assert self.hash is not None
logger.new().debug('Skipping BaseTransaction.verify_pow() for simulator')

cls._original_verify_pow = BaseTransaction.verify_pow
BaseTransaction.verify_pow = verify_pow
Expand Down
4 changes: 4 additions & 0 deletions tests/simulation/test_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ def setUp(self):
print('Simulation seed config:', self.simulator.seed)
print('-' * 30)

def tearDown(self):
super().tearDown()
self.simulator.stop()

def test_stop_after_n_mined_blocks(self):
miner1 = self.simulator.create_miner(self.manager1, hashpower=1e6)
miner1.start()
Expand Down