record: move CustomRecordSet

This commit is contained in:
Joost Jager committed 2019-12-12 00:12:19 +01:00
1 parent 7aa4a7c7fc
commit 8b5bb0ac63
9 files changed
+34 -35

No files matched your search

+5 -5
View File
@@ -7,9 +7,9 @@ import (
"time"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/htlcswitch/hop"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/record"
)
var (
@@ -212,7 +212,7 @@ func TestInvoiceCancelSingleHtlc(t *testing.T) {
key := CircuitKey{ChanID: lnwire.NewShortChanIDFromInt(1), HtlcID: 4}
htlc := HtlcAcceptDesc{
Amt: 500,
CustomRecords: make(hop.CustomRecordSet),
CustomRecords: make(record.CustomSet),
}
invoice, err := db.UpdateInvoice(paymentHash,
func(invoice *Invoice) (*InvoiceUpdateDesc, error) {
@@ -439,7 +439,7 @@ func TestDuplicateSettleInvoice(t *testing.T) {
AcceptTime: time.Unix(1, 0),
ResolveTime: time.Unix(1, 0),
State: HtlcStateSettled,
CustomRecords: make(hop.CustomRecordSet),
CustomRecords: make(record.CustomSet),
},
}
@@ -751,7 +751,7 @@ func getUpdateInvoice(amt lnwire.MilliSatoshi) InvoiceUpdateCallback {
return nil, ErrInvoiceAlreadySettled
}
noRecords := make(hop.CustomRecordSet)
noRecords := make(record.CustomSet)
update := &InvoiceUpdateDesc{
State: &InvoiceStateUpdateDesc{
@@ -795,7 +795,7 @@ func TestCustomRecords(t *testing.T) {
// Accept an htlc with custom records on this invoice.
key := CircuitKey{ChanID: lnwire.NewShortChanIDFromInt(1), HtlcID: 4}
records := hop.CustomRecordSet{
records := record.CustomSet{
100000: []byte{},
100001: []byte{1, 2},
}
+3 -2
View File
@@ -12,6 +12,7 @@ import (
"github.com/lightningnetwork/lnd/htlcswitch/hop"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/record"
"github.com/lightningnetwork/lnd/tlv"
)
@@ -317,7 +318,7 @@ type InvoiceHTLC struct {
// CustomRecords contains the custom key/value pairs that accompanied
// the htlc.
CustomRecords hop.CustomRecordSet
CustomRecords record.CustomSet
}
// HtlcAcceptDesc describes the details of a newly accepted htlc.
@@ -337,7 +338,7 @@ type HtlcAcceptDesc struct {
// CustomRecords contains the custom key/value pairs that accompanied
// the htlc.
CustomRecords hop.CustomRecordSet
CustomRecords record.CustomSet
}
// InvoiceUpdateDesc describes the changes that should be applied to the