mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 09:53:48 +00:00
p2p: remove lookupIPFunc test hook and fix lint
This commit is contained in:
parent
163ff70159
commit
e67f38aa29
2 changed files with 3 additions and 12 deletions
|
|
@ -22,12 +22,13 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
|
||||||
"github.com/ethereum/go-ethereum/rlp"
|
|
||||||
"math/bits"
|
"math/bits"
|
||||||
"net"
|
"net"
|
||||||
"net/netip"
|
"net/netip"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/ethereum/go-ethereum/p2p/enr"
|
||||||
|
"github.com/ethereum/go-ethereum/rlp"
|
||||||
)
|
)
|
||||||
|
|
||||||
var errMissingPrefix = errors.New("missing 'enr:' prefix for base64-encoded record")
|
var errMissingPrefix = errors.New("missing 'enr:' prefix for base64-encoded record")
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ package enode
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/ecdsa"
|
"crypto/ecdsa"
|
||||||
"errors"
|
|
||||||
"net"
|
"net"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -28,15 +27,6 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/p2p/enr"
|
"github.com/ethereum/go-ethereum/p2p/enr"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
|
||||||
lookupIPFunc = func(name string) ([]net.IP, error) {
|
|
||||||
if name == "node.example.org" {
|
|
||||||
return []net.IP{{33, 44, 55, 66}}, nil
|
|
||||||
}
|
|
||||||
return nil, errors.New("no such host")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var parseNodeTests = []struct {
|
var parseNodeTests = []struct {
|
||||||
input string
|
input string
|
||||||
wantError string
|
wantError string
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue