From 5aebac49f576a5e1245e573cb45b0405577c1a3d Mon Sep 17 00:00:00 2001 From: Nikita Kryuchkov Date: Fri, 7 Jun 2019 18:36:45 +0300 Subject: [PATCH] Fix invertedIDConn logic --- pkg/dmsg/client_test.go | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/pkg/dmsg/client_test.go b/pkg/dmsg/client_test.go index 3ea046d2d5..c7825bc84c 100644 --- a/pkg/dmsg/client_test.go +++ b/pkg/dmsg/client_test.go @@ -4,7 +4,6 @@ import ( "context" "net" "testing" - "time" "github.com/skycoin/skycoin/src/util/logging" "github.com/stretchr/testify/assert" @@ -44,13 +43,9 @@ func TestClient(t *testing.T) { _ = conn2.Serve(ctx, ch2) }() - time.Sleep(100 * time.Millisecond) - tr, err := conn1.DialTransport(ctx, pk2) assert.NoError(t, err) - time.Sleep(100 * time.Millisecond) - err = tr.Close() assert.NoError(t, err) } @@ -61,8 +56,6 @@ type invertedIDConn struct { func (c invertedIDConn) Write(b []byte) (n int, err error) { frame := Frame(b) - - newID := randID(!isInitiatorID(frame.TpID())) - newFrame := MakeFrame(frame.Type(), newID, frame.Pay()) + newFrame := MakeFrame(frame.Type(), frame.TpID()^1, frame.Pay()) return c.Conn.Write(newFrame) }