Skip to content

Commit ffc6e68

Browse files
committed
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.
1 parent 1e5d966 commit ffc6e68

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tapchannel/aux_invoice_manager_test.go

+5
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,11 @@ func (m *mockHtlcModifierProperty) HtlcModifier(ctx context.Context,
189189
if r.ExitHtlcAmt != res.AmtPaid {
190190
m.t.Errorf("AmtPaid != ExitHtlcAmt")
191191
}
192+
} else if !isAssetInvoice(r.Invoice, m) {
193+
if !res.CancelSet {
194+
m.t.Errorf("expected cancel set flag")
195+
}
196+
continue
192197
}
193198

194199
htlcBlob, err := r.WireCustomRecords.Serialize()

0 commit comments

Comments
 (0)