lnwire: extend RawFeatureVector with helper methods

This commit is contained in:
Wilmer Paulino authored and Olaoluwa Osuntokun committed 2021-08-30 19:17:31 -07:00
1 parent 5a9f499dd5
commit 031d7b1d55
3 files changed
+86 -7

No files matched your search

+5 -3
View File
@@ -193,9 +193,11 @@ func TestWriteRawFeatureVector(t *testing.T) {
require.Equal(t, ErrNilFeatureVector, err)
// Create a raw feature vector.
feature := &RawFeatureVector{features: map[FeatureBit]bool{
InitialRoutingSync: true, // FeatureBit 3.
}}
feature := &RawFeatureVector{
features: map[FeatureBit]struct{}{
InitialRoutingSync: {}, // FeatureBit 3.
},
}
expectedBytes := []byte{
0, 1, // First two bytes encode the length.
8, // Last byte encodes the feature bit (1 << 3).