mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
swarm/network: fix code inspection problems
- typos - redundant import alias
This commit is contained in:
parent
c1c4301121
commit
e56b7d80f2
6 changed files with 8 additions and 8 deletions
|
|
@ -21,7 +21,7 @@ import "github.com/ethereum/go-ethereum/p2p/enode"
|
||||||
// BucketKey is the type that should be used for keys in simulation buckets.
|
// BucketKey is the type that should be used for keys in simulation buckets.
|
||||||
type BucketKey string
|
type BucketKey string
|
||||||
|
|
||||||
// NodeItem returns an item set in ServiceFunc function for a particualar node.
|
// NodeItem returns an item set in ServiceFunc function for a particular node.
|
||||||
func (s *Simulation) NodeItem(id enode.ID, key interface{}) (value interface{}, ok bool) {
|
func (s *Simulation) NodeItem(id enode.ID, key interface{}) (value interface{}, ok bool) {
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
|
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestServiceBucket tests all bucket functionalities using subtests.
|
// TestServiceBucket tests all bucket functionality using subtests.
|
||||||
// It constructs a simulation of two nodes by adding items to their buckets
|
// It constructs a simulation of two nodes by adding items to their buckets
|
||||||
// in ServiceFunc constructor, then by SetNodeItem. Testing UpNodesItems
|
// in ServiceFunc constructor, then by SetNodeItem. Testing UpNodesItems
|
||||||
// is done by stopping one node and validating availability of its items.
|
// is done by stopping one node and validating availability of its items.
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ import (
|
||||||
|
|
||||||
// Every node can have a Kademlia associated using the node bucket under
|
// Every node can have a Kademlia associated using the node bucket under
|
||||||
// BucketKeyKademlia key. This allows to use WaitTillHealthy to block until
|
// BucketKeyKademlia key. This allows to use WaitTillHealthy to block until
|
||||||
// all nodes have the their Kadmlias healthy.
|
// all nodes have the their Kademlias healthy.
|
||||||
func ExampleSimulation_WaitTillHealthy() {
|
func ExampleSimulation_WaitTillHealthy() {
|
||||||
|
|
||||||
log.Error("temporarily disabled as simulations.WaitTillHealthy cannot be trusted")
|
log.Error("temporarily disabled as simulations.WaitTillHealthy cannot be trusted")
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
// BucketKeyKademlia is the key to be used for storing the kademlia
|
// BucketKeyKademlia is the key to be used for storing the kademlia
|
||||||
// instance for particuar node, usually inside the ServiceFunc function.
|
// instance for particular node, usually inside the ServiceFunc function.
|
||||||
var BucketKeyKademlia BucketKey = "kademlia"
|
var BucketKeyKademlia BucketKey = "kademlia"
|
||||||
|
|
||||||
// WaitTillHealthy is blocking until the health of all kademlias is true.
|
// WaitTillHealthy is blocking until the health of all kademlias is true.
|
||||||
|
|
|
||||||
|
|
@ -195,9 +195,9 @@ func (s *Simulation) AddNodesAndConnectStar(count int, opts ...AddNodeOption) (i
|
||||||
return ids, nil
|
return ids, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//UploadSnapshot uploads a snapshot to the simulation
|
// UploadSnapshot uploads a snapshot to the simulation
|
||||||
//This method tries to open the json file provided, applies the config to all nodes
|
// This method tries to open the json file provided, applies the config to all nodes
|
||||||
//and then loads the snapshot into the Simulation network
|
// and then loads the snapshot into the Simulation network
|
||||||
func (s *Simulation) UploadSnapshot(snapshotFile string, opts ...AddNodeOption) error {
|
func (s *Simulation) UploadSnapshot(snapshotFile string, opts ...AddNodeOption) error {
|
||||||
f, err := os.Open(snapshotFile)
|
f, err := os.Open(snapshotFile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ import (
|
||||||
"github.com/ethereum/go-ethereum/node"
|
"github.com/ethereum/go-ethereum/node"
|
||||||
"github.com/ethereum/go-ethereum/p2p/simulations"
|
"github.com/ethereum/go-ethereum/p2p/simulations"
|
||||||
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
|
"github.com/ethereum/go-ethereum/p2p/simulations/adapters"
|
||||||
colorable "github.com/mattn/go-colorable"
|
"github.com/mattn/go-colorable"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue