MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_rbf_no_overlap

Function test_rbf_no_overlap

tests/test_opening.py:1119–1150  ·  view source on GitHub ↗
(node_factory, bitcoind, chainparams)

Source from the content-addressed store, hash-verified

1117@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')
1118@pytest.mark.openchannel('v2')
1119def test_rbf_no_overlap(node_factory, bitcoind, chainparams):
1120 l1, l2 = node_factory.get_nodes(2,
1121 opts={'allow_warning': True})
1122
1123 l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
1124 amount = 2**24
1125 chan_amount = 100000
1126 bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['p2tr'], amount / 10**8 + 0.01)
1127 bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['p2tr'], amount / 10**8 + 0.01)
1128 bitcoind.generate_block(1)
1129 # Wait for it to arrive.
1130 wait_for(lambda: len(l1.rpc.listfunds()['outputs']) > 0)
1131
1132 res = l1.rpc.fundchannel(l2.info['id'], chan_amount)
1133 chan_id = res['channel_id']
1134
1135 # Check that we're waiting for lockin
1136 l1.daemon.wait_for_log(' to DUALOPEND_AWAITING_LOCKIN')
1137
1138 next_feerate = find_next_feerate(l1, l2)
1139
1140 # Initiate an RBF (this grabs the non-reserved utxo, which isnt the
1141 # one we started with)
1142 startweight = 42 + 172 # base weight, funding output
1143 initpsbt = l1.rpc.fundpsbt(chan_amount, next_feerate, startweight,
1144 excess_as_change=True)
1145
1146 # Do the bump
1147 bump = l1.rpc.openchannel_bump(chan_id, chan_amount, initpsbt['psbt'])
1148
1149 with pytest.raises(RpcError, match='No overlapping input present.'):
1150 l1.rpc.openchannel_update(chan_id, bump['psbt'])
1151
1152
1153@unittest.skipIf(TEST_NETWORK != 'regtest', 'elementsd doesnt yet support PSBT features we need')

Callers

nothing calls this directly

Calls 12

wait_forFunction · 0.90
find_next_feerateFunction · 0.85
get_nodesMethod · 0.80
generate_blockMethod · 0.80
wait_for_logMethod · 0.80
fundpsbtMethod · 0.80
openchannel_bumpMethod · 0.80
openchannel_updateMethod · 0.80
connectMethod · 0.45
newaddrMethod · 0.45
listfundsMethod · 0.45
fundchannelMethod · 0.45

Tested by

no test coverage detected