make permanent url name#id only for now

This commit is contained in:
Victor Shyba 2019-04-03 19:44:31 -03:00 committed by Lex Berezhny
parent 65f3d78084
commit b87316fb02
2 changed files with 5 additions and 9 deletions

View file

@ -169,8 +169,7 @@ class Resolver:
]
claim_result['height'] = claim_result.get('height', -1) or -1
claim_result['permanent_url'] = _get_permanent_url(
claim_result, channel_id)
claim_result['permanent_url'] = f"lbry://{claim_result['name']}#{claim_result['claim_id']}"
return claim_result
@ -261,13 +260,6 @@ class Resolver:
return page_generator, upper_bound
def _get_permanent_url(claim_result, certificate_id):
if certificate_id:
return f"{claim_result['channel_name']}#{certificate_id}/{claim_result['name']}"
else:
return f"{claim_result['name']}#{claim_result['claim_id']}"
def _verify_proof(name, claim_trie_root, result, height, depth, ledger):
"""
Verify proof for name claim

View file

@ -48,6 +48,10 @@ class ResolveCommand(CommandTestCase):
self.assertEqual(claim['certificate']['name'], '@abc')
self.assertEqual(claim['claims_in_channel'], 0)
# resolving from the given permanent url
new_response = await self.resolve(claim['claim']['permanent_url'])
self.assertEqual(new_response[claim['claim']['permanent_url']], claim)
# resolving multiple at once
response = await self.resolve(['lbry://foo', 'lbry://foo2'])
self.assertSetEqual({'lbry://foo', 'lbry://foo2'}, set(response))