Skip to content

Commit

Permalink
more lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
AnieeG committed Dec 3, 2024
1 parent 99e8ee7 commit 394c9e7
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions integration-tests/testsetups/ccip/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -656,10 +656,11 @@ func CreateChainConfigFromNetworks(
networkConfig *ctfconfig.NetworkConfig,
) []devenv.ChainConfig {
evmNetworks := networks.MustGetSelectedNetworkConfig(networkConfig)
networkPvtKeys := make(map[int64][]string)
networkPvtKeys := make(map[uint64][]string)
for _, net := range evmNetworks {
require.Greater(t, len(net.PrivateKeys), 0, "No private keys found for network")
networkPvtKeys[net.ChainID] = net.PrivateKeys
require.GreaterOrEqual(t, net.ChainID, 0, "Negative chain ID")
networkPvtKeys[uint64(net.ChainID)] = net.PrivateKeys

Check failure on line 663 in integration-tests/testsetups/ccip/test_helpers.go

View workflow job for this annotation

GitHub Actions / Lint integration-tests

G115: integer overflow conversion int64 -> uint64 (gosec)
}
type chainDetails struct {
chainId uint64
Expand Down Expand Up @@ -709,13 +710,13 @@ func CreateChainConfigFromNetworks(
var pvtKey *string
// if private keys are provided, use the first private key as deployer key
// otherwise it will try to load the private key from KMS
if len(networkPvtKeys[int64(chainId)]) > 0 {
pvtKey = ptr.Ptr(networkPvtKeys[int64(chainId)][0])
if len(networkPvtKeys[chainId]) > 0 {
pvtKey = ptr.Ptr(networkPvtKeys[chainId][0])
}
require.NoError(t, chainCfg.SetDeployerKey(pvtKey), "Error setting deployer key")
var additionalPvtKeys []string
if len(networkPvtKeys[int64(chainId)]) > 1 {
additionalPvtKeys = networkPvtKeys[int64(chainId)][1:]
if len(networkPvtKeys[chainId]) > 1 {
additionalPvtKeys = networkPvtKeys[chainId][1:]
}
// if no additional private keys are provided, this will set the users to default deployer key
require.NoError(t, chainCfg.SetUsers(additionalPvtKeys), "Error setting users")
Expand Down

0 comments on commit 394c9e7

Please sign in to comment.