lbry-sdk icon indicating copy to clipboard operation
lbry-sdk copied to clipboard

stream_cost_estimate: does not resolve URIs

Open belikor opened this issue 2 years ago • 0 comments

lbrynet stream cost_estimate 'lbry://@xeroforhire#3/DLive-Stream-Dec-1#b'

Results in failure

{
  "code": -32500,
  "data": {
    "args": [],
    "command": "stream_cost_estimate",
    "kwargs": {
      "uri": "lbry://@xeroforhire#3/DLive-Stream-Dec-1#b"
    },
    "name": "KeyError",
    "traceback": [
      "Traceback (most recent call last):",
      "  File \"/opt/git/lbry-sdk/lbry/extras/daemon/daemon.py\", line 755, in _process_rpc_call",
      "    result = await result",
      "  File \"/opt/git/lbry-sdk/lbry/extras/daemon/daemon.py\", line 833, in get_est_cost_from_uri",
      "    claim_response = resolved[uri]",
      "KeyError: 'lbry://@xeroforhire#3/DLive-Stream-Dec-1#b'",
      ""
    ]
  },
  "message": "'lbry://@xeroforhire#3/DLive-Stream-Dec-1#b'"
}

https://github.com/lbryio/lbry-sdk/blob/442326f1d8fc8d9063c783c6d98e948758f130b5/lbry/extras/daemon/daemon.py#L3801

https://github.com/lbryio/lbry-sdk/blob/442326f1d8fc8d9063c783c6d98e948758f130b5/lbry/extras/daemon/daemon.py#L826

Except for the daemon code, the source does not have a reference to cost-estimate anywhere, so there is currently no test that checks that this command works well.

belikor avatar Dec 08 '21 17:12 belikor