aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/peer_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-05-14 23:41:43 +0800
committerFelix Lange <fjl@twurst.com>2015-05-25 07:17:14 +0800
commitdbdc5fd4b33ad98ebde72e7d934cebab1408f057 (patch)
tree79d6b8827555b0220a89456d3132f40ed0f9b291 /p2p/peer_test.go
parent2f249fea448a10ae0986a140f5a52d8a310e57fe (diff)
downloadgo-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar.gz
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar.bz2
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar.lz
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar.xz
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.tar.zst
go-tangerine-dbdc5fd4b33ad98ebde72e7d934cebab1408f057.zip
p2p: delete Server.Broadcast
Diffstat (limited to 'p2p/peer_test.go')
-rw-r--r--p2p/peer_test.go39
1 files changed, 0 insertions, 39 deletions
diff --git a/p2p/peer_test.go b/p2p/peer_test.go
index 59dcb7ba4..0ac032ab7 100644
--- a/p2p/peer_test.go
+++ b/p2p/peer_test.go
@@ -1,7 +1,6 @@
package p2p
import (
- "bytes"
"errors"
"fmt"
"math/rand"
@@ -107,44 +106,6 @@ func TestPeerProtoEncodeMsg(t *testing.T) {
}
}
-func TestPeerWriteForBroadcast(t *testing.T) {
- closer, rw, peer, peerErr := testPeer([]Protocol{discard})
- defer closer()
-
- emptymsg := func(code uint64) Msg {
- return Msg{Code: code, Size: 0, Payload: bytes.NewReader(nil)}
- }
-
- // test write errors
- if err := peer.writeProtoMsg("b", emptymsg(3)); err == nil {
- t.Errorf("expected error for unknown protocol, got nil")
- }
- if err := peer.writeProtoMsg("discard", emptymsg(8)); err == nil {
- t.Errorf("expected error for out-of-range msg code, got nil")
- } else if perr, ok := err.(*peerError); !ok || perr.Code != errInvalidMsgCode {
- t.Errorf("wrong error for out-of-range msg code, got %#v", err)
- }
-
- // setup for reading the message on the other end
- read := make(chan struct{})
- go func() {
- if err := ExpectMsg(rw, 16, nil); err != nil {
- t.Error(err)
- }
- close(read)
- }()
-
- // test successful write
- if err := peer.writeProtoMsg("discard", emptymsg(0)); err != nil {
- t.Errorf("expect no error for known protocol: %v", err)
- }
- select {
- case <-read:
- case err := <-peerErr:
- t.Fatalf("peer stopped: %v", err)
- }
-}
-
func TestPeerPing(t *testing.T) {
closer, rw, _, _ := testPeer(nil)
defer closer()