Skip to content

Commit ac464d6

Browse files
ZZiigguurraattZZiigguurraatt
authored andcommitted
itest: use createNormalInvoice more places
Redundant code is eliminated by re-using the function `createNormalInvoice` inside the function `createAndPayNormalInvoiceWithBtc`.
1 parent 1462832 commit ac464d6

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

itest/assets_test.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -805,17 +805,7 @@ func sendKeySendPayment(t *testing.T, src, dst *HarnessNode,
805805
func createAndPayNormalInvoiceWithBtc(t *testing.T, src, dst *HarnessNode,
806806
amountSat btcutil.Amount) {
807807

808-
ctxb := context.Background()
809-
ctxt, cancel := context.WithTimeout(ctxb, defaultTimeout)
810-
defer cancel()
811-
812-
expirySeconds := 10
813-
invoiceResp, err := dst.AddInvoice(ctxt, &lnrpc.Invoice{
814-
Value: int64(amountSat),
815-
Memo: "normal invoice",
816-
Expiry: int64(expirySeconds),
817-
})
818-
require.NoError(t, err)
808+
invoiceResp := createNormalInvoice(t, dst, amountSat)
819809

820810
payInvoiceWithSatoshi(t, src, invoiceResp)
821811
}

0 commit comments

Comments
 (0)