cmd/puppeth: fix typos and review suggestions

This commit is contained in:
Péter Szilágyi 2017-11-23 14:22:59 +02:00
parent b169a309f9
commit a3a2c6b0d9
No known key found for this signature in database
GPG Key ID: E9AE538CEDF8293D
13 changed files with 19 additions and 25 deletions

View File

@ -696,7 +696,7 @@ type dashboardInfos struct {
faucet string faucet string
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *dashboardInfos) Report() map[string]string { func (info *dashboardInfos) Report() map[string]string {
return map[string]string{ return map[string]string{

View File

@ -115,7 +115,7 @@ type ethstatsInfos struct {
banned []string banned []string
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *ethstatsInfos) Report() map[string]string { func (info *ethstatsInfos) Report() map[string]string {
return map[string]string{ return map[string]string{

View File

@ -155,7 +155,7 @@ type explorerInfos struct {
webPort int webPort int
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *explorerInfos) Report() map[string]string { func (info *explorerInfos) Report() map[string]string {
report := map[string]string{ report := map[string]string{

View File

@ -150,7 +150,7 @@ type faucetInfos struct {
captchaSecret string captchaSecret string
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *faucetInfos) Report() map[string]string { func (info *faucetInfos) Report() map[string]string {
report := map[string]string{ report := map[string]string{

View File

@ -92,7 +92,7 @@ type nginxInfos struct {
port int port int
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *nginxInfos) Report() map[string]string { func (info *nginxInfos) Report() map[string]string {
return map[string]string{ return map[string]string{

View File

@ -170,7 +170,7 @@ type nodeInfos struct {
gasPrice float64 gasPrice float64
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *nodeInfos) Report() map[string]string { func (info *nodeInfos) Report() map[string]string {
report := map[string]string{ report := map[string]string{

View File

@ -138,7 +138,7 @@ type walletInfos struct {
webPort int webPort int
} }
// Report converts the typed struct into a plain string->string map, cotnaining // Report converts the typed struct into a plain string->string map, containing
// most - but not all - fields for reporting to the user. // most - but not all - fields for reporting to the user.
func (info *walletInfos) Report() map[string]string { func (info *walletInfos) Report() map[string]string {
report := map[string]string{ report := map[string]string{

View File

@ -33,16 +33,15 @@ func (w *wizard) deployDashboard() {
client := w.servers[server] client := w.servers[server]
// Retrieve any active dashboard configurations from the server // Retrieve any active dashboard configurations from the server
existed := true
infos, err := checkDashboard(client, w.network) infos, err := checkDashboard(client, w.network)
if err != nil { if err != nil {
infos = &dashboardInfos{ infos = &dashboardInfos{
port: 80, port: 80,
host: client.server, host: client.server,
} }
existed = false
} }
existed := err == nil
// Figure out which port to listen on // Figure out which port to listen on
fmt.Println() fmt.Println()
fmt.Printf("Which port should the dashboard listen on? (default = %d)\n", infos.port) fmt.Printf("Which port should the dashboard listen on? (default = %d)\n", infos.port)

View File

@ -34,8 +34,6 @@ func (w *wizard) deployEthstats() {
client := w.servers[server] client := w.servers[server]
// Retrieve any active ethstats configurations from the server // Retrieve any active ethstats configurations from the server
existed := true
infos, err := checkEthstats(client, w.network) infos, err := checkEthstats(client, w.network)
if err != nil { if err != nil {
infos = &ethstatsInfos{ infos = &ethstatsInfos{
@ -43,8 +41,9 @@ func (w *wizard) deployEthstats() {
host: client.server, host: client.server,
secret: "", secret: "",
} }
existed = false
} }
existed := err == nil
// Figure out which port to listen on // Figure out which port to listen on
fmt.Println() fmt.Println()
fmt.Printf("Which port should ethstats listen on? (default = %d)\n", infos.port) fmt.Printf("Which port should ethstats listen on? (default = %d)\n", infos.port)

View File

@ -47,15 +47,14 @@ func (w *wizard) deployExplorer() {
client := w.servers[server] client := w.servers[server]
// Retrieve any active node configurations from the server // Retrieve any active node configurations from the server
existed := true
infos, err := checkExplorer(client, w.network) infos, err := checkExplorer(client, w.network)
if err != nil { if err != nil {
infos = &explorerInfos{ infos = &explorerInfos{
nodePort: 30303, webPort: 80, webHost: client.server, nodePort: 30303, webPort: 80, webHost: client.server,
} }
existed = false
} }
existed := err == nil
chainspec, err := newParityChainSpec(w.network, w.conf.Genesis, w.conf.bootFull) chainspec, err := newParityChainSpec(w.network, w.conf.Genesis, w.conf.bootFull)
if err != nil { if err != nil {
log.Error("Failed to create chain spec for explorer", "err", err) log.Error("Failed to create chain spec for explorer", "err", err)

View File

@ -35,8 +35,6 @@ func (w *wizard) deployFaucet() {
client := w.servers[server] client := w.servers[server]
// Retrieve any active faucet configurations from the server // Retrieve any active faucet configurations from the server
existed := true
infos, err := checkFaucet(client, w.network) infos, err := checkFaucet(client, w.network)
if err != nil { if err != nil {
infos = &faucetInfos{ infos = &faucetInfos{
@ -47,8 +45,9 @@ func (w *wizard) deployFaucet() {
minutes: 1440, minutes: 1440,
tiers: 3, tiers: 3,
} }
existed = false
} }
existed := err == nil
infos.node.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ") infos.node.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
infos.node.network = w.conf.Genesis.Config.ChainId.Int64() infos.node.network = w.conf.Genesis.Config.ChainId.Int64()

View File

@ -45,8 +45,6 @@ func (w *wizard) deployNode(boot bool) {
client := w.servers[server] client := w.servers[server]
// Retrieve any active node configurations from the server // Retrieve any active node configurations from the server
existed := true
infos, err := checkNode(client, w.network, boot) infos, err := checkNode(client, w.network, boot)
if err != nil { if err != nil {
if boot { if boot {
@ -54,8 +52,9 @@ func (w *wizard) deployNode(boot bool) {
} else { } else {
infos = &nodeInfos{portFull: 30303, peersTotal: 50, peersLight: 0, gasTarget: 4.7, gasPrice: 18} infos = &nodeInfos{portFull: 30303, peersTotal: 50, peersLight: 0, gasTarget: 4.7, gasPrice: 18}
} }
existed = false
} }
existed := err == nil
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ") infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
infos.network = w.conf.Genesis.Config.ChainId.Int64() infos.network = w.conf.Genesis.Config.ChainId.Int64()

View File

@ -43,15 +43,14 @@ func (w *wizard) deployWallet() {
client := w.servers[server] client := w.servers[server]
// Retrieve any active node configurations from the server // Retrieve any active node configurations from the server
existed := true
infos, err := checkWallet(client, w.network) infos, err := checkWallet(client, w.network)
if err != nil { if err != nil {
infos = &walletInfos{ infos = &walletInfos{
nodePort: 30303, rpcPort: 8545, webPort: 80, webHost: client.server, nodePort: 30303, rpcPort: 8545, webPort: 80, webHost: client.server,
} }
existed = false
} }
existed := err == nil
infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ") infos.genesis, _ = json.MarshalIndent(w.conf.Genesis, "", " ")
infos.network = w.conf.Genesis.Config.ChainId.Int64() infos.network = w.conf.Genesis.Config.ChainId.Int64()