remove error return value from ComposeVersionNegotiation (#3410)

This commit is contained in:
Chao Fei 2022-05-12 23:03:39 +08:00 committed by GitHub
parent b9a77af8f9
commit 60bbe92194
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 14 additions and 30 deletions

View file

@ -674,8 +674,7 @@ var _ = Describe("Connection", func() {
})
It("drops Version Negotiation packets", func() {
b, err := wire.ComposeVersionNegotiation(srcConnID, destConnID, conn.config.Versions)
Expect(err).ToNot(HaveOccurred())
b := wire.ComposeVersionNegotiation(srcConnID, destConnID, conn.config.Versions)
tracer.EXPECT().DroppedPacket(logging.PacketTypeVersionNegotiation, protocol.ByteCount(len(b)), logging.PacketDropUnexpectedPacket)
Expect(conn.handlePacketImpl(&receivedPacket{
data: b,
@ -2592,8 +2591,7 @@ var _ = Describe("Client Connection", func() {
Context("handling Version Negotiation", func() {
getVNP := func(versions ...protocol.VersionNumber) *receivedPacket {
b, err := wire.ComposeVersionNegotiation(srcConnID, destConnID, versions)
Expect(err).ToNot(HaveOccurred())
b := wire.ComposeVersionNegotiation(srcConnID, destConnID, versions)
return &receivedPacket{
data: b,
buffer: getPacketBuffer(),