diff --git a/accounts/usbwallet/hub.go b/accounts/usbwallet/hub.go index f3b19bb541..72c3990b90 100644 --- a/accounts/usbwallet/hub.go +++ b/accounts/usbwallet/hub.go @@ -22,10 +22,10 @@ import ( "sync" "time" + "github.com/karalabe/hid" "github.com/orangeAndSuns/go-ethereum/accounts" "github.com/orangeAndSuns/go-ethereum/event" "github.com/orangeAndSuns/go-ethereum/log" - "github.com/karalabe/hid" ) // LedgerScheme is the protocol scheme prefixing account and wallet URLs. diff --git a/accounts/usbwallet/trezor.go b/accounts/usbwallet/trezor.go index 02287d1262..f87445e33d 100644 --- a/accounts/usbwallet/trezor.go +++ b/accounts/usbwallet/trezor.go @@ -27,13 +27,13 @@ import ( "io" "math/big" + "github.com/golang/protobuf/proto" "github.com/orangeAndSuns/go-ethereum/accounts" "github.com/orangeAndSuns/go-ethereum/accounts/usbwallet/internal/trezor" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/common/hexutil" "github.com/orangeAndSuns/go-ethereum/core/types" "github.com/orangeAndSuns/go-ethereum/log" - "github.com/golang/protobuf/proto" ) // ErrTrezorPINNeeded is returned if opening the trezor requires a PIN code. In diff --git a/accounts/usbwallet/wallet.go b/accounts/usbwallet/wallet.go index af154aa63b..1b67bd0329 100644 --- a/accounts/usbwallet/wallet.go +++ b/accounts/usbwallet/wallet.go @@ -25,12 +25,12 @@ import ( "sync" "time" + "github.com/karalabe/hid" ethereum "github.com/orangeAndSuns/go-ethereum" "github.com/orangeAndSuns/go-ethereum/accounts" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/core/types" "github.com/orangeAndSuns/go-ethereum/log" - "github.com/karalabe/hid" ) // Maximum time between wallet health checks to detect USB unplugs. diff --git a/cmd/geth/config.go b/cmd/geth/config.go index c495d9cec2..8d3ada075d 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -27,13 +27,13 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" "github.com/orangeAndSuns/go-ethereum/cmd/utils" "github.com/orangeAndSuns/go-ethereum/dashboard" "github.com/orangeAndSuns/go-ethereum/eth" "github.com/orangeAndSuns/go-ethereum/node" "github.com/orangeAndSuns/go-ethereum/params" whisper "github.com/orangeAndSuns/go-ethereum/whisper/whisperv6" - "github.com/naoina/toml" ) var ( diff --git a/cmd/geth/monitorcmd.go b/cmd/geth/monitorcmd.go index fe2eefeb93..c96576c230 100644 --- a/cmd/geth/monitorcmd.go +++ b/cmd/geth/monitorcmd.go @@ -25,10 +25,10 @@ import ( "strings" "time" + "github.com/gizak/termui" "github.com/orangeAndSuns/go-ethereum/cmd/utils" "github.com/orangeAndSuns/go-ethereum/node" "github.com/orangeAndSuns/go-ethereum/rpc" - "github.com/gizak/termui" "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/puppeth/wizard_netstats.go b/cmd/puppeth/wizard_netstats.go index b75bea6e4d..e4746e2247 100644 --- a/cmd/puppeth/wizard_netstats.go +++ b/cmd/puppeth/wizard_netstats.go @@ -23,9 +23,9 @@ import ( "strings" "sync" + "github.com/olekukonko/tablewriter" "github.com/orangeAndSuns/go-ethereum/core" "github.com/orangeAndSuns/go-ethereum/log" - "github.com/olekukonko/tablewriter" ) // networkStats verifies the status of network components and generates a protip diff --git a/cmd/swarm/config.go b/cmd/swarm/config.go index 638bc4c786..25ef8853ad 100644 --- a/cmd/swarm/config.go +++ b/cmd/swarm/config.go @@ -29,11 +29,11 @@ import ( cli "gopkg.in/urfave/cli.v1" + "github.com/naoina/toml" "github.com/orangeAndSuns/go-ethereum/cmd/utils" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" - "github.com/naoina/toml" bzzapi "github.com/orangeAndSuns/go-ethereum/swarm/api" ) diff --git a/cmd/swarm/fs_test.go b/cmd/swarm/fs_test.go index 4583dbbbad..e3c4aa5f49 100644 --- a/cmd/swarm/fs_test.go +++ b/cmd/swarm/fs_test.go @@ -28,8 +28,8 @@ import ( "testing" "time" - "github.com/orangeAndSuns/go-ethereum/log" colorable "github.com/mattn/go-colorable" + "github.com/orangeAndSuns/go-ethereum/log" ) func init() { diff --git a/cmd/swarm/swarm-smoke/main.go b/cmd/swarm/swarm-smoke/main.go index 290b720a88..9b6168776d 100644 --- a/cmd/swarm/swarm-smoke/main.go +++ b/cmd/swarm/swarm-smoke/main.go @@ -20,8 +20,8 @@ import ( "os" "sort" - "github.com/orangeAndSuns/go-ethereum/log" colorable "github.com/mattn/go-colorable" + "github.com/orangeAndSuns/go-ethereum/log" cli "gopkg.in/urfave/cli.v1" ) diff --git a/cmd/swarm/upload_test.go b/cmd/swarm/upload_test.go index f71320a0b3..2e3ffc689a 100644 --- a/cmd/swarm/upload_test.go +++ b/cmd/swarm/upload_test.go @@ -30,9 +30,9 @@ import ( "testing" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/log" swarm "github.com/orangeAndSuns/go-ethereum/swarm/api/client" - colorable "github.com/mattn/go-colorable" ) var loglevel = flag.Int("loglevel", 3, "verbosity of logs") diff --git a/consensus/clique/clique.go b/consensus/clique/clique.go index ddc3b0bf56..f5bf0307f9 100644 --- a/consensus/clique/clique.go +++ b/consensus/clique/clique.go @@ -25,6 +25,7 @@ import ( "sync" "time" + lru "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/accounts" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/common/hexutil" @@ -39,7 +40,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/params" "github.com/orangeAndSuns/go-ethereum/rlp" "github.com/orangeAndSuns/go-ethereum/rpc" - lru "github.com/hashicorp/golang-lru" ) const ( diff --git a/consensus/clique/snapshot.go b/consensus/clique/snapshot.go index 2745b4060b..dc5a797224 100644 --- a/consensus/clique/snapshot.go +++ b/consensus/clique/snapshot.go @@ -21,11 +21,11 @@ import ( "encoding/json" "sort" + lru "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/core/types" "github.com/orangeAndSuns/go-ethereum/ethdb" "github.com/orangeAndSuns/go-ethereum/params" - lru "github.com/hashicorp/golang-lru" ) // Vote represents a single vote that an authorized signer made to modify the diff --git a/consensus/ethash/ethash.go b/consensus/ethash/ethash.go index 7a1900d31b..b24f04b4f5 100644 --- a/consensus/ethash/ethash.go +++ b/consensus/ethash/ethash.go @@ -33,11 +33,11 @@ import ( "unsafe" mmap "github.com/edsrzf/mmap-go" + "github.com/hashicorp/golang-lru/simplelru" "github.com/orangeAndSuns/go-ethereum/consensus" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/rpc" - "github.com/hashicorp/golang-lru/simplelru" ) var ErrInvalidDumpMagic = errors.New("invalid dump magic") diff --git a/console/console.go b/console/console.go index 5c83391e11..ebebdf819f 100644 --- a/console/console.go +++ b/console/console.go @@ -28,10 +28,10 @@ import ( "strings" "syscall" + "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/internal/jsre" "github.com/orangeAndSuns/go-ethereum/internal/web3ext" "github.com/orangeAndSuns/go-ethereum/rpc" - "github.com/mattn/go-colorable" "github.com/peterh/liner" "github.com/robertkrimen/otto" ) diff --git a/core/blockchain.go b/core/blockchain.go index e79351e5d4..a351441380 100644 --- a/core/blockchain.go +++ b/core/blockchain.go @@ -27,6 +27,7 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/common/mclock" "github.com/orangeAndSuns/go-ethereum/consensus" @@ -42,7 +43,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/params" "github.com/orangeAndSuns/go-ethereum/rlp" "github.com/orangeAndSuns/go-ethereum/trie" - "github.com/hashicorp/golang-lru" "gopkg.in/karalabe/cookiejar.v2/collections/prque" ) diff --git a/core/headerchain.go b/core/headerchain.go index f770104685..3605face09 100644 --- a/core/headerchain.go +++ b/core/headerchain.go @@ -26,6 +26,7 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/consensus" "github.com/orangeAndSuns/go-ethereum/core/rawdb" @@ -33,7 +34,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/ethdb" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/params" - "github.com/hashicorp/golang-lru" ) const ( diff --git a/core/state/database.go b/core/state/database.go index ee1ee4b653..4fdd7f4d6c 100644 --- a/core/state/database.go +++ b/core/state/database.go @@ -20,10 +20,10 @@ import ( "fmt" "sync" + lru "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/ethdb" "github.com/orangeAndSuns/go-ethereum/trie" - lru "github.com/hashicorp/golang-lru" ) // Trie cache generation limit after which to evict trie nodes from memory. diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 2161db9fe4..b40cac62fa 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -35,12 +35,12 @@ import ( "io" "github.com/elastic/gosigar" + "github.com/mohae/deepcopy" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/p2p" "github.com/orangeAndSuns/go-ethereum/params" "github.com/orangeAndSuns/go-ethereum/rpc" - "github.com/mohae/deepcopy" "golang.org/x/net/websocket" ) diff --git a/dashboard/log.go b/dashboard/log.go index 881b047015..318180807f 100644 --- a/dashboard/log.go +++ b/dashboard/log.go @@ -26,8 +26,8 @@ import ( "sort" "time" - "github.com/orangeAndSuns/go-ethereum/log" "github.com/mohae/deepcopy" + "github.com/orangeAndSuns/go-ethereum/log" "github.com/rjeczalik/notify" ) diff --git a/internal/debug/flags.go b/internal/debug/flags.go index a26776259b..4ce6e721ad 100644 --- a/internal/debug/flags.go +++ b/internal/debug/flags.go @@ -24,12 +24,12 @@ import ( "os" "runtime" + "github.com/fjl/memsize/memsizeui" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/log/term" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/metrics/exp" - "github.com/fjl/memsize/memsizeui" - colorable "github.com/mattn/go-colorable" "gopkg.in/urfave/cli.v1" ) diff --git a/light/lightchain.go b/light/lightchain.go index 0da2cf7fe9..1162f46801 100644 --- a/light/lightchain.go +++ b/light/lightchain.go @@ -24,6 +24,7 @@ import ( "sync/atomic" "time" + "github.com/hashicorp/golang-lru" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/consensus" "github.com/orangeAndSuns/go-ethereum/core" @@ -35,7 +36,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/params" "github.com/orangeAndSuns/go-ethereum/rlp" - "github.com/hashicorp/golang-lru" ) var ( diff --git a/metrics/influxdb/influxdb.go b/metrics/influxdb/influxdb.go index 6a82f6b5a0..d73a56bf09 100644 --- a/metrics/influxdb/influxdb.go +++ b/metrics/influxdb/influxdb.go @@ -5,9 +5,9 @@ import ( uurl "net/url" "time" + "github.com/influxdata/influxdb/client" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/metrics" - "github.com/influxdata/influxdb/client" ) type reporter struct { diff --git a/p2p/dial_test.go b/p2p/dial_test.go index 99766f1177..7d18b09fa9 100644 --- a/p2p/dial_test.go +++ b/p2p/dial_test.go @@ -78,11 +78,11 @@ func runDialTest(t *testing.T, test dialtest) { type fakeTable []*discover.Node -func (t fakeTable) Self() *discover.Node { return new(discover.Node) } -func (t fakeTable) Close() {} -func (t fakeTable) Lookup(discover.ESSNodeID) []*discover.Node { return nil } -func (t fakeTable) Resolve(discover.ESSNodeID) *discover.Node { return nil } -func (t fakeTable) ReadRandomNodes(buf []*discover.Node) int { return copy(buf, t) } +func (t fakeTable) Self() *discover.Node { return new(discover.Node) } +func (t fakeTable) Close() {} +func (t fakeTable) Lookup(discover.ESSNodeID) []*discover.Node { return nil } +func (t fakeTable) Resolve(discover.ESSNodeID) *discover.Node { return nil } +func (t fakeTable) ReadRandomNodes(buf []*discover.Node) int { return copy(buf, t) } // This test checks that dynamic dials are launched from discovery results. func TestDialStateDynDial(t *testing.T) { @@ -689,8 +689,8 @@ func (t *resolveMock) Resolve(id discover.ESSNodeID) *discover.Node { return t.answer } -func (t *resolveMock) Self() *discover.Node { return new(discover.Node) } -func (t *resolveMock) Close() {} -func (t *resolveMock) Bootstrap([]*discover.Node) {} -func (t *resolveMock) Lookup(discover.ESSNodeID) []*discover.Node { return nil } -func (t *resolveMock) ReadRandomNodes(buf []*discover.Node) int { return 0 } +func (t *resolveMock) Self() *discover.Node { return new(discover.Node) } +func (t *resolveMock) Close() {} +func (t *resolveMock) Bootstrap([]*discover.Node) {} +func (t *resolveMock) Lookup(discover.ESSNodeID) []*discover.Node { return nil } +func (t *resolveMock) ReadRandomNodes(buf []*discover.Node) int { return 0 } diff --git a/p2p/discover/database.go b/p2p/discover/database.go index 7941d18da9..6362212d55 100644 --- a/p2p/discover/database.go +++ b/p2p/discover/database.go @@ -39,7 +39,7 @@ import ( ) var ( - nodeDBNilESSNodeID = ESSNodeID{} // Special node ID to use as a nil element. + nodeDBNilESSNodeID = ESSNodeID{} // Special node ID to use as a nil element. nodeDBNodeExpiration = 24 * time.Hour // Time after which an unseen node should be dropped. nodeDBCleanupCycle = time.Hour // Time period for running the expiration task. nodeDBVersion = 5 @@ -48,7 +48,7 @@ var ( // nodeDB stores all nodes we know about. type nodeDB struct { lvl *leveldb.DB // Interface to the database itself - self ESSNodeID // Own node id to prevent adding it into the database + self ESSNodeID // Own node id to prevent adding it into the database runner sync.Once // Ensures we can start at most one expirer quit chan struct{} // Channel to signal the expiring thread to stop } diff --git a/p2p/discover/node.go b/p2p/discover/node.go index 3315356f87..4260ba0c7f 100644 --- a/p2p/discover/node.go +++ b/p2p/discover/node.go @@ -41,8 +41,8 @@ const ESSNodeIDBits = 512 // Node represents a host on the network. // The fields of Node may not be modified. type Node struct { - IP net.IP // len 4 for IPv4 or 16 for IPv6 - UDP, TCP uint16 // port numbers + IP net.IP // len 4 for IPv4 or 16 for IPv6 + UDP, TCP uint16 // port numbers ID ESSNodeID // the node's public key // This is a cached copy of sha3(ID) which is used for node diff --git a/p2p/discover/table_test.go b/p2p/discover/table_test.go index c023cfca7d..d980d1ae8b 100644 --- a/p2p/discover/table_test.go +++ b/p2p/discover/table_test.go @@ -570,7 +570,7 @@ func (tn *preminedTestnet) findnode(toid ESSNodeID, toaddr *net.UDPAddr, target return result, nil } -func (*preminedTestnet) close() {} +func (*preminedTestnet) close() {} func (*preminedTestnet) waitping(from ESSNodeID) error { return nil } func (*preminedTestnet) ping(toid ESSNodeID, toaddr *net.UDPAddr) error { return nil } diff --git a/p2p/discv5/database.go b/p2p/discv5/database.go index ab00c4bcc6..09556ce84c 100644 --- a/p2p/discv5/database.go +++ b/p2p/discv5/database.go @@ -40,7 +40,7 @@ import ( ) var ( - nodeDBNilESSNodeID = ESSNodeID{} // Special node ID to use as a nil element. + nodeDBNilESSNodeID = ESSNodeID{} // Special node ID to use as a nil element. nodeDBNodeExpiration = 24 * time.Hour // Time after which an unseen node should be dropped. nodeDBCleanupCycle = time.Hour // Time period for running the expiration task. ) @@ -48,7 +48,7 @@ var ( // nodeDB stores all nodes we know about. type nodeDB struct { lvl *leveldb.DB // Interface to the database itself - self ESSNodeID // Own node id to prevent adding it into the database + self ESSNodeID // Own node id to prevent adding it into the database runner sync.Once // Ensures we can start at most one expirer quit chan struct{} // Channel to signal the expiring thread to stop } diff --git a/p2p/discv5/node.go b/p2p/discv5/node.go index e2423263f0..02a4863cc1 100644 --- a/p2p/discv5/node.go +++ b/p2p/discv5/node.go @@ -37,8 +37,8 @@ import ( // Node represents a host on the network. // The public fields of Node may not be modified. type Node struct { - IP net.IP // len 4 for IPv4 or 16 for IPv6 - UDP, TCP uint16 // port numbers + IP net.IP // len 4 for IPv4 or 16 for IPv6 + UDP, TCP uint16 // port numbers ID ESSNodeID // the node's public key // Network-related fields are contained in nodeNetGuts. diff --git a/p2p/discv5/table_test.go b/p2p/discv5/table_test.go index aac339d18d..2249e26be9 100644 --- a/p2p/discv5/table_test.go +++ b/p2p/discv5/table_test.go @@ -35,7 +35,7 @@ type nullTransport struct{} func (nullTransport) sendPing(remote *Node, remoteAddr *net.UDPAddr) []byte { return []byte{1} } func (nullTransport) sendPong(remote *Node, pingHash []byte) {} -func (nullTransport) sendFindnode(remote *Node, target ESSNodeID) {} +func (nullTransport) sendFindnode(remote *Node, target ESSNodeID) {} func (nullTransport) sendNeighbours(remote *Node, nodes []*Node) {} func (nullTransport) localAddr() *net.UDPAddr { return new(net.UDPAddr) } func (nullTransport) Close() {} diff --git a/p2p/nat/nat.go b/p2p/nat/nat.go index b22b0ef099..c63e0f84cf 100644 --- a/p2p/nat/nat.go +++ b/p2p/nat/nat.go @@ -25,8 +25,8 @@ import ( "sync" "time" - "github.com/orangeAndSuns/go-ethereum/log" "github.com/jackpal/go-nat-pmp" + "github.com/orangeAndSuns/go-ethereum/log" ) // An implementation of nat.Interface can map local ports to ports diff --git a/p2p/peer.go b/p2p/peer.go index 010c15649b..364e0df79c 100644 --- a/p2p/peer.go +++ b/p2p/peer.go @@ -90,12 +90,12 @@ const ( // PeerEvent is an event emitted when peers are either added or dropped from // a p2p.Server or when a message is sent or received on a peer connection type PeerEvent struct { - Type PeerEventType `json:"type"` + Type PeerEventType `json:"type"` Peer discover.ESSNodeID `json:"peer"` - Error string `json:"error,omitempty"` - Protocol string `json:"protocol,omitempty"` - MsgCode *uint64 `json:"msg_code,omitempty"` - MsgSize *uint32 `json:"msg_size,omitempty"` + Error string `json:"error,omitempty"` + Protocol string `json:"protocol,omitempty"` + MsgCode *uint64 `json:"msg_code,omitempty"` + MsgSize *uint32 `json:"msg_size,omitempty"` } // Peer represents a connected remote node. diff --git a/p2p/protocols/protocol.go b/p2p/protocols/protocol.go index af51333bf0..a9dc50c1eb 100644 --- a/p2p/protocols/protocol.go +++ b/p2p/protocols/protocol.go @@ -38,13 +38,13 @@ import ( "sync" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/p2p" "github.com/orangeAndSuns/go-ethereum/rlp" "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/tracing" - opentracing "github.com/opentracing/opentracing-go" ) // error codes used by this protocol scheme diff --git a/p2p/rlpx.go b/p2p/rlpx.go index b01043a934..bc6e946a3b 100644 --- a/p2p/rlpx.go +++ b/p2p/rlpx.go @@ -35,13 +35,13 @@ import ( "sync" "time" + "github.com/golang/snappy" "github.com/orangeAndSuns/go-ethereum/crypto" "github.com/orangeAndSuns/go-ethereum/crypto/ecies" "github.com/orangeAndSuns/go-ethereum/crypto/secp256k1" "github.com/orangeAndSuns/go-ethereum/crypto/sha3" "github.com/orangeAndSuns/go-ethereum/p2p/discover" "github.com/orangeAndSuns/go-ethereum/rlp" - "github.com/golang/snappy" ) const ( diff --git a/p2p/server.go b/p2p/server.go index 3d83f5a1f2..0e3c659fd9 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -200,10 +200,10 @@ type conn struct { fd net.Conn transport flags connFlag - cont chan error // The run loop uses cont to signal errors to SetupConn. + cont chan error // The run loop uses cont to signal errors to SetupConn. id discover.ESSNodeID // valid after the encryption handshake - caps []Cap // valid after the protocol handshake - name string // valid after the protocol handshake + caps []Cap // valid after the protocol handshake + name string // valid after the protocol handshake } type transport interface { diff --git a/p2p/simulations/http.go b/p2p/simulations/http.go index 1c431b679f..3363804e7a 100644 --- a/p2p/simulations/http.go +++ b/p2p/simulations/http.go @@ -29,12 +29,12 @@ import ( "strings" "sync" + "github.com/julienschmidt/httprouter" "github.com/orangeAndSuns/go-ethereum/event" "github.com/orangeAndSuns/go-ethereum/p2p" "github.com/orangeAndSuns/go-ethereum/p2p/discover" "github.com/orangeAndSuns/go-ethereum/p2p/simulations/adapters" "github.com/orangeAndSuns/go-ethereum/rpc" - "github.com/julienschmidt/httprouter" "golang.org/x/net/websocket" ) diff --git a/p2p/simulations/network.go b/p2p/simulations/network.go index 431b733b52..b57e925242 100644 --- a/p2p/simulations/network.go +++ b/p2p/simulations/network.go @@ -598,9 +598,9 @@ func (c *Conn) String() string { type Msg struct { One discover.ESSNodeID `json:"one"` Other discover.ESSNodeID `json:"other"` - Protocol string `json:"protocol"` - Code uint64 `json:"code"` - Received bool `json:"received"` + Protocol string `json:"protocol"` + Code uint64 `json:"code"` + Received bool `json:"received"` } // String returns a log-friendly string diff --git a/p2p/testing/protocolsession.go b/p2p/testing/protocolsession.go index 5df79c16d4..4a0393c0ab 100644 --- a/p2p/testing/protocolsession.go +++ b/p2p/testing/protocolsession.go @@ -56,25 +56,25 @@ type Exchange struct { // Trigger is part of the exchange, incoming message for the pivot node // sent by a peer type Trigger struct { - Msg interface{} // type of message to be sent - Code uint64 // code of message is given + Msg interface{} // type of message to be sent + Code uint64 // code of message is given Peer discover.ESSNodeID // the peer to send the message to - Timeout time.Duration // timeout duration for the sending + Timeout time.Duration // timeout duration for the sending } // Expect is part of an exchange, outgoing message from the pivot node // received by a peer type Expect struct { - Msg interface{} // type of message to expect - Code uint64 // code of message is now given + Msg interface{} // type of message to expect + Code uint64 // code of message is now given Peer discover.ESSNodeID // the peer that expects the message - Timeout time.Duration // timeout duration for receiving + Timeout time.Duration // timeout duration for receiving } // Disconnect represents a disconnect event, used and checked by TestDisconnected type Disconnect struct { Peer discover.ESSNodeID // discconnected peer - Error error // disconnect reason + Error error // disconnect reason } // trigger sends messages from peers diff --git a/signer/storage/aes_gcm_storage_test.go b/signer/storage/aes_gcm_storage_test.go index 85a6ace9ba..f8eb51da71 100644 --- a/signer/storage/aes_gcm_storage_test.go +++ b/signer/storage/aes_gcm_storage_test.go @@ -22,9 +22,9 @@ import ( "io/ioutil" "testing" + "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/log" - "github.com/mattn/go-colorable" ) func TestEncryption(t *testing.T) { diff --git a/swarm/api/api.go b/swarm/api/api.go index d3bcbfa715..170d12163d 100644 --- a/swarm/api/api.go +++ b/swarm/api/api.go @@ -31,6 +31,7 @@ import ( "path/filepath" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/contracts/ens" "github.com/orangeAndSuns/go-ethereum/core/types" @@ -40,7 +41,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/storage" "github.com/orangeAndSuns/go-ethereum/swarm/storage/mru" - opentracing "github.com/opentracing/opentracing-go" ) var ( diff --git a/swarm/api/config.go b/swarm/api/config.go index d64dab3a0f..4146cac129 100644 --- a/swarm/api/config.go +++ b/swarm/api/config.go @@ -58,7 +58,7 @@ type Config struct { Port string PublicKey string BzzKey string - ESSNodeID string + ESSNodeID string NetworkID uint64 SwapEnabled bool SyncEnabled bool diff --git a/swarm/api/http/server.go b/swarm/api/http/server.go index ec6ad8df58..09b01d199d 100644 --- a/swarm/api/http/server.go +++ b/swarm/api/http/server.go @@ -37,6 +37,7 @@ import ( "strings" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/swarm/api" @@ -44,7 +45,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/storage" "github.com/orangeAndSuns/go-ethereum/swarm/storage/mru" - opentracing "github.com/opentracing/opentracing-go" "github.com/pborman/uuid" "github.com/rs/cors" diff --git a/swarm/network/protocol.go b/swarm/network/protocol.go index f0cb404ef3..52279acd1b 100644 --- a/swarm/network/protocol.go +++ b/swarm/network/protocol.go @@ -80,7 +80,7 @@ type Peer interface { // Conn interface represents an live peer connection type Conn interface { - ID() discover.ESSNodeID // the key that uniquely identifies the Node for the peerPool + ID() discover.ESSNodeID // the key that uniquely identifies the Node for the peerPool Handshake(context.Context, interface{}, func(interface{}) error) (interface{}, error) // can send messages Send(context.Context, interface{}) error // can send messages Drop(error) // disconnect this peer diff --git a/swarm/network/simulation/simulation.go b/swarm/network/simulation/simulation.go index 45912bd02a..cc96e3fc95 100644 --- a/swarm/network/simulation/simulation.go +++ b/swarm/network/simulation/simulation.go @@ -43,13 +43,13 @@ type Simulation struct { // of p2p/simulations.Network. Net *simulations.Network - serviceNames []string - cleanupFuncs []func() - buckets map[discover.ESSNodeID]*sync.Map - pivotESSNodeID *discover.ESSNodeID - shutdownWG sync.WaitGroup - done chan struct{} - mu sync.RWMutex + serviceNames []string + cleanupFuncs []func() + buckets map[discover.ESSNodeID]*sync.Map + pivotESSNodeID *discover.ESSNodeID + shutdownWG sync.WaitGroup + done chan struct{} + mu sync.RWMutex httpSrv *http.Server //attach a HTTP server via SimulationOptions handler *simulations.Server //HTTP handler for the server diff --git a/swarm/network/simulation/simulation_test.go b/swarm/network/simulation/simulation_test.go index 04976ba074..7f1062aa1a 100644 --- a/swarm/network/simulation/simulation_test.go +++ b/swarm/network/simulation/simulation_test.go @@ -24,12 +24,12 @@ import ( "testing" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" "github.com/orangeAndSuns/go-ethereum/p2p" "github.com/orangeAndSuns/go-ethereum/p2p/simulations/adapters" "github.com/orangeAndSuns/go-ethereum/rpc" - colorable "github.com/mattn/go-colorable" ) var ( diff --git a/swarm/network/simulations/discovery/discovery_test.go b/swarm/network/simulations/discovery/discovery_test.go index b35c35e6f8..3d64a490df 100644 --- a/swarm/network/simulations/discovery/discovery_test.go +++ b/swarm/network/simulations/discovery/discovery_test.go @@ -31,6 +31,7 @@ import ( "testing" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" @@ -40,7 +41,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/p2p/simulations/adapters" "github.com/orangeAndSuns/go-ethereum/swarm/network" "github.com/orangeAndSuns/go-ethereum/swarm/state" - colorable "github.com/mattn/go-colorable" ) // serviceName is used with the exec adapter so the exec'd binary knows which diff --git a/swarm/network/simulations/overlay.go b/swarm/network/simulations/overlay.go index 128ec61454..625cd4559a 100644 --- a/swarm/network/simulations/overlay.go +++ b/swarm/network/simulations/overlay.go @@ -27,6 +27,7 @@ import ( "sync" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" "github.com/orangeAndSuns/go-ethereum/p2p/discover" @@ -34,7 +35,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/p2p/simulations/adapters" "github.com/orangeAndSuns/go-ethereum/swarm/network" "github.com/orangeAndSuns/go-ethereum/swarm/state" - colorable "github.com/mattn/go-colorable" ) var ( diff --git a/swarm/network/stream/common_test.go b/swarm/network/stream/common_test.go index f574bc26c5..5fbd914e27 100644 --- a/swarm/network/stream/common_test.go +++ b/swarm/network/stream/common_test.go @@ -29,6 +29,7 @@ import ( "testing" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" @@ -42,7 +43,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/storage" "github.com/orangeAndSuns/go-ethereum/swarm/storage/mock" "github.com/orangeAndSuns/go-ethereum/swarm/storage/mock/db" - colorable "github.com/mattn/go-colorable" ) var ( diff --git a/swarm/network/stream/delivery.go b/swarm/network/stream/delivery.go index eb9ea2f03e..4c8eda2039 100644 --- a/swarm/network/stream/delivery.go +++ b/swarm/network/stream/delivery.go @@ -21,6 +21,7 @@ import ( "errors" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/common" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/p2p/discover" @@ -28,7 +29,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/network" "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/storage" - opentracing "github.com/opentracing/opentracing-go" ) const ( diff --git a/swarm/network/stream/messages.go b/swarm/network/stream/messages.go index 98b1dddac4..81f84e72fa 100644 --- a/swarm/network/stream/messages.go +++ b/swarm/network/stream/messages.go @@ -23,12 +23,12 @@ import ( "sync" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/swarm/log" bv "github.com/orangeAndSuns/go-ethereum/swarm/network/bitvector" "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/storage" - opentracing "github.com/opentracing/opentracing-go" ) // Stream defines a unique stream identifier. diff --git a/swarm/network/stream/peer.go b/swarm/network/stream/peer.go index e36be54621..047daed356 100644 --- a/swarm/network/stream/peer.go +++ b/swarm/network/stream/peer.go @@ -22,6 +22,7 @@ import ( "sync" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/p2p/protocols" "github.com/orangeAndSuns/go-ethereum/swarm/log" @@ -30,7 +31,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/state" "github.com/orangeAndSuns/go-ethereum/swarm/storage" - opentracing "github.com/opentracing/opentracing-go" ) var sendTimeout = 30 * time.Second diff --git a/swarm/network/stream/stream.go b/swarm/network/stream/stream.go index 1daf9690fc..d36138c546 100644 --- a/swarm/network/stream/stream.go +++ b/swarm/network/stream/stream.go @@ -23,6 +23,7 @@ import ( "sync" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/p2p" "github.com/orangeAndSuns/go-ethereum/p2p/discover" @@ -35,7 +36,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" "github.com/orangeAndSuns/go-ethereum/swarm/state" "github.com/orangeAndSuns/go-ethereum/swarm/storage" - opentracing "github.com/opentracing/opentracing-go" ) const ( diff --git a/swarm/network_test.go b/swarm/network_test.go index 475a66db60..841afb0a4a 100644 --- a/swarm/network_test.go +++ b/swarm/network_test.go @@ -28,6 +28,7 @@ import ( "testing" "time" + colorable "github.com/mattn/go-colorable" "github.com/orangeAndSuns/go-ethereum/crypto" "github.com/orangeAndSuns/go-ethereum/log" "github.com/orangeAndSuns/go-ethereum/node" @@ -37,7 +38,6 @@ import ( "github.com/orangeAndSuns/go-ethereum/swarm/network" "github.com/orangeAndSuns/go-ethereum/swarm/network/simulation" "github.com/orangeAndSuns/go-ethereum/swarm/storage" - colorable "github.com/mattn/go-colorable" ) var ( diff --git a/swarm/storage/chunker.go b/swarm/storage/chunker.go index 98df5a5afe..377d71afc2 100644 --- a/swarm/storage/chunker.go +++ b/swarm/storage/chunker.go @@ -24,11 +24,11 @@ import ( "sync" "time" + opentracing "github.com/opentracing/opentracing-go" + olog "github.com/opentracing/opentracing-go/log" "github.com/orangeAndSuns/go-ethereum/metrics" "github.com/orangeAndSuns/go-ethereum/swarm/log" "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" - opentracing "github.com/opentracing/opentracing-go" - olog "github.com/opentracing/opentracing-go/log" ) /* diff --git a/swarm/storage/common_test.go b/swarm/storage/common_test.go index cb8d15f211..3c7cad6dd4 100644 --- a/swarm/storage/common_test.go +++ b/swarm/storage/common_test.go @@ -27,8 +27,8 @@ import ( "testing" "time" - "github.com/orangeAndSuns/go-ethereum/log" colorable "github.com/mattn/go-colorable" + "github.com/orangeAndSuns/go-ethereum/log" ) var ( diff --git a/swarm/storage/netstore.go b/swarm/storage/netstore.go index 9d45925005..5b74932e95 100644 --- a/swarm/storage/netstore.go +++ b/swarm/storage/netstore.go @@ -20,9 +20,9 @@ import ( "context" "time" + opentracing "github.com/opentracing/opentracing-go" "github.com/orangeAndSuns/go-ethereum/swarm/log" "github.com/orangeAndSuns/go-ethereum/swarm/spancontext" - opentracing "github.com/opentracing/opentracing-go" ) var ( diff --git a/vendor/bazil.org/fuse/fuse.go b/vendor/bazil.org/fuse/fuse.go index 8fe959e9aa..fa93813f9a 100644 --- a/vendor/bazil.org/fuse/fuse.go +++ b/vendor/bazil.org/fuse/fuse.go @@ -286,7 +286,7 @@ const RootID ESSNodeID = rootID type Header struct { Conn *Conn `json:"-"` // connection this request was received on ID RequestID // unique ID for request - Node ESSNodeID // file or directory the request is about + Node ESSNodeID // file or directory the request is about Uid uint32 // user ID of process making request Gid uint32 // group ID of process making request Pid uint32 // process ID of process making request diff --git a/vendor/github.com/uber/jaeger-client-go/thrift/protocol.go b/vendor/github.com/uber/jaeger-client-go/thrift/protocol.go index 45fa202e74..5b77363ef5 100644 --- a/vendor/github.com/uber/jaeger-client-go/thrift/protocol.go +++ b/vendor/github.com/uber/jaeger-client-go/thrift/protocol.go @@ -88,9 +88,9 @@ func SkipDefaultDepth(prot TProtocol, typeId TType) (err error) { // Skips over the next data element from the provided input TProtocol object. func Skip(self TProtocol, fieldType TType, maxDepth int) (err error) { - - if maxDepth <= 0 { - return NewTProtocolExceptionWithType( DEPTH_LIMIT, errors.New("Depth limit exceeded")) + + if maxDepth <= 0 { + return NewTProtocolExceptionWithType(DEPTH_LIMIT, errors.New("Depth limit exceeded")) } switch fieldType { diff --git a/vendor/github.com/uber/jaeger-client-go/thrift/protocol_exception.go b/vendor/github.com/uber/jaeger-client-go/thrift/protocol_exception.go index 6e357ee890..29ab75d921 100644 --- a/vendor/github.com/uber/jaeger-client-go/thrift/protocol_exception.go +++ b/vendor/github.com/uber/jaeger-client-go/thrift/protocol_exception.go @@ -60,7 +60,7 @@ func NewTProtocolException(err error) TProtocolException { if err == nil { return nil } - if e,ok := err.(TProtocolException); ok { + if e, ok := err.(TProtocolException); ok { return e } if _, ok := err.(base64.CorruptInputError); ok { @@ -75,4 +75,3 @@ func NewTProtocolExceptionWithType(errType int, err error) TProtocolException { } return &tProtocolException{errType, err.Error()} } - diff --git a/vendor/github.com/uber/jaeger-client-go/thrift/rich_transport.go b/vendor/github.com/uber/jaeger-client-go/thrift/rich_transport.go index 8e296a99b5..4025bebeaa 100644 --- a/vendor/github.com/uber/jaeger-client-go/thrift/rich_transport.go +++ b/vendor/github.com/uber/jaeger-client-go/thrift/rich_transport.go @@ -66,4 +66,3 @@ func writeByte(w io.Writer, c byte) error { _, err := w.Write(v[0:1]) return err } - diff --git a/vendor/github.com/uber/jaeger-client-go/thrift/transport.go b/vendor/github.com/uber/jaeger-client-go/thrift/transport.go index 453899651f..70a85a8489 100644 --- a/vendor/github.com/uber/jaeger-client-go/thrift/transport.go +++ b/vendor/github.com/uber/jaeger-client-go/thrift/transport.go @@ -34,7 +34,6 @@ type ReadSizeProvider interface { RemainingBytes() (num_bytes uint64) } - // Encapsulates the I/O layer type TTransport interface { io.ReadWriteCloser @@ -52,7 +51,6 @@ type stringWriter interface { WriteString(s string) (n int, err error) } - // This is "enchanced" transport with extra capabilities. You need to use one of these // to construct protocol. // Notably, TSocket does not implement this interface, and it is always a mistake to use @@ -65,4 +63,3 @@ type TRichTransport interface { Flusher ReadSizeProvider } - diff --git a/vendor/gopkg.in/check.v1/benchmark.go b/vendor/gopkg.in/check.v1/benchmark.go index 46ea9dc6da..b2d351948d 100644 --- a/vendor/gopkg.in/check.v1/benchmark.go +++ b/vendor/gopkg.in/check.v1/benchmark.go @@ -1,9 +1,9 @@ // Copyright (c) 2012 The Go Authors. All rights reserved. -// +// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: -// +// // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above @@ -13,7 +13,7 @@ // * Neither the name of Google Inc. nor the names of its // contributors may be used to endorse or promote products derived from // this software without specific prior written permission. -// +// // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR