a9c05d7d16
``` $ l1-cli close 445x1x1 # Sending closing fee offer 183sat, with range 0sat-183sat # Received closing fee offer 183sat, with range 0sat-1000000sat { "tx": "0200000000010153ce29f4df20875492760ec51092d01ade3da99ffd72c3ff47b02e8f78a5845a0100000000ffffffff02b882010000000000225120847b3d31b036c0b4fad77fd41805f375f4fc9507d52f2a19d858b43975a633b0d1be0d000000000022512017912fd7fc767d03e02461bd932556d78291ea226db5efec84d84a5c753a650a0400473044022005b184a595ec0b650dffb3168d003b13ae0d98d456d879ec7fac7012f3dbad6202202f5a9620a59fb3cb9269be3b2a941f18fe1b7e3037c259125c56d3ec86c8e91a014730440220559f1c2a578e35a975466bb6f2319d313cd79070add77c51b6f6aeb25f7eae9802204749e84e7f8a777c66896a38588f6046a28653a493c34c79a0080580a0f389ec01475221024ff290301210ddffa14db591eb629d864bb4b4583586f5bffaaebc4ca8d5edef2102e0de3f54ca6cf38cb527b326242bf418a4a0a50485c97999074e69e127216fd052ae00000000", "txid": "216ed9adf8df623770e219f52b31350de60cd1b236d6f043664d9eb5bc462ad4", "type": "mutual" } rusty@rusty-Framework:~/devel/cvs/lightning (master)$ bt-cli getrawmempool [ ] ``` Logs show: ``` 2023-08-11T02:20:13.947Z DEBUG plugin-bcli: sendrawtx exit 26 (bitcoin-cli -regtest -datadir=/home/rusty/.bitcoin sendrawtransaction 0200000000010153ce29f4df20875492760ec51092d01ade3da99ffd72c3ff47b02e8f78a5845a0100000000ffffffff02b882010000000000225120847b3d31b036c0b4fad77fd41805f375f4fc9507d52f2a19d858b43975a633b0d1be0d000000000022512017912fd7fc767d03e02461bd932556d78291ea226db5efec84d84a5c753a650a0400473044022005b184a595ec0b650dffb3168d003b13ae0d98d456d879ec7fac7012f3dbad6202202f5a9620a59fb3cb9269be3b2a941f18fe1b7e3037c259125c56d3ec86c8e91a014730440220559f1c2a578e35a975466bb6f2319d313cd79070add77c51b6f6aeb25f7eae9802204749e84e7f8a777c66896a38588f6046a28653a493c34c79a0080580a0f389ec01475221024ff290301210ddffa14db591eb629d864bb4b4583586f5bffaaebc4ca8d5edef2102e0de3f54ca6cf38cb527b326242bf418a4a0a50485c97999074e69e127216fd052ae00000000) error code: -26\nerror message:\nmin relay fee not met, 183 < 192 Indeed, tx weight is 192! ``` Reported-by: @ShahanaFarooqui |
||
---|---|---|
.. | ||
pyln/testing | ||
tests | ||
.gitignore | ||
Makefile | ||
pyproject.toml | ||
README.md |
pyln-testing: A library to write tests against Core Lightning
This library implements a number of utilities that help building tests for Core Lightning nodes. In particular it provides a number of pytest fixtures that allow the management of a test network of a given topology and then execute a test scenarion.
pyln-testing
is used by Core Lightning for its internal tests, and by the
community plugin directory to exercise the plugins.
Installation
pyln-testing
is available on pip
:
pip install pyln-testing
Alternatively you can also install the development version to get access to currently unreleased features by checking out the Core Lightning source code and installing into your python3 environment:
git clone https://github.com/ElementsProject/lightning.git
cd lightning/contrib/pyln-testing
poetry install
This will add links to the library into your environment so changing the checked out source code will also result in the environment picking up these changes. Notice however that unreleased versions may change API without warning, so test thoroughly with the released version.
Testing GRPC Bindings
The grpc bindings can be tested by setting the CLN_TEST_GRPC=1
environment variable. This will cause the testing framework to use a
grpc client to talk to the cln-grpc
plugin, rather than talking
directly to the node's JSON-RPC interface. Since the GRPC related
dependencies are guarded behind a feature flag in pyln-testing
you'll need to install it with the grpc
feature enabled in order to
be able to run in this mode.
Below is a diagram of how the normal JSON-RPC interaction looks like, followed by one that display the grpc interaction:
CLN -- JSON-RPC -- LightningRpc -- pytest
\_____CLN_____/ \_______pytest_______/
CLN -- JSON-RPC -- cln-rpc -- rpc2grpc converters -- grpc interface -- python grpc client -- python grpc2json converter -- pytest
\_____CLN_____/ \___________cln-grpc-plugin____________________/ \__________________________pytest________________________/
As you can see the grpc mode attempts to emulate the simple JSON-RPC
mode by passing the call through a number of conversions. The last
step grpc2json
is rather incomplete, and will cause quite a few
tests to fail for now, until the conversion is completed and we reach
feature parity between the interaction modes.