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
@@ -817,7 +817,6 @@ func (q *queue) deliver(id string, taskPool map[common.Hash]*types.Header,
|
||||
reqTimer metrics.Timer, resInMeter metrics.Meter, resDropMeter metrics.Meter,
|
||||
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 {
|
||||
|
||||
@@ -185,7 +185,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)
|
||||
@@ -239,7 +238,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())
|
||||
@@ -280,7 +278,6 @@ func XTestDelivery(t *testing.T) {
|
||||
world.progress(10)
|
||||
if false {
|
||||
log.Root().SetHandler(log.StdoutHandler)
|
||||
|
||||
}
|
||||
q := newQueue(10, 10)
|
||||
var wg sync.WaitGroup
|
||||
@@ -315,7 +312,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)
|
||||
@@ -396,7 +392,6 @@ func XTestDelivery(t *testing.T) {
|
||||
}
|
||||
for i := 0; i < 50; i++ {
|
||||
time.Sleep(2990 * time.Millisecond)
|
||||
|
||||
}
|
||||
}()
|
||||
wg.Add(1)
|
||||
@@ -447,10 +442,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")
|
||||
@@ -458,7 +451,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 {
|
||||
|
||||
@@ -790,7 +790,6 @@ func TestSkeletonSyncRetrievals(t *testing.T) {
|
||||
check := func() error {
|
||||
if len(progress.Subchains) != len(tt.midstate) {
|
||||
return fmt.Errorf("test %d, mid state: subchain count mismatch: have %d, want %d", i, len(progress.Subchains), len(tt.midstate))
|
||||
|
||||
}
|
||||
for j := 0; j < len(progress.Subchains); j++ {
|
||||
if progress.Subchains[j].Head != tt.midstate[j].Head {
|
||||
|
||||
@@ -692,7 +692,6 @@ func (f *BlockFetcher) loop() {
|
||||
} else {
|
||||
f.forgetHash(hash)
|
||||
}
|
||||
|
||||
}
|
||||
if matched {
|
||||
task.transactions = append(task.transactions[:i], task.transactions[i+1:]...)
|
||||
|
||||
@@ -248,7 +248,6 @@ func (api *FilterAPI) Logs(ctx context.Context, crit FilterCriteria) (*rpc.Subsc
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
||||
for {
|
||||
select {
|
||||
case logs := <-matchedLogs:
|
||||
|
||||
@@ -72,7 +72,6 @@ func BenchmarkFilters(b *testing.B) {
|
||||
receipt := makeReceipt(addr4)
|
||||
gen.AddUncheckedReceipt(receipt)
|
||||
gen.AddUncheckedTx(types.NewTransaction(999, common.HexToAddress("0x999"), big.NewInt(999), 999, gen.BaseFee(), nil))
|
||||
|
||||
}
|
||||
})
|
||||
for i, block := range chain {
|
||||
|
||||
@@ -490,7 +490,6 @@ func TestCheckpointChallenge(t *testing.T) {
|
||||
}
|
||||
|
||||
func testCheckpointChallenge(t *testing.T, syncmode downloader.SyncMode, checkpoint bool, timeout bool, empty bool, match bool, drop bool) {
|
||||
|
||||
// Reduce the checkpoint handshake challenge timeout
|
||||
defer func(old time.Duration) { syncChallengeTimeout = old }(syncChallengeTimeout)
|
||||
syncChallengeTimeout = 250 * time.Millisecond
|
||||
|
||||
@@ -115,12 +115,10 @@ func TestEth66EmptyMessages(t *testing.T) {
|
||||
t.Errorf("test %d, type %T, have\n\t%x\nwant\n\t%x", i, msg, have, want)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// TestEth66Messages tests the encoding of all redefined eth66 messages
|
||||
func TestEth66Messages(t *testing.T) {
|
||||
|
||||
// Some basic structs used during testing
|
||||
var (
|
||||
header *types.Header
|
||||
|
||||
@@ -878,7 +878,6 @@ func (r *callframeResult) GetError() goja.Value {
|
||||
return r.vm.ToValue(r.err.Error())
|
||||
}
|
||||
return goja.Undefined()
|
||||
|
||||
}
|
||||
|
||||
func (r *callframeResult) setupObject() *goja.Object {
|
||||
|
||||
Reference in New Issue
Block a user