all: fix go vet warnings

This commit is contained in:
Felix Lange
2016-04-15 11:17:27 +02:00
parent 68c755a238
commit 6fdd0893c3
41 changed files with 83 additions and 93 deletions
+4 -4
View File
@@ -331,7 +331,7 @@ func (args *NewFilterArgs) UnmarshalJSON(data []byte) error {
if decAddr, err := hex.DecodeString(strAddr); err == nil {
addresses = append(addresses, common.BytesToAddress(decAddr))
} else {
fmt.Errorf("invalid address given")
return fmt.Errorf("invalid address given")
}
} else {
return fmt.Errorf("invalid address on index %d", i)
@@ -344,10 +344,10 @@ func (args *NewFilterArgs) UnmarshalJSON(data []byte) error {
if decAddr, err := hex.DecodeString(singleAddr); err == nil {
addresses = append(addresses, common.BytesToAddress(decAddr))
} else {
fmt.Errorf("invalid address given")
return fmt.Errorf("invalid address given")
}
} else {
errors.New("invalid address(es) given")
return errors.New("invalid address(es) given")
}
args.Addresses = addresses
}
@@ -394,7 +394,7 @@ func (args *NewFilterArgs) UnmarshalJSON(data []byte) error {
parsedTopics[i] = []common.Hash{t}
}
} else {
fmt.Errorf("topic[%d][%d] not a string", i, j)
return fmt.Errorf("topic[%d][%d] not a string", i, j)
}
}
} else {
+2 -2
View File
@@ -76,8 +76,8 @@ func TestCallbacks(t *testing.T) {
mux.Post(core.ChainEvent{})
mux.Post(core.TxPreEvent{})
mux.Post(vm.Logs{&vm.Log{}})
mux.Post(core.RemovedLogsEvent{vm.Logs{&vm.Log{}}})
mux.Post(core.PendingLogsEvent{vm.Logs{&vm.Log{}}})
mux.Post(core.RemovedLogsEvent{Logs: vm.Logs{&vm.Log{}}})
mux.Post(core.PendingLogsEvent{Logs: vm.Logs{&vm.Log{}}})
const dura = 5 * time.Second
failTimer := time.NewTimer(dura)
+2 -2
View File
@@ -56,7 +56,7 @@ func BenchmarkMipmaps(b *testing.B) {
)
defer db.Close()
genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{addr1, big.NewInt(1000000)})
genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr1, Balance: big.NewInt(1000000)})
chain, receipts := core.GenerateChain(genesis, db, 100010, func(i int, gen *core.BlockGen) {
var receipts types.Receipts
switch i {
@@ -132,7 +132,7 @@ func TestFilters(t *testing.T) {
)
defer db.Close()
genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{addr, big.NewInt(1000000)})
genesis := core.WriteGenesisBlockForTesting(db, core.GenesisAccount{Address: addr, Balance: big.NewInt(1000000)})
chain, receipts := core.GenerateChain(genesis, db, 1000, func(i int, gen *core.BlockGen) {
var receipts types.Receipts
switch i {