-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: add a test for closing a channel with LND
Not sure if we should add this as the Dispose() method of the test class actually: https://stackoverflow.com/a/33516224/544947
- Loading branch information
Showing
2 changed files
with
31 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -536,5 +536,26 @@ public void CanParseLightningURL() | |
Assert.True(LightningConnectionString.TryParse("type=charge;server=http://api-token:[email protected]:54938/;allowinsecure=true", out conn)); | ||
Assert.Equal("type=charge;server=http://127.0.0.1:54938/;api-token=foiewnccewuify;allowinsecure=true", conn.ToString()); | ||
} | ||
|
||
[Fact(Timeout = Timeout)] | ||
public async Task CanCloseLndChannel() | ||
{ | ||
// TODO: test in all LN implementations, not just LND | ||
//foreach (var test in Tester.GetTestedPairs()) | ||
//{ | ||
var test = Tester.GetTestedLndPair(); | ||
await EnsureConnectedToDestinations(test); | ||
var customer = (ILightningClient)test.Customer; | ||
var senderChannel = (await customer.ListChannels()).First(); | ||
|
||
var senderInfo = await customer.GetInfo(); | ||
var closeChannelRequest = new CloseChannelRequest() | ||
{ | ||
NodeInfo = senderInfo.NodeInfoList.First(), | ||
ChannelPointOutputIndex = senderChannel.ChannelPoint.N | ||
}; | ||
await test.Merchant.CloseChannel(closeChannelRequest, CancellationToken.None); | ||
//} | ||
} | ||
} | ||
} |
This file contains 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