forked from cerc-io/plugeth
all: add whitespace linter (#25312)
* golangci: typo Signed-off-by: Delweng <delweng@gmail.com> * golangci: add whietspace Signed-off-by: Delweng <delweng@gmail.com> * *: rm whitesapce using golangci-lint Signed-off-by: Delweng <delweng@gmail.com> * cmd/puppeth: revert accidental resurrection Co-authored-by: Péter Szilágyi <peterke@gmail.com>
This commit is contained in:
co-authored by
Péter Szilágyi
parent
6c4e5d06e7
commit
b196ad1c16
@@ -340,7 +340,6 @@ func freezeClient(ctx context.Context, t *testing.T, server *rpc.Client, clientI
|
||||
if err := server.CallContext(ctx, nil, "debug_freezeClient", clientID); err != nil {
|
||||
t.Fatalf("Failed to freeze client: %v", err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func setCapacity(ctx context.Context, t *testing.T, server *rpc.Client, clientID enode.ID, cap uint64) {
|
||||
|
||||
@@ -1330,7 +1330,6 @@ func (d *Downloader) fetchParts(deliveryCh chan dataPack, deliver func(dataPack)
|
||||
expire func() map[string]int, pending func() int, inFlight func() bool, reserve func(*peerConnection, int) (*fetchRequest, bool, bool),
|
||||
fetchHook func([]*types.Header), fetch func(*peerConnection, *fetchRequest) error, cancel func(*fetchRequest), capacity func(*peerConnection) int,
|
||||
idle func() ([]*peerConnection, int), setIdle func(*peerConnection, int, time.Time), kind string) error {
|
||||
|
||||
// Create a ticker to detect expired retrieval tasks
|
||||
ticker := time.NewTicker(100 * time.Millisecond)
|
||||
defer ticker.Stop()
|
||||
|
||||
@@ -621,7 +621,6 @@ func testThrottling(t *testing.T, protocol uint, mode SyncMode) {
|
||||
t.Fatalf("block synchronization failed: %v", err)
|
||||
}
|
||||
tester.terminate()
|
||||
|
||||
}
|
||||
|
||||
// Tests that simple synchronization against a forked chain works correctly. In
|
||||
|
||||
@@ -833,7 +833,6 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header,
|
||||
taskQueue *prque.Prque, pendPool map[string]*fetchRequest, reqTimer metrics.Timer,
|
||||
results int, validate func(index int, header *types.Header) error,
|
||||
reconstruct func(index int, result *fetchResult)) (int, error) {
|
||||
|
||||
// Short circuit if the data was never requested
|
||||
request := pendPool[id]
|
||||
if request == nil {
|
||||
|
||||
@@ -179,7 +179,6 @@ func TestBasics(t *testing.T) {
|
||||
if got, exp := fetchReq.Headers[0].Number.Uint64(), uint64(1); got != exp {
|
||||
t.Fatalf("expected header %d, got %d", exp, got)
|
||||
}
|
||||
|
||||
}
|
||||
if exp, got := q.blockTaskQueue.Size(), numOfBlocks-10; exp != got {
|
||||
t.Errorf("expected block task queue to be %d, got %d", exp, got)
|
||||
@@ -227,7 +226,6 @@ func TestEmptyBlocks(t *testing.T) {
|
||||
if fetchReq != nil {
|
||||
t.Fatal("there should be no body fetch tasks remaining")
|
||||
}
|
||||
|
||||
}
|
||||
if q.blockTaskQueue.Size() != numOfBlocks-10 {
|
||||
t.Errorf("expected block task queue to be %d, got %d", numOfBlocks-10, q.blockTaskQueue.Size())
|
||||
@@ -268,7 +266,6 @@ func XTestDelivery(t *testing.T) {
|
||||
world.progress(10)
|
||||
if false {
|
||||
log.Root().SetHandler(log.StdoutHandler)
|
||||
|
||||
}
|
||||
q := newQueue(10, 10)
|
||||
var wg sync.WaitGroup
|
||||
@@ -299,7 +296,6 @@ func XTestDelivery(t *testing.T) {
|
||||
fmt.Printf("got %d results, %d tot\n", len(res), tot)
|
||||
// Now we can forget about these
|
||||
world.forget(res[len(res)-1].Header.Number.Uint64())
|
||||
|
||||
}
|
||||
}()
|
||||
wg.Add(1)
|
||||
@@ -362,7 +358,6 @@ func XTestDelivery(t *testing.T) {
|
||||
}
|
||||
for i := 0; i < 50; i++ {
|
||||
time.Sleep(2990 * time.Millisecond)
|
||||
|
||||
}
|
||||
}()
|
||||
wg.Add(1)
|
||||
@@ -413,10 +408,8 @@ func (n *network) forget(blocknum uint64) {
|
||||
n.chain = n.chain[index:]
|
||||
n.receipts = n.receipts[index:]
|
||||
n.offset = int(blocknum)
|
||||
|
||||
}
|
||||
func (n *network) progress(numBlocks int) {
|
||||
|
||||
n.lock.Lock()
|
||||
defer n.lock.Unlock()
|
||||
//fmt.Printf("progressing...\n")
|
||||
@@ -424,7 +417,6 @@ func (n *network) progress(numBlocks int) {
|
||||
n.chain = append(n.chain, newBlocks...)
|
||||
n.receipts = append(n.receipts, newR...)
|
||||
n.cond.Broadcast()
|
||||
|
||||
}
|
||||
|
||||
func (n *network) headers(from int) []*types.Header {
|
||||
|
||||
@@ -641,7 +641,6 @@ func (f *BlockFetcher) loop() {
|
||||
} else {
|
||||
f.forgetHash(hash)
|
||||
}
|
||||
|
||||
}
|
||||
if matched {
|
||||
task.transactions = append(task.transactions[:i], task.transactions[i+1:]...)
|
||||
|
||||
@@ -104,7 +104,6 @@ func testConstantTotalCapacity(t *testing.T, nodeCount, maxCapacityNodes, random
|
||||
if ratio < 0.98 || ratio > 1.02 {
|
||||
t.Errorf("totalCost/totalCapacity/testLength ratio incorrect (expected: 1, got: %f)", ratio)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (n *testNode) send(t *testing.T, now mclock.AbsTime) bool {
|
||||
|
||||
@@ -222,7 +222,6 @@ func (s *serverPoolIterator) Close() {
|
||||
func (s *ServerPool) AddMetrics(
|
||||
suggestedTimeoutGauge, totalValueGauge, serverSelectableGauge, serverConnectedGauge metrics.Gauge,
|
||||
sessionValueMeter, serverDialedMeter metrics.Meter) {
|
||||
|
||||
s.suggestedTimeoutGauge = suggestedTimeoutGauge
|
||||
s.totalValueGauge = totalValueGauge
|
||||
s.sessionValueMeter = sessionValueMeter
|
||||
|
||||
@@ -109,7 +109,6 @@ func (w *WrsIterator) chooseNode() *enode.Node {
|
||||
return w.ns.GetNode(id)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Close ends the iterator.
|
||||
|
||||
@@ -410,7 +410,6 @@ func TestFreeClientKickedOut(t *testing.T) {
|
||||
clock.Run(5 * time.Minute)
|
||||
for i := 0; i < 10; i++ {
|
||||
connect(pool, newPoolTestPeer(i+10, kicked))
|
||||
|
||||
}
|
||||
clock.Run(0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user