@@ -75,7 +75,7 @@ async def test_block_store(tmp_dir: Path, db_version: int, bt: BlockTools, use_c
75
75
coin_store_2 = await CoinStore .create (db_wrapper_2 )
76
76
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
77
77
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
78
- consensus_store = await ConsensusStoreSQLite3 . create (store_2 , coin_store_2 , height_map )
78
+ consensus_store = ConsensusStoreSQLite3 (store_2 , coin_store_2 , height_map )
79
79
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
80
80
81
81
store = await BlockStore .create (db_wrapper , use_cache = use_cache )
@@ -149,10 +149,8 @@ async def test_get_full_blocks_at(
149
149
150
150
async with DBConnection (2 ) as db_wrapper :
151
151
# Use a different file for the blockchain
152
- coin_store = await CoinStore .create (db_wrapper )
153
- block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
154
- height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
155
- consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
152
+ consensus_store = await ConsensusStoreSQLite3 .create (db_wrapper , tmp_dir , use_cache = use_cache )
153
+ block_store = consensus_store .block_store
156
154
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
157
155
158
156
count = 0
@@ -178,10 +176,8 @@ async def test_get_block_records_in_range(
178
176
179
177
async with DBConnection (2 ) as db_wrapper :
180
178
# Use a different file for the blockchain
181
- coin_store = await CoinStore .create (db_wrapper )
182
- block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
183
- height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
184
- consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
179
+ consensus_store = await ConsensusStoreSQLite3 .create (db_wrapper , tmp_dir , use_cache = use_cache )
180
+ block_store = consensus_store .block_store
185
181
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
186
182
187
183
count = 0
@@ -209,10 +205,8 @@ async def test_get_block_bytes_in_range_in_main_chain(
209
205
210
206
async with DBConnection (2 ) as db_wrapper :
211
207
# Use a different file for the blockchain
212
- coin_store = await CoinStore .create (db_wrapper )
213
- block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
214
- height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
215
- consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
208
+ consensus_store = await ConsensusStoreSQLite3 .create (db_wrapper , tmp_dir , use_cache = use_cache )
209
+ block_store = consensus_store .block_store
216
210
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
217
211
count = 0
218
212
fork_info = ForkInfo (- 1 , - 1 , bt .constants .GENESIS_CHALLENGE )
@@ -242,7 +236,7 @@ async def test_deadlock(tmp_dir: Path, db_version: int, bt: BlockTools, use_cach
242
236
coin_store_2 = await CoinStore .create (wrapper_2 )
243
237
store_2 = await BlockStore .create (wrapper_2 )
244
238
height_map = await BlockHeightMap .create (tmp_dir , wrapper_2 )
245
- consensus_store = await ConsensusStoreSQLite3 . create (store_2 , coin_store_2 , height_map )
239
+ consensus_store = ConsensusStoreSQLite3 (store_2 , coin_store_2 , height_map )
246
240
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
247
241
block_records = []
248
242
for block in blocks :
@@ -271,10 +265,8 @@ async def test_rollback(bt: BlockTools, tmp_dir: Path, use_cache: bool, default_
271
265
272
266
async with DBConnection (2 ) as db_wrapper :
273
267
# Use a different file for the blockchain
274
- coin_store = await CoinStore .create (db_wrapper )
275
- block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
276
- height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
277
- consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
268
+ consensus_store = await ConsensusStoreSQLite3 .create (db_wrapper , tmp_dir , use_cache = use_cache )
269
+ block_store = consensus_store .block_store
278
270
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
279
271
280
272
# insert all blocks
@@ -338,7 +330,7 @@ async def test_count_compactified_blocks(bt: BlockTools, tmp_dir: Path, db_versi
338
330
coin_store = await CoinStore .create (db_wrapper )
339
331
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
340
332
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
341
- consensus_store = await ConsensusStoreSQLite3 . create (block_store , coin_store , height_map )
333
+ consensus_store = ConsensusStoreSQLite3 (block_store , coin_store , height_map )
342
334
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
343
335
344
336
count = await block_store .count_compactified_blocks ()
@@ -360,7 +352,7 @@ async def test_count_uncompactified_blocks(bt: BlockTools, tmp_dir: Path, db_ver
360
352
coin_store = await CoinStore .create (db_wrapper )
361
353
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
362
354
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
363
- consensus_store = await ConsensusStoreSQLite3 . create (block_store , coin_store , height_map )
355
+ consensus_store = ConsensusStoreSQLite3 (block_store , coin_store , height_map )
364
356
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
365
357
366
358
count = await block_store .count_uncompactified_blocks ()
@@ -389,7 +381,7 @@ def rand_vdf_proof() -> VDFProof:
389
381
coin_store = await CoinStore .create (db_wrapper )
390
382
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
391
383
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
392
- consensus_store = await ConsensusStoreSQLite3 . create (block_store , coin_store , height_map )
384
+ consensus_store = ConsensusStoreSQLite3 (block_store , coin_store , height_map )
393
385
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
394
386
for block in blocks :
395
387
await _validate_and_add_block (bc , block )
@@ -471,7 +463,7 @@ async def test_get_blocks_by_hash(tmp_dir: Path, bt: BlockTools, db_version: int
471
463
coin_store_2 = await CoinStore .create (db_wrapper_2 )
472
464
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
473
465
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
474
- consensus_store = await ConsensusStoreSQLite3 . create (store_2 , coin_store_2 , height_map )
466
+ consensus_store = ConsensusStoreSQLite3 (store_2 , coin_store_2 , height_map )
475
467
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
476
468
477
469
store = await BlockStore .create (db_wrapper , use_cache = use_cache )
@@ -512,7 +504,7 @@ async def test_get_block_bytes_in_range(tmp_dir: Path, bt: BlockTools, db_versio
512
504
coin_store_2 = await CoinStore .create (db_wrapper_2 )
513
505
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
514
506
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
515
- consensus_store = await ConsensusStoreSQLite3 . create (store_2 , coin_store_2 , height_map )
507
+ consensus_store = ConsensusStoreSQLite3 (store_2 , coin_store_2 , height_map )
516
508
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
517
509
518
510
await BlockStore .create (db_wrapper_2 )
@@ -586,7 +578,7 @@ async def test_get_prev_hash(tmp_dir: Path, bt: BlockTools, db_version: int, use
586
578
coin_store_2 = await CoinStore .create (db_wrapper_2 )
587
579
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
588
580
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
589
- consensus_store = await ConsensusStoreSQLite3 . create (store_2 , coin_store_2 , height_map )
581
+ consensus_store = ConsensusStoreSQLite3 (store_2 , coin_store_2 , height_map )
590
582
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
591
583
592
584
store = await BlockStore .create (db_wrapper , use_cache = use_cache )
0 commit comments