mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-20 15:44:21 +01:00
pytest: test Bitcoin plugin registration and the bcli plugin
This commit is contained in:
37
tests/plugins/bitcoin/part1.py
Executable file
37
tests/plugins/bitcoin/part1.py
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
This registers part of the Bitcoin backend methods.
|
||||
We only use it for testing startup and we don't care about the actual values.
|
||||
"""
|
||||
import time
|
||||
|
||||
from pyln.client import Plugin
|
||||
|
||||
|
||||
plugin = Plugin()
|
||||
|
||||
|
||||
@plugin.method("getfeerate")
|
||||
def getfeerate(plugin, **kwargs):
|
||||
time.sleep(1)
|
||||
return {}
|
||||
|
||||
|
||||
@plugin.method("getrawblockbyheight")
|
||||
def getblock(plugin, **kwargs):
|
||||
time.sleep(1)
|
||||
return {}
|
||||
|
||||
|
||||
@plugin.method("getchaininfo")
|
||||
def getchaininfo(plugin, **kwargs):
|
||||
time.sleep(1)
|
||||
return {}
|
||||
|
||||
|
||||
# We don't use these options, but it allows us to get to the expected failure.
|
||||
plugin.add_option("bitcoin-rpcuser", "", "")
|
||||
plugin.add_option("bitcoin-rpcpassword", "", "")
|
||||
plugin.add_option("bitcoin-rpcport", "", "")
|
||||
|
||||
plugin.run()
|
||||
Reference in New Issue
Block a user