Skip to content

Commit dadf429

Browse files
committed
Move chainID from gossip/api to gossip/common
In order to prevent import cycle when crypto commit will be introduced Change-Id: Ifdb47554180d1f92703a627349c6a39d3eb9e9d5 Signed-off-by: Yacov Manevich <[email protected]>
1 parent c08c536 commit dadf429

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

gossip/api/channel.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ limitations under the License.
1616

1717
package api
1818

19-
import "time"
19+
import (
20+
"time"
21+
22+
"github.com/hyperledger/fabric/gossip/common"
23+
)
2024

2125
// SecurityAdvisor defines an external auxiliary object
2226
// that provides security and identity related capabilities
@@ -33,7 +37,7 @@ type SecurityAdvisor interface {
3337
// ChannelNotifier is implemented by the gossip component and is used for the peer
3438
// layer to notify the gossip component of a JoinChannel event
3539
type ChannelNotifier interface {
36-
JoinChannel(joinMsg JoinChannelMessage, chainID ChainID)
40+
JoinChannel(joinMsg JoinChannelMessage, chainID common.ChainID)
3741
}
3842

3943
// JoinChannelMessage is the message that asserts a creation or mutation
@@ -48,9 +52,6 @@ type JoinChannelMessage interface {
4852
Members() []ChannelMember
4953
}
5054

51-
// ChainID defines the identity representation of a chain
52-
type ChainID []byte
53-
5455
// ChannelMember is a peer's certificate and endpoint (host:port)
5556
type ChannelMember struct {
5657
Cert PeerCert // Cert defines the certificate of the remote peer

gossip/common/common.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ limitations under the License.
1616

1717
package common
1818

19-
import "github.com/hyperledger/fabric/gossip/api"
20-
2119
// PKIidType defines the type that holds the PKI-id
2220
// which is the security identifier of a peer
2321
type PKIidType []byte
@@ -29,8 +27,11 @@ type MessageAcceptor func(interface{}) bool
2927

3028
// Payload defines an object that contains a ledger block
3129
type Payload struct {
32-
ChainID api.ChainID // The channel's ID of the block
33-
Data []byte // The content of the message, possibly encrypted or signed
34-
Hash string // The message hash
35-
SeqNum uint64 // The message sequence number
30+
ChainID ChainID // The channel's ID of the block
31+
Data []byte // The content of the message, possibly encrypted or signed
32+
Hash string // The message hash
33+
SeqNum uint64 // The message sequence number
3634
}
35+
36+
// ChainID defines the identity representation of a chain
37+
type ChainID []byte

0 commit comments

Comments
 (0)