Skip to content

Commit 7181b62

Browse files
committed
Refactored jsonrpc_handler to use Command type and updated parameter handling
1 parent 7f76f1b commit 7181b62

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lf_toolkit/io/rpc_handler.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from jsonrpcserver import Success
55
from jsonrpcserver import async_dispatch
66

7+
from ..shared import Command
78
from .handler import Handler
89

910

@@ -23,10 +24,10 @@ async def dispatch(self, req: str) -> str:
2324
)
2425

2526

26-
def jsonrpc_handler(handler: Handler, name: str):
27+
def jsonrpc_handler(handler: Handler, name: Command):
2728
async def wrapped(req: dict):
2829
try:
29-
result = await handler.handle(name, req)
30+
result = await handler.handle(name, {"params": req})
3031
return Success(result)
3132
except Exception as e:
3233
return Error(0, str(e), e)

0 commit comments

Comments
 (0)