Skip to content

Commit

Permalink
tapchannel: add AuxInvoiceManager prop test btc invoice protection
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
GeorgeTsagk committed Dec 6, 2024
1 parent 3a281fd commit b3abdb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tapchannel/aux_invoice_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit b3abdb1

Please sign in to comment.