Skip to content

Commit

Permalink
Merge "Fix gossip protos go_package directive"
Browse files Browse the repository at this point in the history
  • Loading branch information
jimthematrix authored and Gerrit Code Review committed Feb 7, 2017
2 parents 0a680f0 + 07d16c9 commit 515adbf
Show file tree
Hide file tree
Showing 31 changed files with 282 additions and 282 deletions.
2 changes: 1 addition & 1 deletion gossip/comm/comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"

"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

// Comm is an object that enables to communicate with other peers
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/comm_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/identity"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
"golang.org/x/net/context"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/comm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/hyperledger/fabric/gossip/api"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/identity"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
"sync/atomic"

"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/crypto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/mock/mock_comm.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/hyperledger/fabric/gossip/comm"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

// Mock which aims to simulate socket
Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/mock/mock_comm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (

"github.com/hyperledger/fabric/gossip/comm"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/comm/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"sync"

"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

// ReceivedMessageImpl is an implementation of ReceivedMessage
Expand Down
2 changes: 1 addition & 1 deletion gossip/discovery/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ package discovery

import (
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

// CryptoService is an interface that the discovery expects to be implemented and passed on creation
Expand Down
2 changes: 1 addition & 1 deletion gossip/discovery/discovery_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (

"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/discovery/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"time"

"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
"golang.org/x/net/context"
"google.golang.org/grpc"
Expand Down
2 changes: 1 addition & 1 deletion gossip/election/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
"github.com/hyperledger/fabric/gossip/comm"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/election/adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/hyperledger/fabric/gossip/comm"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

func TestNewAdapter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/certstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip/pull"
"github.com/hyperledger/fabric/gossip/identity"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/certstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip/algo"
"github.com/hyperledger/fabric/gossip/gossip/pull"
"github.com/hyperledger/fabric/gossip/identity"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/channel/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip/msgstore"
"github.com/hyperledger/fabric/gossip/gossip/pull"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
38 changes: 19 additions & 19 deletions gossip/gossip/channel/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/gossip/gossip/algo"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
Expand Down Expand Up @@ -211,8 +211,8 @@ func TestChannelPeriodicalPublishStateInfo(t *testing.T) {

adapter := new(gossipAdapterMock)
configureAdapter(adapter)
adapter.On("Send", mock.AnythingOfType("*proto.GossipMessage"), mock.Anything)
adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage")).Run(func(arg mock.Arguments) {
adapter.On("Send", mock.AnythingOfType("*gossip.GossipMessage"), mock.Anything)
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage")).Run(func(arg mock.Arguments) {
if atomic.LoadInt32(&receivedMsg) == int32(1) {
return
}
Expand Down Expand Up @@ -246,8 +246,8 @@ func TestChannelPull(t *testing.T) {
receivedBlocksChan := make(chan *proto.GossipMessage)
adapter := new(gossipAdapterMock)
configureAdapter(adapter, discovery.NetworkMember{PKIid: pkiIDInOrg1})
adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage"))
adapter.On("DeMultiplex", mock.AnythingOfType("*proto.GossipMessage")).Run(func(arg mock.Arguments) {
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage"))
adapter.On("DeMultiplex", mock.AnythingOfType("*gossip.GossipMessage")).Run(func(arg mock.Arguments) {
msg := arg.Get(0).(*proto.GossipMessage)
if !msg.IsDataMsg() {
return
Expand All @@ -261,7 +261,7 @@ func TestChannelPull(t *testing.T) {

var wg sync.WaitGroup
pullPhase := simulatePullPhase(gc, t, &wg, func(*proto.GossipMessage) {})
adapter.On("Send", mock.AnythingOfType("*proto.GossipMessage"), mock.Anything).Run(pullPhase)
adapter.On("Send", mock.AnythingOfType("*gossip.GossipMessage"), mock.Anything).Run(pullPhase)

wg.Wait()
for expectedSeq := 10; expectedSeq < 11; expectedSeq++ {
Expand All @@ -282,7 +282,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
gossipMessagesSentFromChannel := make(chan *proto.GossipMessage, 1)
adapter := new(gossipAdapterMock)
configureAdapter(adapter)
adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage"))
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage"))
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("DeMultiplex", mock.Anything)
gc := NewGossipChannel(cs, channelA, adapter, &joinChanMsg{})
Expand All @@ -306,7 +306,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
}
// First, ensure it does that for pull messages from peers that are in the channel
helloMsg := createHelloMsg(pkiIDInOrg1)
helloMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
helloMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(helloMsg)
select {
case <-gossipMessagesSentFromChannel:
Expand All @@ -315,7 +315,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
}
// And now for peers that are not in the channel (should not send back a message)
helloMsg = createHelloMsg(pkiIDinOrg2)
helloMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
helloMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(helloMsg)
select {
case <-gossipMessagesSentFromChannel:
Expand All @@ -329,7 +329,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
msg: req,
PKIID: pkiIDInOrg1,
}
validReceivedMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
validReceivedMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(validReceivedMsg)
select {
case <-gossipMessagesSentFromChannel:
Expand All @@ -342,7 +342,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
msg: req,
PKIID: pkiIDinOrg2,
}
invalidReceivedMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
invalidReceivedMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(invalidReceivedMsg)
select {
case <-gossipMessagesSentFromChannel:
Expand All @@ -357,7 +357,7 @@ func TestChannelPeerNotInChannel(t *testing.T) {
msg: req2,
PKIID: pkiIDInOrg1,
}
invalidReceivedMsg2.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
invalidReceivedMsg2.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(invalidReceivedMsg2)
select {
case <-gossipMessagesSentFromChannel:
Expand All @@ -374,7 +374,7 @@ func TestChannelIsInChannel(t *testing.T) {
adapter := new(gossipAdapterMock)
configureAdapter(adapter)
gc := NewGossipChannel(cs, channelA, adapter, &joinChanMsg{})
adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage"))
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage"))
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("DeMultiplex", mock.Anything)

Expand All @@ -393,7 +393,7 @@ func TestChannelIsSubscribed(t *testing.T) {
adapter := new(gossipAdapterMock)
configureAdapter(adapter)
gc := NewGossipChannel(cs, channelA, adapter, &joinChanMsg{})
adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage"))
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage"))
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("DeMultiplex", mock.Anything)
gc.HandleMessage(&receivedMsg{msg: createStateInfoMsg(10, pkiIDInOrg1, channelA), PKIID: pkiIDInOrg1})
Expand All @@ -411,7 +411,7 @@ func TestChannelAddToMessageStore(t *testing.T) {
gc := NewGossipChannel(cs, channelA, adapter, &joinChanMsg{})
adapter.On("Gossip", mock.Anything)
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("DeMultiplex", mock.AnythingOfType("*proto.GossipMessage")).Run(func(arg mock.Arguments) {
adapter.On("DeMultiplex", mock.AnythingOfType("*gossip.GossipMessage")).Run(func(arg mock.Arguments) {
demuxedMsgs <- arg.Get(0).(*proto.GossipMessage)
})

Expand All @@ -438,7 +438,7 @@ func TestChannelAddToMessageStore(t *testing.T) {
gc.AddToMsgStore(createStateInfoMsg(10, pkiIDInOrg1, channelA))
helloMsg := createHelloMsg(pkiIDInOrg1)
respondedChan := make(chan struct{}, 1)
helloMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(func(arg mock.Arguments) {
helloMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(func(arg mock.Arguments) {
respondedChan <- struct{}{}
})
gc.HandleMessage(helloMsg)
Expand Down Expand Up @@ -588,7 +588,7 @@ func TestChannelStateInfoSnapshot(t *testing.T) {
adapter.On("Gossip", mock.Anything)
sentMessages := make(chan *proto.GossipMessage, 10)
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("ValidateStateInfoMessage", mock.AnythingOfType("*proto.GossipMessage")).Return(nil)
adapter.On("ValidateStateInfoMessage", mock.AnythingOfType("*gossip.GossipMessage")).Return(nil)

// Ensure we ignore stateInfo snapshots from peers not in the channel
gc.HandleMessage(&receivedMsg{PKIID: pkiIDInOrg1, msg: stateInfoSnapshotForChannel(common.ChainID("B"), createStateInfoMsg(4, pkiIDInOrg1, channelA))})
Expand Down Expand Up @@ -728,7 +728,7 @@ func TestChannelReconfigureChannel(t *testing.T) {
// Just call it again, to make sure stuff don't crash
gc.ConfigureChannel(api.JoinChannelMessage(newJoinChanMsg))

adapter.On("Gossip", mock.AnythingOfType("*proto.GossipMessage"))
adapter.On("Gossip", mock.AnythingOfType("*gossip.GossipMessage"))
adapter.On("Send", mock.Anything, mock.Anything)
adapter.On("DeMultiplex", mock.Anything)

Expand Down Expand Up @@ -760,7 +760,7 @@ func TestChannelReconfigureChannel(t *testing.T) {
msg := arg.Get(0).(*proto.GossipMessage)
gossipMessagesSentFromChannel <- msg
}
invalidReceivedMsg.On("Respond", mock.AnythingOfType("*proto.GossipMessage")).Run(messageRelayer)
invalidReceivedMsg.On("Respond", mock.AnythingOfType("*gossip.GossipMessage")).Run(messageRelayer)
gc.HandleMessage(invalidReceivedMsg)
select {
case <-gossipMessagesSentFromChannel:
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/chanstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip/channel"
"github.com/hyperledger/fabric/gossip/gossip/msgstore"
"github.com/hyperledger/fabric/gossip/gossip/pull"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/gossip.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/hyperledger/fabric/gossip/comm"
"github.com/hyperledger/fabric/gossip/common"
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
)

// Gossip is the interface of the gossip component
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/gossip_impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip/pull"
"github.com/hyperledger/fabric/gossip/identity"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
"google.golang.org/grpc"
)
Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/gossip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/gossip/gossip/algo"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/pull/pullstore.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/gossip/gossip/algo"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/gossip/pull/pullstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ import (
"github.com/hyperledger/fabric/gossip/discovery"
"github.com/hyperledger/fabric/gossip/gossip/algo"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/service/gossip_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (
"github.com/hyperledger/fabric/gossip/state"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"google.golang.org/grpc"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/state/payloads_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"sync/atomic"

"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/state/payloads_buffer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"
"time"

"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/stretchr/testify/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/state/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip"
"github.com/hyperledger/fabric/gossip/util"
"github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/op/go-logging"
)

Expand Down
2 changes: 1 addition & 1 deletion gossip/state/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
"github.com/hyperledger/fabric/gossip/gossip"
gossipUtil "github.com/hyperledger/fabric/gossip/util"
pcomm "github.com/hyperledger/fabric/protos/common"
"github.com/hyperledger/fabric/protos/gossip"
proto "github.com/hyperledger/fabric/protos/gossip"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)
Expand Down
Loading

0 comments on commit 515adbf

Please sign in to comment.