Browse Source

Pylightning: update to use the 'dev' multiplex command

Update 'dev_crash()' and 'dev_rhash()' methods which used outdated RPC commands, add the missing 'dev_slowcmd()' method.
pull/2938/head
darosior 6 years ago
committed by Rusty Russell
parent
commit
ed63496152
  1. 18
      contrib/pylightning/lightning/lightning.py

18
contrib/pylightning/lightning/lightning.py

@ -366,7 +366,10 @@ class LightningRpc(UnixDomainSocketRpc):
"""
Crash lightningd by calling fatal()
"""
return self.call("dev-crash")
payload = {
"subcommand": "crash"
}
return self.call("dev", payload)
def dev_fail(self, peer_id):
"""
@ -427,9 +430,10 @@ class LightningRpc(UnixDomainSocketRpc):
Show SHA256 of {secret}
"""
payload = {
"subcommand": "rhash",
"secret": secret
}
return self.call("dev-rhash", payload)
return self.call("dev", payload)
def dev_sign_last_tx(self, peer_id):
"""
@ -440,6 +444,16 @@ class LightningRpc(UnixDomainSocketRpc):
}
return self.call("dev-sign-last-tx", payload)
def dev_slowcmd(self, msec=None):
"""
Torture test for slow commands, optional {msec}
"""
payload = {
"subcommand": "slowcmd",
"msec": msec
}
return self.call("dev", payload)
def disconnect(self, peer_id, force=False):
"""
Disconnect from peer with {peer_id}, optional {force} even if has active channel

Loading…
Cancel
Save