Skip to content

Commit

Permalink
Move chainID from gossip/api to gossip/common
Browse files Browse the repository at this point in the history
In order to prevent import cycle when crypto commit will be introduced

Change-Id: Ifdb47554180d1f92703a627349c6a39d3eb9e9d5
Signed-off-by: Yacov Manevich <yacovm@il.ibm.com>
  • Loading branch information
yacovm committed Nov 15, 2016
1 parent c08c536 commit dadf429
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
11 changes: 6 additions & 5 deletions gossip/api/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
13 changes: 7 additions & 6 deletions gossip/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit dadf429

Please sign in to comment.