p2p: move rlpx into separate package (#21464)

This change moves the RLPx protocol implementation into a separate package,
p2p/rlpx. The new package can be used to establish RLPx connections for
protocol testing purposes.

Co-authored-by: Felix Lange <fjl@twurst.com>
This commit is contained in:
rene
2020-09-22 10:17:39 +02:00
committed by GitHub
parent 2c097bb7a2
commit 129cf075e9
10 changed files with 962 additions and 803 deletions

View File

@ -18,11 +18,9 @@ package p2p
import (
"bytes"
"encoding/hex"
"fmt"
"io"
"runtime"
"strings"
"testing"
"time"
)
@ -141,12 +139,3 @@ func TestEOFSignal(t *testing.T) {
default:
}
}
func unhex(str string) []byte {
r := strings.NewReplacer("\t", "", " ", "", "\n", "")
b, err := hex.DecodeString(r.Replace(str))
if err != nil {
panic(fmt.Sprintf("invalid hex string: %q", str))
}
return b
}