-
Notifications
You must be signed in to change notification settings - Fork 1k
splicescript: Turn on bitcoin addresses in splice script #8991
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
Open
ddustin
wants to merge
4
commits into
ElementsProject:master
Choose a base branch
from
ddustin:ddustin/splice_to_address
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+122
−70
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6aa09d2
splicescript: Add test for splice out to btc addr
ddustin 33b6782
splicescript: Fix rare memleak of aborting an abort
ddustin c9b4ac4
splicescript: Fix bugs in bitcoin addr handling
ddustin 574e859
splicescript: Turn on bitcoin addresses in splice script
ddustin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -653,7 +653,38 @@ def test_easy_splice_out(node_factory, bitcoind, chainparams): | |
| assert initial_wallet_balance + Millisatoshi(spliceamt * 1000) == end_wallet_balance | ||
|
|
||
|
|
||
| @pytest.mark.xfail(strict=True) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The |
||
| @pytest.mark.openchannel('v1') | ||
| @pytest.mark.openchannel('v2') | ||
| @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') | ||
| def test_splice_out_address(node_factory, bitcoind, chainparams): | ||
| fundamt = 1000000 | ||
|
|
||
| l1, l2 = node_factory.line_graph(2, fundamount=fundamt, wait_for_announce=True, | ||
| opts={'experimental-splicing': None}) | ||
|
|
||
| initial_wallet_balance = Millisatoshi(bkpr_account_balance(l1, 'wallet')) | ||
|
|
||
| addr = l1.rpc.newaddr()['p2tr'] | ||
|
|
||
| # Splice out 100k from first channel, putting result less fees into onchain wallet via addres | ||
| spliceamt = 100000 | ||
| l1.rpc.splice(f"*:? -> {spliceamt}+fee; {spliceamt} -> {addr}") | ||
|
|
||
| bitcoind.generate_block(6, wait_for_mempool=1) | ||
| l2.daemon.wait_for_log(r'lightningd, splice_locked clearing inflights') | ||
|
|
||
| p1 = only_one(l1.rpc.listpeerchannels(peer_id=l2.info['id'])['channels']) | ||
| p2 = only_one(l2.rpc.listpeerchannels(l1.info['id'])['channels']) | ||
| assert 'inflight' not in p1 | ||
| assert 'inflight' not in p2 | ||
|
|
||
| wait_for(lambda: len(l1.rpc.listfunds()['outputs']) == 2) | ||
| wait_for(lambda: len(l1.rpc.listfunds()['channels']) == 1) | ||
|
|
||
| end_wallet_balance = Millisatoshi(bkpr_account_balance(l1, 'wallet')) | ||
| assert initial_wallet_balance + Millisatoshi(spliceamt * 1000) == end_wallet_balance | ||
|
|
||
|
|
||
| @pytest.mark.openchannel('v1') | ||
| @pytest.mark.openchannel('v2') | ||
| @unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need') | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nice! No remaining guard exists, but none is needed