From a77e111c52724ad78169d303dfa2f91f1a5e79e3 Mon Sep 17 00:00:00 2001 From: Conner Fromknecht Date: Tue, 10 Dec 2019 13:08:40 -0800 Subject: [PATCH] zpay32: remove unused InvoiceFeatures Originally the feature namespaces were destined to be split, but this has changed with the introduction of flat features. --- zpay32/invoice.go | 9 +++------ zpay32/invoice_test.go | 4 ++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/zpay32/invoice.go b/zpay32/invoice.go index 9cfc0a9f..68b0b41b 100644 --- a/zpay32/invoice.go +++ b/zpay32/invoice.go @@ -85,11 +85,8 @@ const ( ) var ( - // InvoiceFeatures holds the set of all known feature bits that are - // exposed as BOLT 11 features. - InvoiceFeatures = map[lnwire.FeatureBit]string{} - - // ErrInvoiceTooLarge is returned when an invoice exceeds maxInvoiceLength. + // ErrInvoiceTooLarge is returned when an invoice exceeds + // maxInvoiceLength. ErrInvoiceTooLarge = errors.New("invoice is too large") // ErrInvalidFieldLength is returned when a tagged field was specified @@ -934,7 +931,7 @@ func parseFeatures(data []byte) (*lnwire.FeatureVector, error) { return nil, err } - fv := lnwire.NewFeatureVector(rawFeatures, InvoiceFeatures) + fv := lnwire.NewFeatureVector(rawFeatures, lnwire.Features) unknownFeatures := fv.UnknownRequiredFeatures() if len(unknownFeatures) > 0 { return nil, fmt.Errorf("invoice contains unknown required "+ diff --git a/zpay32/invoice_test.go b/zpay32/invoice_test.go index 5feff241..abd418d2 100644 --- a/zpay32/invoice_test.go +++ b/zpay32/invoice_test.go @@ -496,7 +496,7 @@ func TestDecodeEncode(t *testing.T) { Destination: testPubKey, Features: lnwire.NewFeatureVector( lnwire.NewRawFeatureVector(1, 9), - InvoiceFeatures, + lnwire.Features, ), } }, @@ -523,7 +523,7 @@ func TestDecodeEncode(t *testing.T) { Destination: testPubKey, Features: lnwire.NewFeatureVector( lnwire.NewRawFeatureVector(1, 9, 100), - InvoiceFeatures, + lnwire.Features, ), } },