From b5dfce7861b1d156eb62220a44c298a90323c302 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Fri, 7 May 2021 11:31:28 -0400 Subject: [PATCH] Revert "finished switch from using hash # in URLs to colon :" This reverts commit 888aa558 --- lbry/wallet/server/db/writer.py | 8 ++++---- lbry/wallet/transaction.py | 2 +- tests/integration/blockchain/test_claim_commands.py | 4 ++-- tests/integration/blockchain/test_resolve_command.py | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lbry/wallet/server/db/writer.py b/lbry/wallet/server/db/writer.py index d4d541416..e1a117635 100644 --- a/lbry/wallet/server/db/writer.py +++ b/lbry/wallet/server/db/writer.py @@ -47,8 +47,8 @@ class SQLDB: expiration_height integer not null, release_time integer not null, - short_url text not null, -- normalized:shortest-unique-claim_id - canonical_url text, -- channel's-short_url/normalized:shortest-unique-claim_id-within-channel + short_url text not null, -- normalized#shortest-unique-claim_id + canonical_url text, -- channel's-short_url/normalized#shortest-unique-claim_id-within-channel title text, author text, @@ -453,7 +453,7 @@ class SQLDB: CASE WHEN :height >= 137181 THEN :height+2102400 ELSE :height+262974 END, :claim_name||COALESCE( (SELECT shortest_id(claim_id, :claim_id) FROM claim WHERE normalized = :normalized), - ':'||substr(:claim_id, 1, 1) + '#'||substr(:claim_id, 1, 1) ) )""", claims) @@ -666,7 +666,7 @@ class SQLDB: WHERE other_claim.signature_valid = 1 AND other_claim.channel_hash = :channel_hash AND other_claim.normalized = claim.normalized), - ':'||substr(claim_id, 1, 1) + '#'||substr(claim_id, 1, 1) ) END WHERE claim_hash=:claim_hash; diff --git a/lbry/wallet/transaction.py b/lbry/wallet/transaction.py index 2ee365c5f..9856d274a 100644 --- a/lbry/wallet/transaction.py +++ b/lbry/wallet/transaction.py @@ -384,7 +384,7 @@ class Output(InputOutput): @property def permanent_url(self) -> str: if self.script.is_claim_involved: - return f"lbry://{self.claim_name}:{self.claim_id}" + return f"lbry://{self.claim_name}#{self.claim_id}" raise ValueError('No claim associated.') @property diff --git a/tests/integration/blockchain/test_claim_commands.py b/tests/integration/blockchain/test_claim_commands.py index c90923be6..8d62777bd 100644 --- a/tests/integration/blockchain/test_claim_commands.py +++ b/tests/integration/blockchain/test_claim_commands.py @@ -160,11 +160,11 @@ class ClaimSearchCommand(ClaimTestCase): # three streams in channel, zero streams in abandoned channel claims = [three, two, signed] await self.assertFindsClaims(claims, channel_ids=[self.channel_id]) - await self.assertFindsClaims(claims, channel=f"@abc:{self.channel_id}") + await self.assertFindsClaims(claims, channel=f"@abc#{self.channel_id}") await self.assertFindsClaims([], channel=f"@inexistent") await self.assertFindsClaims([three, two, signed2, signed], channel_ids=[channel_id2, self.channel_id]) await self.channel_abandon(claim_id=self.channel_id) - await self.assertFindsClaims([], channel=f"@abc:{self.channel_id}", valid_channel_signature=True) + await self.assertFindsClaims([], channel=f"@abc#{self.channel_id}", valid_channel_signature=True) await self.assertFindsClaims([], channel_ids=[self.channel_id], valid_channel_signature=True) await self.assertFindsClaims([signed2], channel_ids=[channel_id2], valid_channel_signature=True) # pass `invalid_channel_signature=False` to catch a bug in argument processing diff --git a/tests/integration/blockchain/test_resolve_command.py b/tests/integration/blockchain/test_resolve_command.py index b3e657546..37b548ff9 100644 --- a/tests/integration/blockchain/test_resolve_command.py +++ b/tests/integration/blockchain/test_resolve_command.py @@ -132,8 +132,8 @@ class ResolveCommand(BaseResolveTestCase): channel_id = self.get_claim_id( await self.channel_create('@abc', '1.1', allow_duplicate_name=True)) await self.assertResolvesToClaimId(f'@abc', channel_id) - await self.assertResolvesToClaimId(f'@abc:{channel_id[:10]}', channel_id) - await self.assertResolvesToClaimId(f'@abc:{channel_id}', channel_id) + await self.assertResolvesToClaimId(f'@abc#{channel_id[:10]}', channel_id) + await self.assertResolvesToClaimId(f'@abc#{channel_id}', channel_id) channel = (await self.claim_search(claim_id=channel_id))[0] await self.assertResolvesToClaimId(channel['short_url'], channel_id) await self.assertResolvesToClaimId(channel['canonical_url'], channel_id) @@ -182,7 +182,7 @@ class ResolveCommand(BaseResolveTestCase): response = await self.resolve('lbry://on-channel-claim') self.assertFalse(response['is_channel_signature_valid']) self.assertEqual({'channel_id': abandoned_channel_id}, response['signing_channel']) - direct_uri = 'lbry://on-channel-claim:' + orphan_claim_id + direct_uri = 'lbry://on-channel-claim#' + orphan_claim_id response = await self.resolve(direct_uri) self.assertFalse(response['is_channel_signature_valid']) self.assertEqual({'channel_id': abandoned_channel_id}, response['signing_channel'])