diff --git a/gossip/api/channel.go b/gossip/api/channel.go index fd5ddf26814..c5f1381f2a3 100644 --- a/gossip/api/channel.go +++ b/gossip/api/channel.go @@ -16,7 +16,11 @@ limitations under the License. package api -import "time" +import ( + "time" + + "github.com/hyperledger/fabric/gossip/common" +) // SecurityAdvisor defines an external auxiliary object // that provides security and identity related capabilities @@ -33,7 +37,7 @@ type SecurityAdvisor interface { // ChannelNotifier is implemented by the gossip component and is used for the peer // layer to notify the gossip component of a JoinChannel event type ChannelNotifier interface { - JoinChannel(joinMsg JoinChannelMessage, chainID ChainID) + JoinChannel(joinMsg JoinChannelMessage, chainID common.ChainID) } // JoinChannelMessage is the message that asserts a creation or mutation @@ -48,9 +52,6 @@ type JoinChannelMessage interface { Members() []ChannelMember } -// ChainID defines the identity representation of a chain -type ChainID []byte - // ChannelMember is a peer's certificate and endpoint (host:port) type ChannelMember struct { Cert PeerCert // Cert defines the certificate of the remote peer diff --git a/gossip/common/common.go b/gossip/common/common.go index 5adff378fc6..bc6f2beaac4 100644 --- a/gossip/common/common.go +++ b/gossip/common/common.go @@ -16,8 +16,6 @@ limitations under the License. package common -import "github.com/hyperledger/fabric/gossip/api" - // PKIidType defines the type that holds the PKI-id // which is the security identifier of a peer type PKIidType []byte @@ -29,8 +27,11 @@ type MessageAcceptor func(interface{}) bool // Payload defines an object that contains a ledger block type Payload struct { - ChainID api.ChainID // The channel's ID of the block - Data []byte // The content of the message, possibly encrypted or signed - Hash string // The message hash - SeqNum uint64 // The message sequence number + ChainID ChainID // The channel's ID of the block + Data []byte // The content of the message, possibly encrypted or signed + Hash string // The message hash + SeqNum uint64 // The message sequence number } + +// ChainID defines the identity representation of a chain +type ChainID []byte