diff --git a/p2p/simulations/adapters/exec.go b/p2p/simulations/adapters/exec.go index 22c6b89f9dd9..132c12dc97e8 100644 --- a/p2p/simulations/adapters/exec.go +++ b/p2p/simulations/adapters/exec.go @@ -49,7 +49,7 @@ import ( // current binary as a child process. // // An init hook is used so that the child process executes the node services -// (rather than whataver the main() function would normally do), see the +// (rather than whatever the main() function would normally do), see the // execP2PNode function for more information. type ExecAdapter struct { // BaseDir is the directory under which the data directories for each diff --git a/p2p/simulations/http_test.go b/p2p/simulations/http_test.go index ecd70dd5ef82..72b08345f454 100644 --- a/p2p/simulations/http_test.go +++ b/p2p/simulations/http_test.go @@ -281,6 +281,7 @@ var testServices = adapters.LifecycleConstructors{ } func testHTTPServer(t *testing.T) (*Network, *httptest.Server) { + t.Helper() adapter := adapters.NewSimAdapter(testServices) network := NewNetwork(adapter, &NetworkConfig{ DefaultService: "test", diff --git a/p2p/simulations/mocker_test.go b/p2p/simulations/mocker_test.go index db19f6ab14f4..5a90d445ecd7 100644 --- a/p2p/simulations/mocker_test.go +++ b/p2p/simulations/mocker_test.go @@ -15,7 +15,7 @@ // along with the go-ethereum library. If not, see . // Package simulations simulates p2p networks. -// A mokcer simulates starting and stopping real nodes in a network. +// A mocker simulates starting and stopping real nodes in a network. package simulations import ( @@ -132,13 +132,13 @@ func TestMocker(t *testing.T) { wg.Wait() //check there are nodeCount number of nodes in the network - nodes_info, err := client.GetNodes() + nodesInfo, err := client.GetNodes() if err != nil { t.Fatalf("Could not get nodes list: %s", err) } - if len(nodes_info) != nodeCount { - t.Fatalf("Expected %d number of nodes, got: %d", nodeCount, len(nodes_info)) + if len(nodesInfo) != nodeCount { + t.Fatalf("Expected %d number of nodes, got: %d", nodeCount, len(nodesInfo)) } //stop the mocker @@ -159,12 +159,12 @@ func TestMocker(t *testing.T) { resp.Body.Close() //now the number of nodes in the network should be zero - nodes_info, err = client.GetNodes() + nodesInfo, err = client.GetNodes() if err != nil { t.Fatalf("Could not get nodes list: %s", err) } - if len(nodes_info) != 0 { - t.Fatalf("Expected empty list of nodes, got: %d", len(nodes_info)) + if len(nodesInfo) != 0 { + t.Fatalf("Expected empty list of nodes, got: %d", len(nodesInfo)) } } diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index 916fd1193ddd..06b7cb6606e4 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -457,7 +457,7 @@ func (net *Network) getConn(oneID, otherID discover.NodeID) *Conn { return net.Conns[i] } -// InitConn(one, other) retrieves the connectiton model for the connection between +// InitConn(one, other) retrieves the connection model for the connection between // peers one and other, or creates a new one if it does not exist // the order of nodes does not matter, i.e., Conn(i,j) == Conn(j, i) // it checks if the connection is already up, and if the nodes are running