Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Michael Kaplan <[email protected]>
Signed-off-by: F. Eugene Aumson <[email protected]>
  • Loading branch information
feuGeneA and michaelkaplan13 authored Jul 12, 2024
1 parent 956420b commit af0cdde
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/flows/teleporter_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,8 @@ func TeleporterRegistry(network interfaces.LocalNetwork) {
chainConfigs.Add(subnetAInfo, warpEnabledChainConfigA)

// Restart nodes with new chain config
nodeIDs := network.GetAllNodeIDs()
network.SetChainConfigs(chainConfigs)
network.RestartNodes(ctx, nodeIDs)
network.RestartNodes(ctx, network.GetAllNodeIDs())

// Call addProtocolVersion on subnetB to register the new Teleporter version
utils.AddProtocolVersionAndWaitForAcceptance(
Expand Down
4 changes: 2 additions & 2 deletions tests/local/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func NewLocalNetwork(
ctx := context.Background()
var err error

// declare some extra nodes to be used to add more validators later:
// Create extra nodes to be used to add more validators later
extraNodes := subnetEvmTestUtils.NewTmpnetNodes(extraNodeCount)

f, err := os.CreateTemp(os.TempDir(), "config.json")
Expand Down Expand Up @@ -537,7 +537,7 @@ func (n *LocalNetwork) RestartNodes(ctx context.Context, nodeIDs []ids.NodeID) {
}

func (n *LocalNetwork) SetChainConfigs(chainConfigs map[string]string) {
for chainIdStr, chainConfig := range chainConfigs {
for chainIDStr, chainConfig := range chainConfigs {

Check failure on line 540 in tests/local/network.go

View workflow job for this annotation

GitHub Actions / golangci

chainIDStr declared and not used

Check failure on line 540 in tests/local/network.go

View workflow job for this annotation

GitHub Actions / go-unit-tests

chainIDStr declared and not used

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning test

This definition of chainIDStr is never used.
if chainIdStr == utils.CChainPathSpecifier {

Check failure on line 541 in tests/local/network.go

View workflow job for this annotation

GitHub Actions / golangci

undefined: chainIdStr

Check failure on line 541 in tests/local/network.go

View workflow job for this annotation

GitHub Actions / go-unit-tests

undefined: chainIdStr
var cfg tmpnet.FlagsMap
err := json.Unmarshal([]byte(chainConfig), &cfg)
Expand Down
3 changes: 1 addition & 2 deletions tests/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,7 @@ func InstantiateGenesisTemplate(

scanner := bufio.NewScanner(templateFile)
for scanner.Scan() {
var replaced string
replaced = scanner.Text()
replaced := scanner.Text()
for _, s := range substitutions {
replaced = strings.Replace(replaced, s.Target, s.Value, 1)
}
Expand Down

0 comments on commit af0cdde

Please sign in to comment.