Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ idea:
cp -r scripts/idea/* .idea

elastic-docker:
docker run -d -v lbryhub:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e"ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
docker run -d --env network.publish_host=127.0.0.1 -v lbryhub:/usr/share/elasticsearch/data -p 9200:9200 -p 9300:9300 -e"ES_JAVA_OPTS=-Xms512m -Xmx512m" -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.12.1
5 changes: 5 additions & 0 deletions lbry/error/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
from .base import BaseError, claim_id

class StreamExtensionTypeUnresolved(BaseError):
def __init__(self, url_prefix, name):
self.url_prefix = url_prefix
self.name = name
super().__init__(f"Stream extension type '{url_prefix}/{name}' could not be resolved.")

class UserInputError(BaseError):
"""
Expand Down
15 changes: 13 additions & 2 deletions lbry/extras/daemon/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -3352,8 +3352,13 @@ async def jsonrpc_stream_repost(
# TODO: use error from lbry.error
raise Exception('Invalid claim id. It is expected to be a 40 characters long hexadecimal string.')

reposted_txo = await self.ledger.get_claim_by_claim_id(claim_id, include_is_my_output=True)
if not isinstance(reposted_txo, Output) or not reposted_txo.is_claim:
raise InputValueError(f"Could not find claim '{claim_id}'.")
if not reposted_txo.can_decode_claim:
raise InputValueError(f"A claim with id '{claim_id}' was found but could not be decoded.")
claim = Claim()
claim.repost.update(**kwargs)
claim.repost.update(claim_type=reposted_txo.claim.claim_type, **kwargs)
claim.repost.reference.claim_id = claim_id
tx = await Transaction.claim_create(
name, claim, amount, claim_address, funding_accounts, funding_accounts[0], channel
Expand Down Expand Up @@ -3735,7 +3740,13 @@ async def jsonrpc_stream_update(
if old_txo.claim.is_stream:
claim.stream.update(file_path=file_path, **kwargs)
elif old_txo.claim.is_repost:
claim.repost.update(**kwargs)
reposted_id = old_txo.claim.repost.reference.claim_id
reposted_txo = await self.ledger.get_claim_by_claim_id(reposted_id, include_is_my_output=True)
if not isinstance(reposted_txo, Output) or not reposted_txo.is_claim:
raise InputValueError(f"Could not find reposted claim '{reposted_id}'.")
if not reposted_txo.can_decode_claim:
raise InputValueError(f"A claim with id '{reposted_id}' was found but could not be decoded.")
claim.repost.update(claim_type=reposted_txo.claim.claim_type, **kwargs)

if clear_channel:
claim.clear_signature()
Expand Down
4 changes: 2 additions & 2 deletions lbry/schema/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
build:
rm types/v2/* -rf
rm -rf types/v2/*
touch types/v2/__init__.py
cd types/v2/ && protoc --python_out=. -I ../../../../../types/v2/proto/ ../../../../../types/v2/proto/*.proto
cd types/v2/ && cp ../../../../../types/jsonschema/* ./
sed -e 's/^import\ \(.*\)_pb2\ /from . import\ \1_pb2\ /g' -i types/v2/*.py
sed -e 's/^import\ \(.*\)_pb2\ /from . import\ \1_pb2\ /g' -i.bak types/v2/*.py
Loading