lnwire: add ExtraOpaqueData helper functions and methods

Introduces a couple of new helper functions for both the ExtraOpaqueData
and CustomRecords types along with new methods on the ExtraOpaqueData.
This commit is contained in:
ffranr
2024-05-03 18:36:00 +01:00
committed by Oliver Gugger
parent 17c0a70b07
commit af50694643
4 changed files with 596 additions and 76 deletions

View File

@@ -144,10 +144,8 @@ func TestCustomRecordsExtendRecordProducers(t *testing.T) {
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {
nonCustomRecords := tlv.MapToRecords(tc.existingTypes)
nonCustomProducers := fn.Map(
func(r tlv.Record) tlv.RecordProducer {
return &recordProducer{r}
}, nonCustomRecords,
nonCustomProducers := RecordsAsProducers(
nonCustomRecords,
)
combined, err := tc.customRecords.ExtendRecordProducers(