Skip to content

Commit

Permalink
fix case
Browse files Browse the repository at this point in the history
  • Loading branch information
arturrez committed Nov 22, 2024
1 parent 5986b40 commit 6ea0a79
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions pkg/networkoptions/network_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,27 +51,22 @@ func (n NetworkOption) String() string {
}

func NetworkOptionFromString(s string) NetworkOption {
switch s {
case "Mainnet":
switch {
case s == "Mainnet":
return Mainnet
case "Fuji Testnet":
case s == "Fuji Testnet":
return Fuji
case "Local Network":
case s == "Local Network":
return Local
case "Etna Devnet":
case s == "Etna Devnet":
return EtnaDevnet
case "Devnet":
case s == "Devnet" || strings.Contains(s, "Devnet"):
return Devnet
case "Cluster":
case s == "Cluster" || strings.Contains(s, "Cluster"):
return Cluster
default:
if strings.Contains(s, "Devnet") {
return Devnet
} else if strings.Contains(s, "Cluster") {
return Cluster
}
return Undefined
}
return Undefined
}

type NetworkFlags struct {
Expand Down

0 comments on commit 6ea0a79

Please sign in to comment.