Conditions | 1 |
Total Lines | 12 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import typing |
||
12 | def rpc_method(name: typing.Optional[str] = None, *, |
||
13 | rpc_server: JsonRpcServer = default_rpc_server, |
||
14 | add_extra_args: bool = True) -> typing.Callable: |
||
15 | def _decorator(func: typing.Callable) -> typing.Callable: |
||
16 | rpc_server.add_method(JsonRpcMethod( |
||
17 | func=func, |
||
18 | name=name, |
||
19 | add_extra_args=add_extra_args, |
||
20 | )) |
||
21 | return func |
||
22 | |||
23 | return _decorator |
||
24 |