Browse Source

fix build

pull/6085/head
Anton Kaliaev 4 years ago
parent
commit
d575f8a38f
3 changed files with 13 additions and 13 deletions
  1. +5
    -5
      test/fuzz/p2p/addrbook/init-corpus/main.go
  2. +2
    -2
      test/fuzz/p2p/pex/init-corpus/main.go
  3. +6
    -6
      test/fuzz/p2p/pex/reactor_receive.go

+ 5
- 5
test/fuzz/p2p/addrbook/init-corpus/main.go View File

@ -34,11 +34,11 @@ func initCorpus(baseDir string) {
// create corpus
privKey := ed25519.GenPrivKey()
addrs := []*p2p.NetAddress{
{ID: p2p.NodeIDFromPubKey(privKey.PubKey()), IP: net.IPv4(0, 0, 0, 0), Port: 0},
{ID: p2p.NodeIDFromPubKey(privKey.PubKey()), IP: net.IPv4(127, 0, 0, 0), Port: 80},
{ID: p2p.NodeIDFromPubKey(privKey.PubKey()), IP: net.IPv4(213, 87, 10, 200), Port: 8808},
{ID: p2p.NodeIDFromPubKey(privKey.PubKey()), IP: net.IPv4(111, 111, 111, 111), Port: 26656},
{ID: p2p.NodeIDFromPubKey(privKey.PubKey()), IP: net.ParseIP("2001:db8::68"), Port: 26656},
{ID: p2p.PubKeyToID(privKey.PubKey()), IP: net.IPv4(0, 0, 0, 0), Port: 0},
{ID: p2p.PubKeyToID(privKey.PubKey()), IP: net.IPv4(127, 0, 0, 0), Port: 80},
{ID: p2p.PubKeyToID(privKey.PubKey()), IP: net.IPv4(213, 87, 10, 200), Port: 8808},
{ID: p2p.PubKeyToID(privKey.PubKey()), IP: net.IPv4(111, 111, 111, 111), Port: 26656},
{ID: p2p.PubKeyToID(privKey.PubKey()), IP: net.ParseIP("2001:db8::68"), Port: 26656},
}
for i, addr := range addrs {


+ 2
- 2
test/fuzz/p2p/pex/init-corpus/main.go View File

@ -42,7 +42,7 @@ func initCorpus(rootDir string) {
privKey := ed25519.GenPrivKey()
addr := fmt.Sprintf(
"%s@%v.%v.%v.%v:26656",
p2p.NodeIDFromPubKey(privKey.PubKey()),
p2p.PubKeyToID(privKey.PubKey()),
rand.Int()%256,
rand.Int()%256,
rand.Int()%256,
@ -55,7 +55,7 @@ func initCorpus(rootDir string) {
// IPv6 addresses
privKey := ed25519.GenPrivKey()
ipv6a, err := p2p.NewNetAddressString(
fmt.Sprintf("%s@[ff02::1:114]:26656", p2p.NodeIDFromPubKey(privKey.PubKey())))
fmt.Sprintf("%s@[ff02::1:114]:26656", p2p.PubKeyToID(privKey.PubKey())))
if err != nil {
log.Fatalf("can't create a new netaddress: %v", err)
}


+ 6
- 6
test/fuzz/p2p/pex/reactor_receive.go View File

@ -56,20 +56,20 @@ func newFuzzPeer() *fuzzPeer {
}
var privKey = ed25519.GenPrivKey()
var nodeID = p2p.NodeIDFromPubKey(privKey.PubKey())
var defaultNodeInfo = p2p.NodeInfo{
var nodeID = p2p.PubKeyToID(privKey.PubKey())
var defaultNodeInfo = p2p.DefaultNodeInfo{
ProtocolVersion: p2p.NewProtocolVersion(
version.P2PProtocol,
version.BlockProtocol,
0,
),
NodeID: nodeID,
ListenAddr: "0.0.0.0:98992",
Moniker: "foo1",
DefaultNodeID: nodeID,
ListenAddr: "0.0.0.0:98992",
Moniker: "foo1",
}
func (fp *fuzzPeer) FlushStop() {}
func (fp *fuzzPeer) ID() p2p.NodeID { return nodeID }
func (fp *fuzzPeer) ID() p2p.ID { return nodeID }
func (fp *fuzzPeer) RemoteIP() net.IP { return net.IPv4(0, 0, 0, 0) }
func (fp *fuzzPeer) RemoteAddr() net.Addr {
return &net.TCPAddr{IP: fp.RemoteIP(), Port: 98991, Zone: ""}


Loading…
Cancel
Save