@ -36,6 +36,8 @@ var (
swapInvoiceDesc = "swap"
swapInvoiceDesc = "swap"
prepayInvoiceDesc = "prepay"
prepayInvoiceDesc = "prepay"
defaultConfirmations = int32 ( loopdb . DefaultLoopOutHtlcConfirmations )
)
)
// TestSuccess tests the loop out happy flow.
// TestSuccess tests the loop out happy flow.
@ -57,7 +59,7 @@ func TestSuccess(t *testing.T) {
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
// Expect client to register for conf.
// Expect client to register for conf.
confIntent := ctx . AssertRegisterConf ( false )
confIntent := ctx . AssertRegisterConf ( false , defaultConfirmations )
testSuccess ( ctx , testRequest . Amount , info . SwapHash ,
testSuccess ( ctx , testRequest . Amount , info . SwapHash ,
signalPrepaymentResult , signalSwapPaymentResult , false ,
signalPrepaymentResult , signalSwapPaymentResult , false ,
@ -83,7 +85,7 @@ func TestFailOffchain(t *testing.T) {
signalSwapPaymentResult := ctx . AssertPaid ( swapInvoiceDesc )
signalSwapPaymentResult := ctx . AssertPaid ( swapInvoiceDesc )
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
ctx . AssertRegisterConf ( false )
ctx . AssertRegisterConf ( false , defaultConfirmations )
signalSwapPaymentResult (
signalSwapPaymentResult (
errors . New ( lndclient . PaymentResultUnknownPaymentHash ) ,
errors . New ( lndclient . PaymentResultUnknownPaymentHash ) ,
@ -196,6 +198,7 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) {
DestAddr : dest ,
DestAddr : dest ,
SwapInvoice : swapPayReq ,
SwapInvoice : swapPayReq ,
SweepConfTarget : 2 ,
SweepConfTarget : 2 ,
HtlcConfirmations : loopdb . DefaultLoopOutHtlcConfirmations ,
MaxSwapRoutingFee : 70000 ,
MaxSwapRoutingFee : 70000 ,
PrepayInvoice : prePayReq ,
PrepayInvoice : prePayReq ,
SwapContract : loopdb . SwapContract {
SwapContract : loopdb . SwapContract {
@ -232,7 +235,9 @@ func testResume(t *testing.T, expired, preimageRevealed, expectSuccess bool) {
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
signalPrepaymentResult := ctx . AssertPaid ( prepayInvoiceDesc )
// Expect client to register for conf.
// Expect client to register for conf.
confIntent := ctx . AssertRegisterConf ( preimageRevealed )
confIntent := ctx . AssertRegisterConf (
preimageRevealed , defaultConfirmations ,
)
signalSwapPaymentResult ( nil )
signalSwapPaymentResult ( nil )
signalPrepaymentResult ( nil )
signalPrepaymentResult ( nil )