20
20
from chia .consensus .block_body_validation import ForkInfo
21
21
from chia .consensus .block_height_map import BlockHeightMap
22
22
from chia .consensus .blockchain import AddBlockResult , Blockchain
23
- from chia .consensus .consensus_store import ConsensusStore
24
23
from chia .consensus .default_constants import DEFAULT_CONSTANTS
25
24
from chia .consensus .full_block_to_block_record import header_block_to_sub_block_record
26
25
from chia .full_node .block_store import BlockStore
27
26
from chia .full_node .coin_store import CoinStore
27
+ from chia .full_node .consensus_store_sqlite3 import ConsensusStoreSQLite3
28
28
from chia .full_node .full_block_utils import GeneratorBlockInfo
29
29
from chia .simulator .block_tools import BlockTools
30
30
from chia .simulator .wallet_tools import WalletTool
@@ -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 ConsensusStore .create (store_2 , coin_store_2 , height_map )
78
+ consensus_store = await ConsensusStoreSQLite3 .create (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 )
@@ -152,7 +152,7 @@ async def test_get_full_blocks_at(
152
152
coin_store = await CoinStore .create (db_wrapper )
153
153
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
154
154
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
155
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
155
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
156
156
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
157
157
158
158
count = 0
@@ -181,7 +181,7 @@ async def test_get_block_records_in_range(
181
181
coin_store = await CoinStore .create (db_wrapper )
182
182
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
183
183
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
184
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
184
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
185
185
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
186
186
187
187
count = 0
@@ -212,7 +212,7 @@ async def test_get_block_bytes_in_range_in_main_chain(
212
212
coin_store = await CoinStore .create (db_wrapper )
213
213
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
214
214
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
215
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
215
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
216
216
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
217
217
count = 0
218
218
fork_info = ForkInfo (- 1 , - 1 , bt .constants .GENESIS_CHALLENGE )
@@ -242,7 +242,7 @@ async def test_deadlock(tmp_dir: Path, db_version: int, bt: BlockTools, use_cach
242
242
coin_store_2 = await CoinStore .create (wrapper_2 )
243
243
store_2 = await BlockStore .create (wrapper_2 )
244
244
height_map = await BlockHeightMap .create (tmp_dir , wrapper_2 )
245
- consensus_store = await ConsensusStore .create (store_2 , coin_store_2 , height_map )
245
+ consensus_store = await ConsensusStoreSQLite3 .create (store_2 , coin_store_2 , height_map )
246
246
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
247
247
block_records = []
248
248
for block in blocks :
@@ -274,7 +274,7 @@ async def test_rollback(bt: BlockTools, tmp_dir: Path, use_cache: bool, default_
274
274
coin_store = await CoinStore .create (db_wrapper )
275
275
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
276
276
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
277
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
277
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
278
278
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
279
279
280
280
# insert all blocks
@@ -338,7 +338,7 @@ async def test_count_compactified_blocks(bt: BlockTools, tmp_dir: Path, db_versi
338
338
coin_store = await CoinStore .create (db_wrapper )
339
339
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
340
340
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
341
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
341
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
342
342
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
343
343
344
344
count = await block_store .count_compactified_blocks ()
@@ -360,7 +360,7 @@ async def test_count_uncompactified_blocks(bt: BlockTools, tmp_dir: Path, db_ver
360
360
coin_store = await CoinStore .create (db_wrapper )
361
361
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
362
362
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
363
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
363
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
364
364
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
365
365
366
366
count = await block_store .count_uncompactified_blocks ()
@@ -389,7 +389,7 @@ def rand_vdf_proof() -> VDFProof:
389
389
coin_store = await CoinStore .create (db_wrapper )
390
390
block_store = await BlockStore .create (db_wrapper , use_cache = use_cache )
391
391
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper )
392
- consensus_store = await ConsensusStore .create (block_store , coin_store , height_map )
392
+ consensus_store = await ConsensusStoreSQLite3 .create (block_store , coin_store , height_map )
393
393
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
394
394
for block in blocks :
395
395
await _validate_and_add_block (bc , block )
@@ -471,7 +471,7 @@ async def test_get_blocks_by_hash(tmp_dir: Path, bt: BlockTools, db_version: int
471
471
coin_store_2 = await CoinStore .create (db_wrapper_2 )
472
472
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
473
473
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
474
- consensus_store = await ConsensusStore .create (store_2 , coin_store_2 , height_map )
474
+ consensus_store = await ConsensusStoreSQLite3 .create (store_2 , coin_store_2 , height_map )
475
475
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
476
476
477
477
store = await BlockStore .create (db_wrapper , use_cache = use_cache )
@@ -586,7 +586,7 @@ async def test_get_prev_hash(tmp_dir: Path, bt: BlockTools, db_version: int, use
586
586
coin_store_2 = await CoinStore .create (db_wrapper_2 )
587
587
store_2 = await BlockStore .create (db_wrapper_2 , use_cache = use_cache )
588
588
height_map = await BlockHeightMap .create (tmp_dir , db_wrapper_2 )
589
- consensus_store = await ConsensusStore .create (store_2 , coin_store_2 , height_map )
589
+ consensus_store = await ConsensusStoreSQLite3 .create (store_2 , coin_store_2 , height_map )
590
590
bc = await Blockchain .create (consensus_store , bt .constants , 2 )
591
591
592
592
store = await BlockStore .create (db_wrapper , use_cache = use_cache )
0 commit comments