|
12 | 12 | from hathor.builder import BuildArtifacts, Builder
|
13 | 13 | from hathor.conf import HathorSettings
|
14 | 14 | from hathor.conf.get_settings import get_settings
|
15 |
| -from hathor.daa import TestMode |
| 15 | +from hathor.daa import DifficultyAdjustmentAlgorithm, TestMode |
16 | 16 | from hathor.p2p.peer_id import PeerId
|
17 | 17 | from hathor.p2p.sync_version import SyncVersion
|
18 | 18 | from hathor.simulator.clock import MemoryReactorHeapClock
|
@@ -182,7 +182,7 @@ def create_peer_from_builder(self, builder, start_manager=True):
|
182 | 182 | def create_peer(self, network, peer_id=None, wallet=None, tx_storage=None, unlock_wallet=True, wallet_index=False,
|
183 | 183 | capabilities=None, full_verification=True, enable_sync_v1=None, enable_sync_v2=None,
|
184 | 184 | checkpoints=None, utxo_index=False, event_manager=None, use_memory_index=None, start_manager=True,
|
185 |
| - pubsub=None, event_storage=None, enable_event_queue=None, use_memory_storage=None, daa=None): |
| 185 | + pubsub=None, event_storage=None, enable_event_queue=None, use_memory_storage=None): |
186 | 186 |
|
187 | 187 | enable_sync_v1, enable_sync_v2 = self._syncVersionFlags(enable_sync_v1, enable_sync_v2)
|
188 | 188 |
|
@@ -245,11 +245,9 @@ def create_peer(self, network, peer_id=None, wallet=None, tx_storage=None, unloc
|
245 | 245 | if utxo_index:
|
246 | 246 | builder.enable_utxo_index()
|
247 | 247 |
|
248 |
| - if daa: |
249 |
| - builder.set_daa(daa) |
250 |
| - |
| 248 | + daa = DifficultyAdjustmentAlgorithm(settings=self._settings, test_mode=TestMode.TEST_ALL_WEIGHT) |
| 249 | + builder.set_daa(daa) |
251 | 250 | manager = self.create_peer_from_builder(builder, start_manager=start_manager)
|
252 |
| - manager.daa.TEST_MODE = TestMode.TEST_ALL_WEIGHT |
253 | 251 |
|
254 | 252 | # XXX: just making sure that tests set this up correctly
|
255 | 253 | if enable_sync_v2:
|
|
0 commit comments