finished switch from using hash # in URLs to colon :

This commit is contained in:
Lex Berezhny 2021-04-21 10:54:07 -04:00
parent 99f56f5d22
commit 888aa5586b
4 changed files with 10 additions and 10 deletions

View file

@ -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,
@ -452,7 +452,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)
@ -665,7 +665,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;

View file

@ -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

View file

@ -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

View file

@ -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'])