Merge pull request #2664 from lucas-clemente/move-versions-out-of-the-header

move the SupportedVersions slice out of the wire.Header
This commit is contained in:
Marten Seemann 2020-07-10 18:24:46 +07:00 committed by GitHub
commit f16d474e7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 119 additions and 97 deletions

View file

@ -2182,9 +2182,9 @@ var _ = Describe("Client Session", func() {
errChan <- sess.run()
}()
sessionRunner.EXPECT().Remove(srcConnID)
tracer.EXPECT().ReceivedVersionNegotiationPacket(gomock.Any()).Do(func(hdr *wire.Header) {
tracer.EXPECT().ReceivedVersionNegotiationPacket(gomock.Any(), gomock.Any()).Do(func(hdr *wire.Header, versions []logging.VersionNumber) {
Expect(hdr.Version).To(BeZero())
Expect(hdr.SupportedVersions).To(And(
Expect(versions).To(And(
ContainElement(protocol.VersionNumber(4321)),
ContainElement(protocol.VersionNumber(1337)),
))
@ -2209,7 +2209,7 @@ var _ = Describe("Client Session", func() {
}()
sessionRunner.EXPECT().Remove(srcConnID).MaxTimes(1)
gomock.InOrder(
tracer.EXPECT().ReceivedVersionNegotiationPacket(gomock.Any()),
tracer.EXPECT().ReceivedVersionNegotiationPacket(gomock.Any(), gomock.Any()),
tracer.EXPECT().Close(),
)
cryptoSetup.EXPECT().Close()