try to make goimports happy

pull/3734/head
Peter Chung 4 years ago
parent 9fe7a51efa
commit 1877d8e610
  1. 3
      cmd/harmony/bls.go
  2. 7
      cmd/harmony/flags.go
  3. 10
      cmd/harmony/flags_test.go
  4. 7
      cmd/harmony/main.go
  5. 6
      node/api.go
  6. 4
      node/node.go
  7. 7
      rpc/common/types.go
  8. 1
      rpc/debug.go

@ -2,10 +2,11 @@ package main
import ( import (
"fmt" "fmt"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
"os" "os"
"sync" "sync"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
"github.com/harmony-one/harmony/internal/blsgen" "github.com/harmony-one/harmony/internal/blsgen"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
"github.com/harmony-one/harmony/multibls" "github.com/harmony-one/harmony/multibls"

@ -2,10 +2,11 @@ package main
import ( import (
"fmt" "fmt"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
"strconv" "strconv"
"strings" "strings"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
"github.com/harmony-one/harmony/api/service/legacysync" "github.com/harmony-one/harmony/api/service/legacysync"
"github.com/harmony-one/harmony/internal/cli" "github.com/harmony-one/harmony/internal/cli"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
@ -996,8 +997,8 @@ var (
DefValue: defaultConfig.Log.Verbosity, DefValue: defaultConfig.Log.Verbosity,
} }
verbosePrintsFlag = cli.StringSliceFlag{ verbosePrintsFlag = cli.StringSliceFlag{
Name: "verbose-prints", Name: "verbose-prints",
Usage: "verbose prints, available options: config", Usage: "verbose prints, available options: config",
} }
// TODO: remove context (this shall not be in the log) // TODO: remove context (this shall not be in the log)
logContextIPFlag = cli.StringFlag{ logContextIPFlag = cli.StringFlag{

@ -855,12 +855,12 @@ func TestLogFlags(t *testing.T) {
{ {
args: []string{"--verbose-prints", "config"}, args: []string{"--verbose-prints", "config"},
expConfig: logConfig{ expConfig: logConfig{
Folder: defaultConfig.Log.Folder, Folder: defaultConfig.Log.Folder,
FileName: defaultConfig.Log.FileName, FileName: defaultConfig.Log.FileName,
RotateSize: defaultConfig.Log.RotateSize, RotateSize: defaultConfig.Log.RotateSize,
Verbosity: defaultConfig.Log.Verbosity, Verbosity: defaultConfig.Log.Verbosity,
VerbosePrints: []string{"config"}, VerbosePrints: []string{"config"},
Context: nil, Context: nil,
}, },
}, },
} }

@ -2,8 +2,6 @@ package main
import ( import (
"fmt" "fmt"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
rpc_common "github.com/harmony-one/harmony/rpc/common"
"io/ioutil" "io/ioutil"
"math/big" "math/big"
"math/rand" "math/rand"
@ -18,6 +16,9 @@ import (
"syscall" "syscall"
"time" "time"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
rpc_common "github.com/harmony-one/harmony/rpc/common"
ethCommon "github.com/ethereum/go-ethereum/common" ethCommon "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"
"github.com/harmony-one/bls/ffi/go/bls" "github.com/harmony-one/bls/ffi/go/bls"
@ -207,7 +208,7 @@ func getHarmonyConfig(cmd *cobra.Command) (harmonyconfig.HarmonyConfig, error) {
return config, nil return config, nil
} }
func applyRootFlags(cmd *cobra.Command, config * harmonyconfig.HarmonyConfig) { func applyRootFlags(cmd *cobra.Command, config *harmonyconfig.HarmonyConfig) {
// Misc flags shall be applied first since legacy ip / port is overwritten // Misc flags shall be applied first since legacy ip / port is overwritten
// by new ip / port flags // by new ip / port flags
applyLegacyMiscFlags(cmd, config) applyLegacyMiscFlags(cmd, config)

@ -146,7 +146,7 @@ func (node *Node) GetConsensusInternal() rpc_common.ConsensusInternal {
func (node *Node) GetConfig() rpc_common.Config { func (node *Node) GetConfig() rpc_common.Config {
return rpc_common.Config{ return rpc_common.Config{
HarmonyConfig: node.HarmonyConfig, HarmonyConfig: node.HarmonyConfig,
NodeConfig: *node.NodeConfig, NodeConfig: *node.NodeConfig,
ChainConfig: node.chainConfig, ChainConfig: node.chainConfig,
} }
} }

@ -3,7 +3,6 @@ package node
import ( import (
"context" "context"
"fmt" "fmt"
"github.com/harmony-one/harmony/internal/configs/harmony"
"math/big" "math/big"
"os" "os"
"strings" "strings"
@ -11,6 +10,7 @@ import (
"time" "time"
"github.com/ethereum/go-ethereum/rlp" "github.com/ethereum/go-ethereum/rlp"
"github.com/harmony-one/harmony/internal/configs/harmony"
"github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common"
protobuf "github.com/golang/protobuf/proto" protobuf "github.com/golang/protobuf/proto"
@ -106,7 +106,7 @@ type Node struct {
ContractAddresses []common.Address ContractAddresses []common.Address
// Channel to notify consensus service to really start consensus // Channel to notify consensus service to really start consensus
startConsensus chan struct{} startConsensus chan struct{}
HarmonyConfig harmony.HarmonyConfig HarmonyConfig harmony.HarmonyConfig
// node configuration, including group ID, shard ID, etc // node configuration, including group ID, shard ID, etc
NodeConfig *nodeconfig.ConfigType NodeConfig *nodeconfig.ConfigType
// Chain configuration. // Chain configuration.

@ -2,6 +2,7 @@ package common
import ( import (
"encoding/json" "encoding/json"
harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony"
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" nodeconfig "github.com/harmony-one/harmony/internal/configs/node"
@ -85,6 +86,6 @@ type NodePeerInfo struct {
type Config struct { type Config struct {
HarmonyConfig harmonyconfig.HarmonyConfig HarmonyConfig harmonyconfig.HarmonyConfig
NodeConfig nodeconfig.ConfigType NodeConfig nodeconfig.ConfigType
ChainConfig params.ChainConfig ChainConfig params.ChainConfig
} }

@ -2,6 +2,7 @@ package rpc
import ( import (
"context" "context"
commonRPC "github.com/harmony-one/harmony/rpc/common" commonRPC "github.com/harmony-one/harmony/rpc/common"
"github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/log"

Loading…
Cancel
Save