Skip to content

Commit fdc41d0

Browse files
committed
wip
1 parent b51f36e commit fdc41d0

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

tests/unittest.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from hathor.builder import BuildArtifacts, Builder
1313
from hathor.conf import HathorSettings
1414
from hathor.conf.get_settings import get_settings
15-
from hathor.daa import TestMode
15+
from hathor.daa import DifficultyAdjustmentAlgorithm, TestMode
1616
from hathor.p2p.peer_id import PeerId
1717
from hathor.p2p.sync_version import SyncVersion
1818
from hathor.simulator.clock import MemoryReactorHeapClock
@@ -182,7 +182,7 @@ def create_peer_from_builder(self, builder, start_manager=True):
182182
def create_peer(self, network, peer_id=None, wallet=None, tx_storage=None, unlock_wallet=True, wallet_index=False,
183183
capabilities=None, full_verification=True, enable_sync_v1=None, enable_sync_v2=None,
184184
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):
186186

187187
enable_sync_v1, enable_sync_v2 = self._syncVersionFlags(enable_sync_v1, enable_sync_v2)
188188

@@ -245,11 +245,9 @@ def create_peer(self, network, peer_id=None, wallet=None, tx_storage=None, unloc
245245
if utxo_index:
246246
builder.enable_utxo_index()
247247

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)
251250
manager = self.create_peer_from_builder(builder, start_manager=start_manager)
252-
manager.daa.TEST_MODE = TestMode.TEST_ALL_WEIGHT
253251

254252
# XXX: just making sure that tests set this up correctly
255253
if enable_sync_v2:

0 commit comments

Comments
 (0)