cmd/swarm: fix TestConfigFileOverrides

This commit is contained in:
Janos Guljas 2018-09-28 15:56:42 +02:00
parent c63985d194
commit bf37241eb5
2 changed files with 6 additions and 3 deletions

@ -179,7 +179,9 @@ func cmdLineOverride(currentConfig *bzzapi.Config, ctx *cli.Context) *bzzapi.Con
if err != nil { if err != nil {
utils.Fatalf("invalid cli flag %s: %v", SwarmNetworkIdFlag.Name, err) utils.Fatalf("invalid cli flag %s: %v", SwarmNetworkIdFlag.Name, err)
} }
currentConfig.NetworkID = id if id != 0 {
currentConfig.NetworkID = id
}
} }
if ctx.GlobalIsSet(utils.DataDirFlag.Name) { if ctx.GlobalIsSet(utils.DataDirFlag.Name) {
@ -272,7 +274,9 @@ func envVarsOverride(currentConfig *bzzapi.Config) (config *bzzapi.Config) {
if err != nil { if err != nil {
utils.Fatalf("invalid environment variable %s: %v", SWARM_ENV_NETWORK_ID, err) utils.Fatalf("invalid environment variable %s: %v", SWARM_ENV_NETWORK_ID, err)
} }
currentConfig.NetworkID = id if id != 0 {
currentConfig.NetworkID = id
}
} }
if datadir := os.Getenv(GETH_ENV_DATADIR); datadir != "" { if datadir := os.Getenv(GETH_ENV_DATADIR); datadir != "" {

@ -95,7 +95,6 @@ var (
Name: "bzznetworkid", Name: "bzznetworkid",
Usage: "Network identifier (integer, default 3=swarm testnet)", Usage: "Network identifier (integer, default 3=swarm testnet)",
EnvVar: SWARM_ENV_NETWORK_ID, EnvVar: SWARM_ENV_NETWORK_ID,
Value: 3,
} }
SwarmSwapEnabledFlag = cli.BoolFlag{ SwarmSwapEnabledFlag = cli.BoolFlag{
Name: "swap", Name: "swap",