Add custom channels liquidity edge cases itest#842
Add custom channels liquidity edge cases itest#842Roasbeef merged 2 commits intolightninglabs:0-19-stagingfrom
Conversation
d85b327 to
d77401e
Compare
| select { | ||
| case <-done: | ||
| case <-timeoutChan: | ||
| t.Fatalf("Payment didn't fail within expected time duration") |
There was a problem hiding this comment.
I'm doing this because both timeout and actual payment error result in lnrpc.Payment_FAILED above, so I wanna make sure we failed but not because we got stuck in a loop (behavior prior to bug fix)
guggero
left a comment
There was a problem hiding this comment.
Great to have a specific test for these edge cases 👍
|
|
||
| } | ||
|
|
||
| logBalance(t.t, nodes, assetID, "after failed 50 assets") |
There was a problem hiding this comment.
Would be nice if we could also assert the payment's failure reason, that it's actually the INSUFFICIENT_BALANCE code. I think we return that somewhere.
There was a problem hiding this comment.
yeap good idea, it's already available here through the SendPayment RPC response, result.FailureReason
There was a problem hiding this comment.
Since this is meant to fail in the paymentLifecycle phase, we should get a NO_ROUTE instead
The reason the failure happens there is because that's when we actually provide the 500 sats amount to the PaymentBandwidth hook. See more on this comment
d77401e to
fcd4227
Compare
|
|
guggero
left a comment
There was a problem hiding this comment.
Linter and itest failed, other than that looks good 🎉
fcd4227 to
15e694a
Compare
|
|
15e694a to
6a2097a
Compare
6a2097a to
7f75248
Compare
| fn.None[lnrpc.PaymentFailureReason](), | ||
| ) | ||
|
|
||
| logBalance(t.t, nodes, assetID, "after 50 sats backwards") |
There was a problem hiding this comment.
nit: after 50 assets backwards, not sats
This PR adds an itest that exposes the liquidity related edge cases of custom channels.
The following PRs need to be merged first, in order to bump the dependencies on this PR:
Closes lightninglabs/taproot-assets#1060
Closes lightninglabs/taproot-assets#1073
Closes lightninglabs/taproot-assets#1013