eth: fix megacheck warnings

This commit is contained in:
Egon Elbre
2017-08-06 08:54:25 +03:00
parent 971079822e
commit 8f06b7980d
7 changed files with 17 additions and 40 deletions

View File

@ -54,7 +54,6 @@ type PublicFilterAPI struct {
backend Backend
useMipMap bool
mux *event.TypeMux
quit chan struct{}
chainDb ethdb.Database
events *EventSystem
filtersMu sync.Mutex

View File

@ -20,7 +20,6 @@ import (
"context"
"math"
"math/big"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core"
@ -42,8 +41,6 @@ type Filter struct {
backend Backend
useMipMap bool
created time.Time
db ethdb.Database
begin, end int64
addresses []common.Address

View File

@ -74,7 +74,6 @@ type subscription struct {
// subscription which match the subscription criteria.
type EventSystem struct {
mux *event.TypeMux
sub *event.TypeMuxSubscription
backend Backend
lightMode bool
lastHead *types.Header

View File

@ -18,6 +18,7 @@ package filters
import (
"context"
"fmt"
"math/big"
"reflect"
"testing"
@ -439,15 +440,15 @@ func TestPendingLogsSubscription(t *testing.T) {
}
if len(fetched) != len(tt.expected) {
t.Fatalf("invalid number of logs for case %d, want %d log(s), got %d", i, len(tt.expected), len(fetched))
panic(fmt.Sprintf("invalid number of logs for case %d, want %d log(s), got %d", i, len(tt.expected), len(fetched)))
}
for l := range fetched {
if fetched[l].Removed {
t.Errorf("expected log not to be removed for log %d in case %d", l, i)
panic(fmt.Sprintf("expected log not to be removed for log %d in case %d", l, i))
}
if !reflect.DeepEqual(fetched[l], tt.expected[l]) {
t.Errorf("invalid log on index %d for case %d", l, i)
panic(fmt.Sprintf("invalid log on index %d for case %d", l, i))
}
}
}()