diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index 8d695220f..bd37b686a 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -4503,15 +4503,14 @@ class Daemon(metaclass=JSONRPCServerType): return result @requires(WALLET_COMPONENT) - async def jsonrpc_comment_create(self, claim_id, comment, parent_id=None, channel_account_id=None, + async def jsonrpc_comment_create(self, comment, claim_id=None, parent_id=None, channel_account_id=None, channel_name=None, channel_id=None, wallet_id=None): """ Create and associate a comment with a claim using your channel identity. Usage: comment_create ( | --comment=) - ( | --claim_id=) - [--parent_id=] + ( | --claim_id= | --parent_id=) [--channel_id=] [--channel_name=] [--channel_account_id=...] [--wallet_id=] diff --git a/scripts/generate_json_api.py b/scripts/generate_json_api.py index 85ba56017..f8c21e3f7 100644 --- a/scripts/generate_json_api.py +++ b/scripts/generate_json_api.py @@ -336,8 +336,7 @@ class Examples(CommandTestCase): 'You can r', 'comment', 'create', '--comment="I have photographic evidence confirming Sasquatch exists"', - f'--channel_name=@channel', f'--claim_id={stream_id}', - f'--parent_id={comment["comment_id"]}' + f'--channel_name=@channel', f'--parent_id={comment["comment_id"]}' ) await r( diff --git a/tests/integration/other/test_comment_commands.py b/tests/integration/other/test_comment_commands.py index 4fba6789c..2189bc8a4 100644 --- a/tests/integration/other/test_comment_commands.py +++ b/tests/integration/other/test_comment_commands.py @@ -47,15 +47,21 @@ class MockedCommentServer: schema.update(**kwargs) return schema - def create_comment(self, channel_name=None, channel_id=None, **kwargs): + def create_comment(self, claim_id=None, parent_id=None, channel_name=None, channel_id=None, **kwargs): comment_id = self.comment_id channel_url = 'lbry://' + channel_name + '#' + channel_id if channel_id else None + + if parent_id: + claim_id = self.comments[self.get_comment_id(parent_id)]['claim_id'] + comment = self._create_comment( comment_id=str(comment_id), channel_name=channel_name, channel_id=channel_id, channel_url=channel_url, timestamp=str(int(time.time())), + claim_id=claim_id, + parent_id=parent_id, **kwargs ) self.comments.append(comment)