This commit is contained in:
Lex Berezhny 2020-09-25 11:11:30 -04:00
parent 0a06810f36
commit 2f4b5d2ffe
3 changed files with 3 additions and 4 deletions

View file

@ -309,7 +309,7 @@ def delete_all_the_things(height: int, p: ProgressContext):
def constrain(col):
if height == -1:
return col == -1
return col <= height
return col >= height
deletes = [
BlockTable.delete().where(constrain(BlockTable.c.height)),

View file

@ -1,7 +1,6 @@
import logging
from typing import List, Dict, Tuple
from lbry.conf import Config
from lbry.blockchain import Ledger, Transaction
from lbry.wallet.sync import SPVSync

View file

@ -14,9 +14,9 @@ import unittest
from unittest.case import _Outcome
from typing import Optional, List, Union
from binascii import unhexlify, hexlify
from distutils.dir_util import remove_tree
import ecdsa
from distutils.dir_util import remove_tree
from lbry.db import Database
from lbry.blockchain import (
@ -430,7 +430,7 @@ class IntegrationTestCase(AsyncioTestCase):
db = Database.temp_sqlite_regtest(chain.ledger.conf)
elif db_driver.startswith('postgres') or db_driver.startswith('psycopg'):
db_driver = 'postgresql'
db_name = f'lbry_test_chain'
db_name = 'lbry_test_chain'
db_connection = 'postgres:postgres@localhost:5432'
meta_db = Database.from_url(f'postgresql://{db_connection}/postgres')
await meta_db.drop(db_name)