-
Notifications
You must be signed in to change notification settings - Fork 976
test: test open channel with unknown fees #8865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
tests/test_opening.py
Outdated
| with pytest.raises(RpcError) as e: | ||
| l1.rpc.fundchannel(id=l2.info['id'], amount=1000000, feerate='252perkw', minconf=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the test case!
I would love you to enhance this a little:
- Use
with pytest.raises(RpcError, match='xxxx')to check that the error is the one you expect. - Test this with no feerate specified (should fail), then check that it does work with feerate=
- Mark the test with
@pytest.mark.xfail(strict=True).
Then I can write the fix on top of this, and remove the xfail mark, as a separate commit!
tests/test_opening.py
Outdated
| 'dev-no-fake-fees': True, | ||
| } | ||
|
|
||
| l1, l2 = node_factory.line_graph(2, opts=[opts, opts]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, opts=opts means "use these options for all nodes". But I think the open will fail if l2 also doesn't know the fees, so you may want opts=[opts, {}] ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test logic
In a context in which fees can't be compute, the user needs to specify feerate on the fundchannel call.
- The RPC
fundchannelcall should fail iffeerateis not specified - The RPC
fundchannelcall should work fine iffeerateis specified
Additional Info
I can't use line_graph since it automatically opens a channel which fails due to unknown feerate. That's why I wasn't able to capture the error with RpcError in the first version of the test. The error actually raised during line_graph call and not from the 'external' fundchannel call.
Important
26.04 FREEZE March 11th: Non-bugfix PRs not ready by this date will wait for 26.06.
RC1 is scheduled on March 23rd
The final release is scheduled for April 15th.
Checklist
Before submitting the PR, ensure the following tasks are completed. If an item is not applicable to your PR, please mark it as checked:
tools/lightning-downgradeAdditional info
To run the test:
EXPERIMENTAL_DUAL_FUND=0 uv run python -m pytest -vvvv tests/test_opening.py::test_opening_with_unknown_feeratesNote that in the same node configuration (
dev-no-fake-fees=true):experimental-dual-fundis enabled, the channel will open only iffeerateis specified in thefundchannelcall (test at tests: test reproduce #8847 #8864 ), otherwise it will raiseexperimental-dual-fundis NOT enabled, the channel funding will fail both if thefeerateis specified or not.