Skip to content

Commit

Permalink
- fixes after review
Browse files Browse the repository at this point in the history
  • Loading branch information
iulianpascalau committed Jul 4, 2023
1 parent 8189d3c commit 38ba79c
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:
name: Unit tests without race detector
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20.3
- name: Set up Go 1.20.5
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.20.5
id: go

- name: Check out code
Expand All @@ -29,10 +29,10 @@ jobs:
name: Unit tests with race detector
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.20.3
- name: Set up Go 1.20.5
uses: actions/setup-go@v3
with:
go-version: 1.20.3
go-version: 1.20.5
id: go

- name: Check out code
Expand Down
3 changes: 3 additions & 0 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ const NormalOperation NodeOperation = "normal operation"
const FullArchiveMode NodeOperation = "full archive mode"

const (
// LocalHostListenAddrWithIp4AndTcp defines the local host listening ip v.4 address and TCP
LocalHostListenAddrWithIp4AndTcp = "/ip4/127.0.0.1/tcp/%d"

displayLastPidChars = 12

// ListsSharder is the variant that uses lists
Expand Down
4 changes: 2 additions & 2 deletions integrationTests/peerConnections/peerConnections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func TestPeerConnectionsOnAllSupportedProtocolsShouldExchangeData(t *testing.T)
seederArgs := createBaseArgs()
seederArgs.P2pConfig.Node.Transports = config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
QUICAddress: "/ip4/127.0.0.1/udp/%d/quic-v1",
WebSocketAddress: "/ip4/127.0.0.1/tcp/%d/ws",
Expand All @@ -71,7 +71,7 @@ func TestPeerConnectionsOnAllSupportedProtocolsShouldExchangeData(t *testing.T)
tcpPeerArgs := createBaseArgs()
tcpPeerArgs.P2pConfig.Node.Transports = config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
}
tcpPeer, err := libp2p.NewNetworkMessenger(tcpPeerArgs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func createDefaultConfig() config.P2PConfig {
Node: config.NodeConfig{
Transports: config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions integrationTests/testCommon.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func createP2PConfig(initialPeerList []string) config.P2PConfig {
Port: "0",
Transports: config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
},
},
Expand Down Expand Up @@ -169,7 +169,7 @@ func createP2PConfigWithNoDiscovery() config.P2PConfig {
Port: "0",
Transports: config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
},
},
Expand Down
2 changes: 1 addition & 1 deletion libp2p/goroutines/goroutines_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func createDefaultConfig() config.P2PConfig {
Node: config.NodeConfig{
Transports: config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
},
Port: "0",
Expand Down
3 changes: 0 additions & 3 deletions libp2p/netMessenger.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,6 @@ import (
)

const (
// TestListenAddrWithIp4AndTcp defines the local host listening ip v.4 address and TCP used in testing
TestListenAddrWithIp4AndTcp = "/ip4/127.0.0.1/tcp/%d"

// DirectSendID represents the protocol ID for sending and receiving direct P2P messages
DirectSendID = protocol.ID("/erd/directsend/1.0.0")

Expand Down
8 changes: 4 additions & 4 deletions libp2p/netMessenger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func prepareMessengerForMatchDataReceive(messenger p2p.Messenger, matchData []by
}

// do not print the message.Data() or matchData as the test TestLibp2pMessenger_BroadcastDataBetween2PeersWithLargeMsgShouldWork
// will cause disruption on the github action page
// will cause disruption on the GitHub action page

wg.Done()

Expand All @@ -106,7 +106,7 @@ func getConnectableAddress(messenger p2p.Messenger) string {
func createTestTCPTransportConfig() config.TransportConfig {
return config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
},
}
}
Expand Down Expand Up @@ -2215,7 +2215,7 @@ func TestParseTransportOptions(t *testing.T) {
options, addresses, err := libp2p.ParseTransportOptions(
config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
PreventPortReuse: true,
},
}, 100)
Expand All @@ -2228,7 +2228,7 @@ func TestParseTransportOptions(t *testing.T) {
options, addresses, err := libp2p.ParseTransportOptions(
config.TransportConfig{
TCP: config.TCPProtocolConfig{
ListenAddress: libp2p.TestListenAddrWithIp4AndTcp,
ListenAddress: p2p.LocalHostListenAddrWithIp4AndTcp,
PreventPortReuse: false,
},
}, 100)
Expand Down

0 comments on commit 38ba79c

Please sign in to comment.