From a411bda6208ab9cf2668f33ec983f8904d030c1c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Fri, 8 Jan 2021 17:29:14 -0300 Subject: [PATCH] release time is 64 bits on protobuf, update postgres schema --- lbry/db/tables.py | 2 +- tests/integration/blockchain/test_blockchain.py | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/lbry/db/tables.py b/lbry/db/tables.py index 4b4e1d76a..a2044bf72 100644 --- a/lbry/db/tables.py +++ b/lbry/db/tables.py @@ -203,7 +203,7 @@ Claim = Table( Column('staked_amount', BigInteger), Column('timestamp', Integer), # last updated timestamp Column('creation_timestamp', Integer), - Column('release_time', Integer, nullable=True), + Column('release_time', BigInteger, nullable=True), Column('height', Integer), # last updated height Column('creation_height', Integer), Column('activation_height', Integer), diff --git a/tests/integration/blockchain/test_blockchain.py b/tests/integration/blockchain/test_blockchain.py index 26c918ca2..217433cca 100644 --- a/tests/integration/blockchain/test_blockchain.py +++ b/tests/integration/blockchain/test_blockchain.py @@ -114,14 +114,14 @@ class SyncingBlockchainTestCase(BasicBlockchainTestCase): async def create_claim( self, title='', amount='0.01', name=None, author='', desc='', - claim_id_startswith='', sign=None, is_channel=False, repost=None) -> str: + claim_id_startswith='', sign=None, is_channel=False, repost=None, **claim_kwargs) -> str: name = name or ('@foo' if is_channel else 'foo') if not claim_id_startswith and sign is None and not is_channel: if repost: claim = Claim() claim.repost.reference.claim_id = repost else: - claim = Stream().update(title=title, author=author, description=desc).claim + claim = Stream().update(title=title, author=author, description=desc, **claim_kwargs).claim return await self.chain.claim_name( name, hexlify(claim.to_bytes()).decode(), amount ) @@ -989,6 +989,13 @@ class TestGeneralBlockchainSync(SyncingBlockchainTestCase): claim = resolutions[0][0] self.assertTrue(claim.is_signed_by(claim.channel, self.chain.ledger)) + async def test_bad_fields_on_sync(self): + claim = await self.get_claim(await self.create_claim(release_time=1<<62, name="future")) + await self.generate(1) + results = await self.db.search_claims(name='future') + self.assertEqual(1, len(results)) + self.assertEqual(claim.claim_id, results[0].claim_id) + async def test_resolve_not_found(self): await self.get_claim(await self.create_claim(claim_id_startswith='ab', is_channel=True)) await self.generate(1)