Moves flags.go to types and removes utils (#385)

This commit is contained in:
Ivan Martinez 2018-08-07 21:55:04 -04:00 committed by terence tsao
parent 2c88b4770f
commit 956e040739
7 changed files with 13 additions and 23 deletions

View File

@ -9,7 +9,7 @@ go_library(
visibility = ["//client:__subpackages__"],
deps = [
"//client/node:go_default_library",
"//client/utils:go_default_library",
"//client/types:go_default_library",
"//shared/cmd:go_default_library",
"//shared/debug:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
@ -28,7 +28,7 @@ go_image(
visibility = ["//visibility:private"],
deps = [
"//client/node:go_default_library",
"//client/utils:go_default_library",
"//client/types:go_default_library",
"//shared/cmd:go_default_library",
"//shared/debug:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",

View File

@ -5,7 +5,7 @@ import (
"runtime"
"github.com/prysmaticlabs/prysm/client/node"
"github.com/prysmaticlabs/prysm/client/utils"
"github.com/prysmaticlabs/prysm/client/types"
"github.com/prysmaticlabs/prysm/shared/cmd"
"github.com/prysmaticlabs/prysm/shared/debug"
"github.com/sirupsen/logrus"
@ -54,7 +54,7 @@ VERSION:
app.Usage = `launches a sharding client that interacts with a beacon chain, starts proposer services, shardp2p connections, and more
`
app.Action = startNode
app.Flags = []cli.Flag{utils.ActorFlag, utils.BeaconRPCProviderFlag, cmd.VerbosityFlag, cmd.DataDirFlag, cmd.PasswordFileFlag, cmd.NetworkIDFlag, cmd.IPCPathFlag, cmd.RPCProviderFlag, utils.DepositFlag, utils.ShardIDFlag, debug.PProfFlag, debug.PProfAddrFlag, debug.PProfPortFlag, debug.MemProfileRateFlag, debug.CPUProfileFlag, debug.TraceFlag}
app.Flags = []cli.Flag{types.ActorFlag, types.BeaconRPCProviderFlag, cmd.VerbosityFlag, cmd.DataDirFlag, cmd.PasswordFileFlag, cmd.NetworkIDFlag, cmd.IPCPathFlag, cmd.RPCProviderFlag, types.DepositFlag, types.ShardIDFlag, debug.PProfFlag, debug.PProfAddrFlag, debug.PProfPortFlag, debug.MemProfileRateFlag, debug.CPUProfileFlag, debug.TraceFlag}
app.Before = func(ctx *cli.Context) error {
runtime.GOMAXPROCS(runtime.NumCPU())

View File

@ -14,7 +14,7 @@ go_library(
"//client/rpcclient:go_default_library",
"//client/syncer:go_default_library",
"//client/txpool:go_default_library",
"//client/utils:go_default_library",
"//client/types:go_default_library",
"//shared:go_default_library",
"//shared/cmd:go_default_library",
"//shared/database:go_default_library",

View File

@ -21,7 +21,7 @@ import (
"github.com/prysmaticlabs/prysm/client/rpcclient"
"github.com/prysmaticlabs/prysm/client/syncer"
"github.com/prysmaticlabs/prysm/client/txpool"
"github.com/prysmaticlabs/prysm/client/utils"
"github.com/prysmaticlabs/prysm/client/types"
"github.com/prysmaticlabs/prysm/shared"
"github.com/prysmaticlabs/prysm/shared/cmd"
"github.com/prysmaticlabs/prysm/shared/database"
@ -72,12 +72,12 @@ func New(ctx *cli.Context) (*ShardEthereum, error) {
return nil, err
}
actorFlag := ctx.GlobalString(utils.ActorFlag.Name)
actorFlag := ctx.GlobalString(types.ActorFlag.Name)
if err := shardEthereum.registerTXPool(actorFlag); err != nil {
return nil, err
}
shardIDFlag := ctx.GlobalInt(utils.ShardIDFlag.Name)
shardIDFlag := ctx.GlobalInt(types.ShardIDFlag.Name)
if err := shardEthereum.registerSyncerService(shardEthereum.shardConfig, shardIDFlag); err != nil {
return nil, err
}
@ -175,7 +175,7 @@ func (s *ShardEthereum) registerMainchainClient(ctx *cli.Context) error {
endpoint = ctx.GlobalString(cmd.IPCPathFlag.Name)
}
passwordFile := ctx.GlobalString(cmd.PasswordFileFlag.Name)
depositFlag := ctx.GlobalBool(utils.DepositFlag.Name)
depositFlag := ctx.GlobalBool(types.DepositFlag.Name)
client, err := mainchain.NewSMCClient(endpoint, path, depositFlag, passwordFile)
if err != nil {
@ -265,7 +265,7 @@ func (s *ShardEthereum) registerSyncerService(config *params.Config, shardID int
}
func (s *ShardEthereum) registerBeaconRPCService(ctx *cli.Context) error {
endpoint := ctx.GlobalString(utils.BeaconRPCProviderFlag.Name)
endpoint := ctx.GlobalString(types.BeaconRPCProviderFlag.Name)
rpcService := rpcclient.NewRPCClient(context.TODO(), &rpcclient.Config{
Endpoint: endpoint,
})

View File

@ -4,6 +4,7 @@ go_library(
name = "go_default_library",
srcs = [
"collation.go",
"flags.go",
"interfaces.go",
"shard.go",
],
@ -19,6 +20,7 @@ go_library(
"@com_github_ethereum_go_ethereum//rlp:go_default_library",
"@com_github_sirupsen_logrus//:go_default_library",
"@com_github_syndtr_goleveldb//leveldb/errors:go_default_library",
"@com_github_urfave_cli//:go_default_library",
],
)

View File

@ -1,4 +1,4 @@
package utils
package types
import (
"math/big"

View File

@ -1,12 +0,0 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")
go_library(
name = "go_default_library",
srcs = ["flags.go"],
importpath = "github.com/prysmaticlabs/prysm/client/utils",
visibility = ["//client:__subpackages__"],
deps = [
"//client/params:go_default_library",
"@com_github_urfave_cli//:go_default_library",
],
)