aboutsummaryrefslogtreecommitdiffstats
path: root/p2p/protocol_test.go
diff options
context:
space:
mode:
authorFelix Lange <fjl@twurst.com>2015-01-06 18:35:09 +0800
committerFelix Lange <fjl@twurst.com>2015-01-06 19:23:38 +0800
commiteb0e7b1b8120852a1d56aa0ebd3a98e652965635 (patch)
tree9e87afc204d178d89ed24cc43afcc3da6b252a49 /p2p/protocol_test.go
parent36e1e5f15142b37801844a072eb46ea67fbc8868 (diff)
downloaddexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar.gz
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar.bz2
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar.lz
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar.xz
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.tar.zst
dexon-eb0e7b1b8120852a1d56aa0ebd3a98e652965635.zip
eth, p2p: remove EncodeMsg from p2p.MsgWriter
...and make it a top-level function instead. The original idea behind having EncodeMsg in the interface was that implementations might be able to encode RLP data to their underlying writer directly instead of buffering the encoded data. The encoder will buffer anyway, so that doesn't matter anymore. Given the recent problems with EncodeMsg (copy-pasted implementation bug) I'd rather implement once, correctly.
Diffstat (limited to 'p2p/protocol_test.go')
-rw-r--r--p2p/protocol_test.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/p2p/protocol_test.go b/p2p/protocol_test.go
index ce25b3e1b..ba5e95c02 100644
--- a/p2p/protocol_test.go
+++ b/p2p/protocol_test.go
@@ -93,7 +93,7 @@ func TestBaseProtocolDisconnect(t *testing.T) {
if err := expectMsg(rw2, handshakeMsg); err != nil {
t.Error(err)
}
- err := rw2.EncodeMsg(handshakeMsg,
+ err := EncodeMsg(rw2, handshakeMsg,
baseProtocolVersion,
"",
[]interface{}{},
@@ -106,7 +106,7 @@ func TestBaseProtocolDisconnect(t *testing.T) {
if err := expectMsg(rw2, getPeersMsg); err != nil {
t.Error(err)
}
- if err := rw2.EncodeMsg(discMsg, DiscQuitting); err != nil {
+ if err := EncodeMsg(rw2, discMsg, DiscQuitting); err != nil {
t.Error(err)
}