Skip to content

Commit

Permalink
claim_list resolve of blocked claims
Browse files Browse the repository at this point in the history
  • Loading branch information
eukreign committed Oct 3, 2022
1 parent d0aad8c commit 677d905
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion lbry/wallet/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,13 @@ async def _resolve_for_local_claim_results(self, accounts, txos):
results.append(resolved)
else:
if isinstance(resolved, dict) and 'error' in resolved:
txo.meta['error'] = resolved['error']
if resolved['error'].get('name') == 'BLOCKED' and txo.is_claim and txo.claim.is_repost:
txo.meta['blocked_repost'] = await self.get_claim_by_claim_id(
txo.claim.repost.reference.claim_id,
accounts=accounts
)
else:
txo.meta['error'] = resolved['error']
results.append(txo)
return results

Expand Down
8 changes: 7 additions & 1 deletion tests/integration/claims/test_claim_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1643,7 +1643,9 @@ async def test_filtering_channels_for_removing_content(self):

# block channel
self.assertEqual(0, len(self.conductor.spv_node.server.db.blocked_channels))
await self.stream_repost(bad_channel_id, 'block2', '0.1', channel_name='@blocking')
blocked_repost_id = self.get_claim_id(
await self.stream_repost(bad_channel_id, 'block2', '0.1', channel_name='@blocking')
)
self.assertEqual(1, len(self.conductor.spv_node.server.db.blocked_channels))

# channel, claim in channel or claim individually no longer resolve
Expand All @@ -1656,6 +1658,10 @@ async def test_filtering_channels_for_removing_content(self):
self.assertEqual((await self.resolve('lbry://worse_content'))['error']['name'], 'BLOCKED')
self.assertEqual((await self.resolve('lbry://@bad_channel/worse_content'))['error']['name'], 'BLOCKED')

# blocked claim should still show in local claim list
claims = await self.claim_list(claim_id=blocked_repost_id, resolve=True)
self.assertIn('blocked_repost', claims[0]['meta'])

async def test_publish_updates_file_list(self):
tx = await self.stream_create(title='created')
txo = tx['outputs'][0]
Expand Down

0 comments on commit 677d905

Please sign in to comment.