@@ -25,6 +25,7 @@ import (
2525 "io"
2626 "net"
2727 "path/filepath"
28+ "slices"
2829 "sort"
2930 "strings"
3031 "sync/atomic"
@@ -159,16 +160,16 @@ func TestVersionToFeature(t *testing.T) {
159160 {"1.2.3" , "" , peerFeatureFlag (0 )},
160161 {"a.b" , "" , peerFeatureFlag (0 )},
161162 {"2.1" , "" , peerFeatureFlag (0 )},
162- {"2.1" , PeerFeatureProposalCompression , peerFeatureFlag (0 )},
163+ {"2.1" , peerFeatureProposalCompression , peerFeatureFlag (0 )},
163164 {"2.2" , "" , peerFeatureFlag (0 )},
164165 {"2.2" , "test" , peerFeatureFlag (0 )},
165166 {"2.2" , strings .Join ([]string {"a" , "b" }, "," ), peerFeatureFlag (0 )},
166- {"2.2" , PeerFeatureProposalCompression , pfCompressedProposal },
167- {"2.2" , strings .Join ([]string {PeerFeatureProposalCompression , "test" }, "," ), pfCompressedProposal },
168- {"2.2" , strings .Join ([]string {PeerFeatureProposalCompression , "test" }, ", " ), pfCompressedProposal },
169- {"2.2" , strings .Join ([]string {PeerFeatureProposalCompression , PeerFeatureVoteVpackCompression }, "," ), pfCompressedVoteVpack | pfCompressedProposal },
170- {"2.2" , PeerFeatureVoteVpackCompression , pfCompressedVoteVpack },
171- {"2.3" , PeerFeatureProposalCompression , pfCompressedProposal },
167+ {"2.2" , peerFeatureProposalCompression , pfCompressedProposal },
168+ {"2.2" , strings .Join ([]string {peerFeatureProposalCompression , "test" }, "," ), pfCompressedProposal },
169+ {"2.2" , strings .Join ([]string {peerFeatureProposalCompression , "test" }, ", " ), pfCompressedProposal },
170+ {"2.2" , strings .Join ([]string {peerFeatureProposalCompression , peerFeatureVoteVpackCompression }, "," ), pfCompressedVoteVpack | pfCompressedProposal },
171+ {"2.2" , peerFeatureVoteVpackCompression , pfCompressedVoteVpack },
172+ {"2.3" , peerFeatureProposalCompression , pfCompressedProposal },
172173 }
173174 for i , test := range tests {
174175 t .Run (fmt .Sprintf ("%d" , i ), func (t * testing.T ) {
@@ -233,19 +234,12 @@ func TestPeerReadLoopSwitchAllTags(t *testing.T) {
233234 })
234235 require .True (t , readLoopFound )
235236 require .NotEmpty (t , foundTags )
236- ignored := map [string ]struct {}{
237- "VotePackedTag" : {}, // normalized to AgreementVoteTag before the switch
238- }
239- filtered := allTags [:0 ]
240- for _ , tag := range allTags {
241- if _ , ok := ignored [tag ]; ok {
242- continue
243- }
244- filtered = append (filtered , tag )
245- }
246- allTags = filtered
237+ // Filter out VP, it's normalized to AV before the switch statement
238+ allTags = slices .DeleteFunc (allTags , func (tag string ) bool { return tag == "VotePackedTag" })
247239 sort .Strings (allTags )
248240 sort .Strings (foundTags )
241+ t .Logf ("All tags: %v" , allTags )
242+ t .Logf ("Found tags: %v" , foundTags )
249243 require .Equal (t , allTags , foundTags )
250244}
251245
0 commit comments