Skip to content

Commit

Permalink
fix all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nisdas committed Oct 5, 2020
1 parent b7a0cf5 commit a5d6fff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions beacon-chain/p2p/fork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) {
genesisTime := time.Now()
genesisValidatorsRoot := make([]byte, 32)
s := &Service{
cfg: &Config{UDPPort: uint(port)},
cfg: &Config{UDPPort: uint(port), LocalIP: ipAddr.String()},
genesisTime: genesisTime,
genesisValidatorsRoot: genesisValidatorsRoot,
}
Expand All @@ -51,6 +51,7 @@ func TestStartDiscv5_DifferentForkDigests(t *testing.T) {
port = 3000 + i
cfg.UDPPort = uint(port)
ipAddr, pkey := createAddrAndPrivKey(t)
cfg.LocalIP = ipAddr.String()

// We give every peer a different genesis validators root, which
// will cause each peer to have a different ForkDigest, preventing
Expand Down Expand Up @@ -116,7 +117,7 @@ func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) {
genesisTime := time.Now()
genesisValidatorsRoot := make([]byte, 32)
s := &Service{
cfg: &Config{UDPPort: uint(port)},
cfg: &Config{UDPPort: uint(port), LocalIP: ipAddr.String()},
genesisTime: genesisTime,
genesisValidatorsRoot: genesisValidatorsRoot,
}
Expand All @@ -136,6 +137,7 @@ func TestStartDiscv5_SameForkDigests_DifferentNextForkData(t *testing.T) {
port = 3000 + i
cfg.UDPPort = uint(port)
ipAddr, pkey := createAddrAndPrivKey(t)
cfg.LocalIP = ipAddr.String()

c := params.BeaconConfig()
nextForkEpoch := uint64(i)
Expand Down
2 changes: 2 additions & 0 deletions beacon-chain/p2p/service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func TestListenForNewNodes(t *testing.T) {
cfg.UDPPort = uint(port)
_, pkey := createAddrAndPrivKey(t)
ipAddr := net.ParseIP("127.0.0.1")
cfg.LocalIP = ipAddr.String()
genesisTime := time.Now()
genesisValidatorsRoot := make([]byte, 32)
s := &Service{
Expand Down Expand Up @@ -164,6 +165,7 @@ func TestListenForNewNodes(t *testing.T) {
h, pkey, ipAddr := createHost(t, port+i)
cfg.UDPPort = uint(port + i)
cfg.TCPPort = uint(port + i)
cfg.LocalIP = ipAddr.String()
s := &Service{
cfg: cfg,
genesisTime: genesisTime,
Expand Down
3 changes: 2 additions & 1 deletion beacon-chain/p2p/subnets_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func TestStartDiscV5_DiscoverPeersWithSubnets(t *testing.T) {
genesisTime := time.Now()
genesisValidatorsRoot := make([]byte, 32)
s := &Service{
cfg: &Config{UDPPort: uint(port)},
cfg: &Config{UDPPort: uint(port), LocalIP: ipAddr.String()},
genesisTime: genesisTime,
genesisValidatorsRoot: genesisValidatorsRoot,
}
Expand All @@ -47,6 +47,7 @@ func TestStartDiscV5_DiscoverPeersWithSubnets(t *testing.T) {
Discv5BootStrapAddr: []string{bootNode.String()},
MaxPeers: 30,
UDPPort: uint(port),
LocalIP: ipAddr.String(),
}
ipAddr, pkey := createAddrAndPrivKey(t)
s = &Service{
Expand Down

0 comments on commit a5d6fff

Please sign in to comment.