From 1877d8e6108538004b9102a36c0c172f1b7d3c79 Mon Sep 17 00:00:00 2001 From: Peter Chung Date: Sun, 6 Jun 2021 01:51:14 +0800 Subject: [PATCH] try to make goimports happy --- cmd/harmony/bls.go | 3 ++- cmd/harmony/flags.go | 7 ++++--- cmd/harmony/flags_test.go | 10 +++++----- cmd/harmony/main.go | 7 ++++--- node/api.go | 6 +++--- node/node.go | 4 ++-- rpc/common/types.go | 7 ++++--- rpc/debug.go | 1 + 8 files changed, 25 insertions(+), 20 deletions(-) diff --git a/cmd/harmony/bls.go b/cmd/harmony/bls.go index c4a8f05c8..a43bdb23b 100644 --- a/cmd/harmony/bls.go +++ b/cmd/harmony/bls.go @@ -2,10 +2,11 @@ package main import ( "fmt" - harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" "os" "sync" + harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" + "github.com/harmony-one/harmony/internal/blsgen" nodeconfig "github.com/harmony-one/harmony/internal/configs/node" "github.com/harmony-one/harmony/multibls" diff --git a/cmd/harmony/flags.go b/cmd/harmony/flags.go index b8c922888..40ab16d15 100644 --- a/cmd/harmony/flags.go +++ b/cmd/harmony/flags.go @@ -2,10 +2,11 @@ package main import ( "fmt" - harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" "strconv" "strings" + harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" + "github.com/harmony-one/harmony/api/service/legacysync" "github.com/harmony-one/harmony/internal/cli" nodeconfig "github.com/harmony-one/harmony/internal/configs/node" @@ -996,8 +997,8 @@ var ( DefValue: defaultConfig.Log.Verbosity, } verbosePrintsFlag = cli.StringSliceFlag{ - Name: "verbose-prints", - Usage: "verbose prints, available options: config", + Name: "verbose-prints", + Usage: "verbose prints, available options: config", } // TODO: remove context (this shall not be in the log) logContextIPFlag = cli.StringFlag{ diff --git a/cmd/harmony/flags_test.go b/cmd/harmony/flags_test.go index fa1de9b1f..4accb9ded 100644 --- a/cmd/harmony/flags_test.go +++ b/cmd/harmony/flags_test.go @@ -855,12 +855,12 @@ func TestLogFlags(t *testing.T) { { args: []string{"--verbose-prints", "config"}, expConfig: logConfig{ - Folder: defaultConfig.Log.Folder, - FileName: defaultConfig.Log.FileName, - RotateSize: defaultConfig.Log.RotateSize, - Verbosity: defaultConfig.Log.Verbosity, + Folder: defaultConfig.Log.Folder, + FileName: defaultConfig.Log.FileName, + RotateSize: defaultConfig.Log.RotateSize, + Verbosity: defaultConfig.Log.Verbosity, VerbosePrints: []string{"config"}, - Context: nil, + Context: nil, }, }, } diff --git a/cmd/harmony/main.go b/cmd/harmony/main.go index 40055a081..56364fa48 100644 --- a/cmd/harmony/main.go +++ b/cmd/harmony/main.go @@ -2,8 +2,6 @@ package main import ( "fmt" - harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" - rpc_common "github.com/harmony-one/harmony/rpc/common" "io/ioutil" "math/big" "math/rand" @@ -18,6 +16,9 @@ import ( "syscall" "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" "github.com/ethereum/go-ethereum/log" "github.com/harmony-one/bls/ffi/go/bls" @@ -207,7 +208,7 @@ func getHarmonyConfig(cmd *cobra.Command) (harmonyconfig.HarmonyConfig, error) { 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 // by new ip / port flags applyLegacyMiscFlags(cmd, config) diff --git a/node/api.go b/node/api.go index 47311ac24..253b598ad 100644 --- a/node/api.go +++ b/node/api.go @@ -146,7 +146,7 @@ func (node *Node) GetConsensusInternal() rpc_common.ConsensusInternal { func (node *Node) GetConfig() rpc_common.Config { return rpc_common.Config{ HarmonyConfig: node.HarmonyConfig, - NodeConfig: *node.NodeConfig, - ChainConfig: node.chainConfig, + NodeConfig: *node.NodeConfig, + ChainConfig: node.chainConfig, } -} \ No newline at end of file +} diff --git a/node/node.go b/node/node.go index a36a79cd3..8069d361f 100644 --- a/node/node.go +++ b/node/node.go @@ -3,7 +3,6 @@ package node import ( "context" "fmt" - "github.com/harmony-one/harmony/internal/configs/harmony" "math/big" "os" "strings" @@ -11,6 +10,7 @@ import ( "time" "github.com/ethereum/go-ethereum/rlp" + "github.com/harmony-one/harmony/internal/configs/harmony" "github.com/ethereum/go-ethereum/common" protobuf "github.com/golang/protobuf/proto" @@ -106,7 +106,7 @@ type Node struct { ContractAddresses []common.Address // Channel to notify consensus service to really start consensus startConsensus chan struct{} - HarmonyConfig harmony.HarmonyConfig + HarmonyConfig harmony.HarmonyConfig // node configuration, including group ID, shard ID, etc NodeConfig *nodeconfig.ConfigType // Chain configuration. diff --git a/rpc/common/types.go b/rpc/common/types.go index bd39873d0..6b1e3ce9f 100644 --- a/rpc/common/types.go +++ b/rpc/common/types.go @@ -2,6 +2,7 @@ package common import ( "encoding/json" + harmonyconfig "github.com/harmony-one/harmony/internal/configs/harmony" nodeconfig "github.com/harmony-one/harmony/internal/configs/node" @@ -85,6 +86,6 @@ type NodePeerInfo struct { type Config struct { HarmonyConfig harmonyconfig.HarmonyConfig - NodeConfig nodeconfig.ConfigType - ChainConfig params.ChainConfig -} \ No newline at end of file + NodeConfig nodeconfig.ConfigType + ChainConfig params.ChainConfig +} diff --git a/rpc/debug.go b/rpc/debug.go index 5c199de1c..5cb8bfbc2 100644 --- a/rpc/debug.go +++ b/rpc/debug.go @@ -2,6 +2,7 @@ package rpc import ( "context" + commonRPC "github.com/harmony-one/harmony/rpc/common" "github.com/ethereum/go-ethereum/log"