mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-18 12:34:21 +01:00
plugin: Unwrap the rpc_command payload
We were nesting like the following:
```json
{"params": {
"rpc_command": {
"rpc_command": {
}
}
}
```
This is really excessive, so we unwrap once, and now have the following:
```json
{"params": {
"rpc_command": {
}
}
```
Still more wrapping than necessary (the method is repeated in the `params`
object), but it's getting closer.
Changelog-Deprecated: JSON-RPC: Removed double wrapping of `rpc_command` payload in `rpc_command` JSON field.
Suggested-by: @fiatjaf
Signed-off-by: Christian Decker <@cdecker>
This commit is contained in:
committed by
Rusty Russell
parent
15ca3b615f
commit
d2688bbaf5
@@ -9,7 +9,7 @@ plugin = Plugin()
|
||||
|
||||
@plugin.hook("rpc_command")
|
||||
def on_rpc_command(plugin, rpc_command, **kwargs):
|
||||
request = rpc_command["rpc_command"]
|
||||
request = rpc_command
|
||||
if request["method"] == "invoice":
|
||||
# Replace part of this command
|
||||
request["params"]["description"] = "A plugin modified this description"
|
||||
|
||||
Reference in New Issue
Block a user