cmd/clef, cmd/geth: use SplitAndTrim from cmd/utils (#21579)
This commit is contained in:
@ -23,7 +23,6 @@ import (
|
||||
"math/big"
|
||||
"os"
|
||||
"os/signal"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/ethereum/go-ethereum/cmd/utils"
|
||||
@ -840,16 +839,6 @@ func (api *RetestethAPI) ClientVersion(ctx context.Context) (string, error) {
|
||||
return "Geth-" + params.VersionWithCommit(gitCommit, gitDate), nil
|
||||
}
|
||||
|
||||
// splitAndTrim splits input separated by a comma
|
||||
// and trims excessive white space from the substrings.
|
||||
func splitAndTrim(input string) []string {
|
||||
result := strings.Split(input, ",")
|
||||
for i, r := range result {
|
||||
result[i] = strings.TrimSpace(r)
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func retesteth(ctx *cli.Context) error {
|
||||
log.Info("Welcome to retesteth!")
|
||||
// register signer API with server
|
||||
@ -887,8 +876,8 @@ func retesteth(ctx *cli.Context) error {
|
||||
Version: "1.0",
|
||||
},
|
||||
}
|
||||
vhosts := splitAndTrim(ctx.GlobalString(utils.HTTPVirtualHostsFlag.Name))
|
||||
cors := splitAndTrim(ctx.GlobalString(utils.HTTPCORSDomainFlag.Name))
|
||||
vhosts := utils.SplitAndTrim(ctx.GlobalString(utils.HTTPVirtualHostsFlag.Name))
|
||||
cors := utils.SplitAndTrim(ctx.GlobalString(utils.HTTPCORSDomainFlag.Name))
|
||||
|
||||
// register apis and create handler stack
|
||||
srv := rpc.NewServer()
|
||||
|
Reference in New Issue
Block a user