diff --git a/docs/api.json b/docs/api.json index 70fcc13b6..f23dab4d9 100644 --- a/docs/api.json +++ b/docs/api.json @@ -2302,8 +2302,8 @@ ] }, { - "name": "comment_edit", - "description": "Edit a comment published as one of your channels.", + "name": "comment_update", + "description": "Update a comment published as one of your channels.", "arguments": [ { "name": "comment", @@ -2328,9 +2328,9 @@ "examples": [ { "title": "Edit the contents of a comment", - "curl": "curl -d'{\"method\": \"comment_edit\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb\"}}' http://localhost:5279/", - "lbrynet": "lbrynet comment edit Where there was once sasquatch, there is not --comment_id=0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb", - "python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_edit\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb\"}}).json()", + "curl": "curl -d'{\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb\"}}' http://localhost:5279/", + "lbrynet": "lbrynet comment \"update Where there was once sasquatch, there is not\" --comment_id=0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb", + "python": "requests.post(\"http://localhost:5279\", json={\"method\": \"comment_update\", \"params\": {\"comment\": \"Where there was once sasquatch, there is not\", \"comment_id\": \"0dec63ef27fd7d8c76237811b00db797479061caba39ac0f4f3b094aae59a5cb\"}}).json()", "output": "{\n \"jsonrpc\": \"2.0\",\n \"result\": {\n \"error\": {\n \"code\": -32601,\n \"message\": \"The method does not exist / is not available.\"\n },\n \"id\": null,\n \"jsonrpc\": \"2.0\"\n }\n}" } ] diff --git a/lbry/extras/daemon/daemon.py b/lbry/extras/daemon/daemon.py index a67c80785..395dab156 100644 --- a/lbry/extras/daemon/daemon.py +++ b/lbry/extras/daemon/daemon.py @@ -4559,12 +4559,12 @@ class Daemon(metaclass=JSONRPCServerType): return response @requires(WALLET_COMPONENT) - async def jsonrpc_comment_edit(self, comment, comment_id, wallet_id=None): + async def jsonrpc_comment_update(self, comment, comment_id, wallet_id=None): """ Edit a comment published as one of your channels. Usage: - comment_edit ( | --comment=) + comment_update ( | --comment=) ( | --comment_id=) [--wallet_id=] diff --git a/scripts/generate_json_api.py b/scripts/generate_json_api.py index f8c21e3f7..c606681a4 100644 --- a/scripts/generate_json_api.py +++ b/scripts/generate_json_api.py @@ -352,7 +352,7 @@ class Examples(CommandTestCase): await r( 'Edit the contents of a comment', - 'comment', 'edit', 'Where there was once sasquatch, there is not', + 'comment', 'update', 'Where there was once sasquatch, there is not', f'--comment_id={comment["comment_id"]}' ) diff --git a/tests/integration/other/test_comment_commands.py b/tests/integration/other/test_comment_commands.py index 2189bc8a4..f48c1ad8b 100644 --- a/tests/integration/other/test_comment_commands.py +++ b/tests/integration/other/test_comment_commands.py @@ -507,7 +507,7 @@ class CommentCommands(CommandTestCase): self.assertIsNotNone(original_cid, 'comment wasnt properly made') self.assertIsNotNone(original_sig, 'comment should have a signature') - edited = await self.daemon.jsonrpc_comment_edit( + edited = await self.daemon.jsonrpc_comment_update( comment='This is a masterpiece, need more like it!', comment_id=original_cid ) @@ -533,7 +533,7 @@ class CommentCommands(CommandTestCase): # this should error out with self.assertRaises(ValueError): - await self.daemon.jsonrpc_comment_edit( + await self.daemon.jsonrpc_comment_update( comment='If you see it and you mean then you know you have to go', comment_id=original_cid ) @@ -548,7 +548,7 @@ class CommentCommands(CommandTestCase): self.assertIsNotNone(anon_cid) with self.assertRaises(ValueError): - await self.daemon.jsonrpc_comment_edit( + await self.daemon.jsonrpc_comment_update( comment='drift drift drift', comment_id=anon_cid )