Skip to content

Commit

Permalink
goimports and govet fixes
Browse files Browse the repository at this point in the history
Change-Id: Ia0dcd58b57be91f6dcd1117de7f903ed57922065
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Oct 23, 2016
1 parent 6f9b427 commit ec26cd8
Show file tree
Hide file tree
Showing 13 changed files with 17 additions and 21 deletions.
1 change: 0 additions & 1 deletion consensus/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
3 changes: 1 addition & 2 deletions consensus/executor/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion consensus/pbft/batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
3 changes: 1 addition & 2 deletions consensus/util/messagefan.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion core/committer/noopssinglechain/committer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
Expand Down
2 changes: 1 addition & 1 deletion core/ledger/test/ledger_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion core/peer/statetransfer/statetransfer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
1 change: 0 additions & 1 deletion core/peer/statetransfer/statetransfer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down
2 changes: 1 addition & 1 deletion membersrvc/ca/ecap.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion orderer/sample_clients/broadcast_timestamp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
6 changes: 3 additions & 3 deletions orderer/solo/broadcast.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,17 @@ 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
}
}

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 {
Expand Down
10 changes: 5 additions & 5 deletions orderer/solo/broadcast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion peer/chaincode/noopsordererclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ec26cd8

Please sign in to comment.