Remove unused p2p encoding method (#6411)

* Remove unused p2p encoding method
This commit is contained in:
Preston Van Loon 2020-06-25 21:02:09 -07:00 committed by GitHub
parent 1b430e0c17
commit 806a465117
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 20 deletions

View File

@ -12,8 +12,6 @@ const (
// NetworkEncoding represents an encoder compatible with Ethereum 2.0 p2p.
type NetworkEncoding interface {
// Decode to the provided message. The interface must be a pointer to the decoding destination.
Decode([]byte, interface{}) error
// DecodeGossip to the provided gossip message. The interface must be a pointer to the decoding destination.
DecodeGossip([]byte, interface{}) error
// DecodeWithLength a bytes from a reader with a varint length prefix. The interface must be a pointer to the

View File

@ -1,7 +1,6 @@
package encoder
import (
"bytes"
"fmt"
"io"
"sync"
@ -113,23 +112,6 @@ func (e SszNetworkEncoder) doDecode(b []byte, to interface{}) error {
return ssz.Unmarshal(b, to)
}
// Decode the bytes to the protobuf message provided.
func (e SszNetworkEncoder) Decode(b []byte, to interface{}) error {
if e.UseSnappyCompression {
newBuffer := bytes.NewBuffer(b)
r := newBufferedReader(newBuffer)
defer bufReaderPool.Put(r)
newObj := make([]byte, len(b))
numOfBytes, err := r.Read(newObj)
if err != nil {
return err
}
return e.doDecode(newObj[:numOfBytes], to)
}
return e.doDecode(b, to)
}
// DecodeGossip decodes the bytes to the protobuf gossip message provided.
func (e SszNetworkEncoder) DecodeGossip(b []byte, to interface{}) error {
if e.UseSnappyCompression {