From b3abdb14920edd3a2f4c391b480dbf0cb075f119 Mon Sep 17 00:00:00 2001 From: George Tsagkarelis Date: Fri, 6 Dec 2024 13:02:23 +0100 Subject: [PATCH] tapchannel: add AuxInvoiceManager prop test btc invoice protection In this commit we extend the property based tests to account for the new piece of AuxInvoiceManager behavior. If the randomly generated invoice is not an asset invoice, but the HTLCs do carry assets, we should expect the manager to reject the HTLCs. --- tapchannel/aux_invoice_manager_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tapchannel/aux_invoice_manager_test.go b/tapchannel/aux_invoice_manager_test.go index 779557753..a6dadc3a5 100644 --- a/tapchannel/aux_invoice_manager_test.go +++ b/tapchannel/aux_invoice_manager_test.go @@ -189,6 +189,11 @@ func (m *mockHtlcModifierProperty) HtlcModifier(ctx context.Context, if r.ExitHtlcAmt != res.AmtPaid { m.t.Errorf("AmtPaid != ExitHtlcAmt") } + } else if !isAssetInvoice(r.Invoice, m) { + if !res.CancelSet { + m.t.Errorf("expected cancel set flag") + } + continue } htlcBlob, err := r.WireCustomRecords.Serialize()