From 1a06347c08d31a44fd8dc3b1171a55ab79148ff4 Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Mon, 31 Jan 2022 14:18:57 +0530 Subject: [PATCH] Update test_rebuild latestCache --- test_rebuild.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test_rebuild.py b/test_rebuild.py index d2658a1..a1761a3 100644 --- a/test_rebuild.py +++ b/test_rebuild.py @@ -174,6 +174,7 @@ else: ltransactions = latestCache_session.query(LatestTransactions).all() latestCache_session.close() + lblocks_dict = {} for block in lblocks: block_dict = block.__dict__ @@ -190,7 +191,7 @@ for transaction in ltransactions: # copy the old block data old_latest_cache = create_database_connection('system_dbs', {'db_name':'latestCache1'}) old_latest_cache.execute("ATTACH DATABASE 'latestCache.db' AS new_db") -old_latest_cache.execute("INSERT INTO new_db.latestBlocks SELECT * FROM latestBlocks") +old_latest_cache.execute("INSERT INTO new_db.latestBlocks SELECT * FROM latestBlocks WHERE blockNumber <= ?", (forward_block,)) old_latest_cache.close() # delete