Commit ec26cd86 authored by YACOVM's avatar YACOVM
Browse files

goimports and govet fixes



Change-Id: Ia0dcd58b57be91f6dcd1117de7f903ed57922065
Signed-off-by: default avatarYacov Manevich <yacovm@il.ibm.com>
parent 6f9b4272
......@@ -21,7 +21,6 @@ import (
"github.com/hyperledger/fabric/consensus/util/events"
"github.com/hyperledger/fabric/core/peer/statetransfer"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
)
......
......@@ -22,10 +22,9 @@ import (
"testing"
"github.com/hyperledger/fabric/consensus/util/events"
"github.com/op/go-logging"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
)
func init() {
......
......@@ -23,10 +23,10 @@ import (
"github.com/hyperledger/fabric/consensus"
"github.com/hyperledger/fabric/consensus/util/events"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/op/go-logging"
"github.com/spf13/viper"
)
......
......@@ -19,9 +19,8 @@ package util
import (
"sync"
"github.com/op/go-logging"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
)
var logger *logging.Logger // package-level logger
......
......@@ -146,7 +146,7 @@ func (r *deliverClient) readUntilClose() {
if err = r.commit(txs); err != nil {
fmt.Printf("Got error while committing(%s)\n", err)
} else {
fmt.Printf("Commit success, created a block!\n", err)
fmt.Printf("Commit success, created a block!\n")
}
r.unAcknowledged++
......
......@@ -22,10 +22,10 @@ import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/op/go-logging"
"github.com/hyperledger/fabric/core/db"
"github.com/hyperledger/fabric/core/ledger"
"github.com/op/go-logging"
"github.com/spf13/viper"
)
......
......@@ -24,11 +24,11 @@ import (
"time"
_ "github.com/hyperledger/fabric/core" // Logging format init
"github.com/op/go-logging"
"github.com/hyperledger/fabric/core/ledger/statemgmt"
"github.com/hyperledger/fabric/core/peer"
pb "github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
"github.com/spf13/viper"
)
......
......@@ -28,7 +28,6 @@ import (
configSetup "github.com/hyperledger/fabric/core/config"
"github.com/hyperledger/fabric/core/peer"
"github.com/hyperledger/fabric/protos"
"github.com/op/go-logging"
)
......
......@@ -29,12 +29,12 @@ import (
"time"
"github.com/hyperledger/fabric/core/crypto/primitives/ecies"
"github.com/op/go-logging"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/timestamp"
"github.com/hyperledger/fabric/core/crypto/primitives"
pb "github.com/hyperledger/fabric/membersrvc/protos"
"github.com/op/go-logging"
"github.com/spf13/viper"
"golang.org/x/net/context"
)
......
......@@ -36,7 +36,7 @@ func newBroadcastClient(client ab.AtomicBroadcast_BroadcastClient) *broadcastCli
}
func (s *broadcastClient) broadcast(transaction []byte) error {
return s.client.Send(&ab.BroadcastMessage{transaction})
return s.client.Send(&ab.BroadcastMessage{Data: transaction})
}
func main() {
......
......@@ -124,7 +124,7 @@ func (b *broadcaster) queueBroadcastMessages(srv ab.AtomicBroadcast_BroadcastSer
}
if msg.Data == nil {
err = srv.Send(&ab.BroadcastResponse{ab.Status_BAD_REQUEST})
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_BAD_REQUEST})
if err != nil {
return err
}
......@@ -132,9 +132,9 @@ func (b *broadcaster) queueBroadcastMessages(srv ab.AtomicBroadcast_BroadcastSer
select {
case b.queue <- msg:
err = srv.Send(&ab.BroadcastResponse{ab.Status_SUCCESS})
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SUCCESS})
default:
err = srv.Send(&ab.BroadcastResponse{ab.Status_SERVICE_UNAVAILABLE})
err = srv.Send(&ab.BroadcastResponse{Status: ab.Status_SERVICE_UNAVAILABLE})
}
if err != nil {
......
......@@ -64,14 +64,14 @@ func TestQueueOverflow(t *testing.T) {
bs.halt()
for i := 0; i < 2; i++ {
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
reply := <-m.sendChan
if reply.Status != ab.Status_SUCCESS {
t.Fatalf("Should have successfully queued the message")
}
}
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
reply := <-m.sendChan
if reply.Status != ab.Status_SERVICE_UNAVAILABLE {
t.Fatalf("Should not have successfully queued the message")
......@@ -92,7 +92,7 @@ func TestMultiQueueOverflow(t *testing.T) {
for _, m := range ms {
for i := 0; i < 2; i++ {
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
reply := <-m.sendChan
if reply.Status != ab.Status_SUCCESS {
t.Fatalf("Should have successfully queued the message")
......@@ -101,7 +101,7 @@ func TestMultiQueueOverflow(t *testing.T) {
}
for _, m := range ms {
m.recvChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
m.recvChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
reply := <-m.sendChan
if reply.Status != ab.Status_SERVICE_UNAVAILABLE {
t.Fatalf("Should not have successfully queued the message")
......@@ -137,7 +137,7 @@ func TestFilledBatch(t *testing.T) {
defer bs.halt()
messages := 11 // Sending 11 messages, with a batch size of 2, ensures the 10th message is processed before we proceed for 5 blocks
for i := 0; i < messages; i++ {
bs.sendChan <- &ab.BroadcastMessage{[]byte("Some bytes")}
bs.sendChan <- &ab.BroadcastMessage{Data: []byte("Some bytes")}
}
expected := uint64(1 + messages/batchSize)
if bs.rl.(rawledger.Reader).Height() != expected {
......
......@@ -40,7 +40,7 @@ func newBroadcastClient(client ab.AtomicBroadcast_BroadcastClient) *broadcastCli
}
func (s *broadcastClient) broadcast(transaction []byte) error {
return s.client.Send(&ab.BroadcastMessage{transaction})
return s.client.Send(&ab.BroadcastMessage{Data: transaction})
}
//Send data to solo orderer
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment