lnwire: extend RawFeatureVector with helper methods

This commit is contained in:
Wilmer Paulino
2021-07-12 17:41:50 -07:00
committed by Olaoluwa Osuntokun
parent 5a9f499dd5
commit 031d7b1d55
3 changed files with 86 additions and 7 deletions

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).