Skip to content

Commit

Permalink
More renames
Browse files Browse the repository at this point in the history
  • Loading branch information
AeonSw4n committed Jan 29, 2024
1 parent 01f169f commit 60e4116
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -323,17 +323,17 @@ func TestConnectionControllerValidatorInboundDeduplication(t *testing.T) {
node2 = startNode(t, node2)
node3 = startNode(t, node3)

cc2 := node2.Server.GetConnectionController()
require.NoError(t, cc2.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm2 := node2.Server.GetConnectionController()
require.NoError(t, nm2.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
// First wait for node2 to be indexed as a validator by node1.
waitForValidatorConnection(t, node1, node2)
// Now wait for node2 to be re-indexed as a non-validator.
waitForNonValidatorInboundConnectionDynamic(t, node1, node2, true)
waitForNonValidatorOutboundConnection(t, node2, node1)

// Now connect node3 to node1.
cc3 := node3.Server.GetConnectionController()
require.NoError(t, cc3.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm3 := node3.Server.GetConnectionController()
require.NoError(t, nm3.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
// First wait for node3 to be indexed as a validator by node1.
waitForValidatorConnection(t, node1, node3)
// Now wait for node3 to be re-indexed as a non-validator.
Expand Down Expand Up @@ -373,9 +373,9 @@ func TestConnectionControllerNonValidatorConnectorOutbound(t *testing.T) {
}
node1 = startNode(t, node1)

cc := node1.Server.GetConnectionController()
require.NoError(t, cc.CreateNonValidatorOutboundConnection(node5.Listeners[0].Addr().String()))
require.NoError(t, cc.CreateNonValidatorOutboundConnection(node6.Listeners[0].Addr().String()))
nm := node1.Server.GetConnectionController()
require.NoError(t, nm.CreateNonValidatorOutboundConnection(node5.Listeners[0].Addr().String()))
require.NoError(t, nm.CreateNonValidatorOutboundConnection(node6.Listeners[0].Addr().String()))

waitForCountRemoteNodeIndexerHandshakeCompleted(t, node1, 3, 0, 3, 0)
waitForNonValidatorOutboundConnection(t, node1, node2)
Expand Down Expand Up @@ -435,24 +435,24 @@ func TestConnectionControllerNonValidatorConnectorInbound(t *testing.T) {
node10 = startNode(t, node10)

// Connect node1 to node2, node3, node7, and node8.
cc1 := node1.Server.GetConnectionController()
require.NoError(t, cc1.CreateNonValidatorOutboundConnection(node2.Listeners[0].Addr().String()))
require.NoError(t, cc1.CreateNonValidatorOutboundConnection(node3.Listeners[0].Addr().String()))
require.NoError(t, cc1.CreateNonValidatorOutboundConnection(node7.Listeners[0].Addr().String()))
require.NoError(t, cc1.CreateNonValidatorOutboundConnection(node8.Listeners[0].Addr().String()))
nm1 := node1.Server.GetConnectionController()
require.NoError(t, nm1.CreateNonValidatorOutboundConnection(node2.Listeners[0].Addr().String()))
require.NoError(t, nm1.CreateNonValidatorOutboundConnection(node3.Listeners[0].Addr().String()))
require.NoError(t, nm1.CreateNonValidatorOutboundConnection(node7.Listeners[0].Addr().String()))
require.NoError(t, nm1.CreateNonValidatorOutboundConnection(node8.Listeners[0].Addr().String()))
// Connect node4, node5, node6 to node1.
cc4 := node4.Server.GetConnectionController()
require.NoError(t, cc4.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
cc5 := node5.Server.GetConnectionController()
require.NoError(t, cc5.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
cc6 := node6.Server.GetConnectionController()
require.NoError(t, cc6.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm4 := node4.Server.GetConnectionController()
require.NoError(t, nm4.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm5 := node5.Server.GetConnectionController()
require.NoError(t, nm5.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm6 := node6.Server.GetConnectionController()
require.NoError(t, nm6.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))

// Connect node9, node10 to node1.
cc9 := node9.Server.GetConnectionController()
require.NoError(t, cc9.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
cc10 := node10.Server.GetConnectionController()
require.NoError(t, cc10.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm9 := node9.Server.GetConnectionController()
require.NoError(t, nm9.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))
nm10 := node10.Server.GetConnectionController()
require.NoError(t, nm10.CreateNonValidatorOutboundConnection(node1.Listeners[0].Addr().String()))

activeValidatorsMap := getActiveValidatorsMapWithValidatorNodes(t, node1, node2, node3, node4, node5, node6)
setActiveValidators(activeValidatorsMap, node1, node2, node3, node4, node5, node6, node7, node8, node9, node10)
Expand All @@ -473,12 +473,12 @@ func TestConnectionControllerNonValidatorConnectorAddressMgr(t *testing.T) {
node1.Config.MaxInboundPeers = 0

node1 = startNode(t, node1)
cc := node1.Server.GetConnectionController()
na1, err := cc.ConvertIPStringToNetAddress("deso-seed-2.io:17000")
na2, err := cc.ConvertIPStringToNetAddress("deso-seed-3.io:17000")
nm := node1.Server.GetConnectionController()
na1, err := nm.ConvertIPStringToNetAddress("deso-seed-2.io:17000")
na2, err := nm.ConvertIPStringToNetAddress("deso-seed-3.io:17000")
require.NoError(t, err)
cc.AddrMgr.AddAddress(na1, na1)
cc.AddrMgr.AddAddress(na2, na2)
nm.AddrMgr.AddAddress(na1, na1)
nm.AddrMgr.AddAddress(na2, na2)
waitForCountRemoteNodeIndexer(t, node1, 2, 0, 2, 0)
}

Expand Down
Loading

0 comments on commit 60e4116

Please sign in to comment.