Skip to content

Commit 1781fad

Browse files
rustyrussellniftynei
authored andcommitted
contrib/pyln-client: allow lightningd to give us non-numeric ids.
Signed-off-by: Rusty Russell <[email protected]>
1 parent 8055a22 commit 1781fad

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

contrib/pyln-client/pyln/client/plugin.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def __init__(self, message: str, code: int = -32600):
7272
class Request(dict):
7373
"""A request object that wraps params and allows async return
7474
"""
75-
def __init__(self, plugin: 'Plugin', req_id: Optional[int], method: str,
75+
def __init__(self, plugin: 'Plugin', req_id: Optional[str], method: str,
7676
params: Any, background: bool = False):
7777
self.method = method
7878
self.params = params
@@ -700,13 +700,9 @@ def notify_progress(self, request: Request,
700700
request.progress(progress, progress_total, stage, stage_total)
701701

702702
def _parse_request(self, jsrequest: Dict[str, JSONType]) -> Request:
703-
i = jsrequest.get('id', None)
704-
if not isinstance(i, int) and i is not None:
705-
raise ValueError('Non-integer request id "{i}"'.format(i=i))
706-
707703
request = Request(
708704
plugin=self,
709-
req_id=i,
705+
req_id=jsrequest.get('id', None),
710706
method=str(jsrequest['method']),
711707
params=jsrequest['params'],
712708
background=False,

0 commit comments

Comments
 (0)