diff options
author | Elad <theman@elad.im> | 2018-06-14 17:21:17 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2018-06-14 17:21:17 +0800 |
commit | 1836366ac19e30f157570e61342fae53bc6c8a57 (patch) | |
tree | a95b5027602d17315cd6462f7c08ac4123c9099d /p2p/rlpx_test.go | |
parent | 591cef17d4f1700de50057fd6988b9731a2195c9 (diff) | |
download | go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar.gz go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar.bz2 go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar.lz go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar.xz go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.tar.zst go-tangerine-1836366ac19e30f157570e61342fae53bc6c8a57.zip |
all: library changes for swarm-network-rewrite (#16898)
This commit adds all changes needed for the merge of swarm-network-rewrite.
The changes:
- build: increase linter timeout
- contracts/ens: export ensNode
- log: add Output method and enable fractional seconds in format
- metrics: relax test timeout
- p2p: reduced some log levels, updates to simulation packages
- rpc: increased maxClientSubscriptionBuffer to 20000
Diffstat (limited to 'p2p/rlpx_test.go')
-rw-r--r-- | p2p/rlpx_test.go | 31 |
1 files changed, 2 insertions, 29 deletions
diff --git a/p2p/rlpx_test.go b/p2p/rlpx_test.go index bca460402..7ae800774 100644 --- a/p2p/rlpx_test.go +++ b/p2p/rlpx_test.go @@ -35,6 +35,7 @@ import ( "github.com/ethereum/go-ethereum/crypto/ecies" "github.com/ethereum/go-ethereum/crypto/sha3" "github.com/ethereum/go-ethereum/p2p/discover" + "github.com/ethereum/go-ethereum/p2p/simulations/pipes" "github.com/ethereum/go-ethereum/rlp" ) @@ -159,7 +160,7 @@ func TestProtocolHandshake(t *testing.T) { wg sync.WaitGroup ) - fd0, fd1, err := tcpPipe() + fd0, fd1, err := pipes.TCPPipe() if err != nil { t.Fatal(err) } @@ -601,31 +602,3 @@ func TestHandshakeForwardCompatibility(t *testing.T) { t.Errorf("ingress-mac('foo') mismatch:\ngot %x\nwant %x", fooIngressHash, wantFooIngressHash) } } - -// tcpPipe creates an in process full duplex pipe based on a localhost TCP socket -func tcpPipe() (net.Conn, net.Conn, error) { - l, err := net.Listen("tcp", "127.0.0.1:0") - if err != nil { - return nil, nil, err - } - defer l.Close() - - var aconn net.Conn - aerr := make(chan error, 1) - go func() { - var err error - aconn, err = l.Accept() - aerr <- err - }() - - dconn, err := net.Dial("tcp", l.Addr().String()) - if err != nil { - <-aerr - return nil, nil, err - } - if err := <-aerr; err != nil { - dconn.Close() - return nil, nil, err - } - return aconn, dconn, nil -} |