Skip to content

Commit e111bac

Browse files
author
Jason Yellick
committed
[FAB-1848] Fix typo AnchorPees
https://jira.hyperledger.org/browse/FAB-1848 There is a typo in the peer/configuration.proto where instead of specifying AnchorPeers, it specifies AnchorPees. This CR fixes that. Change-Id: I97333f76c838850d1891048ea9e33d826716519e Signed-off-by: Jason Yellick <[email protected]>
1 parent cb39a14 commit e111bac

File tree

5 files changed

+22
-22
lines changed

5 files changed

+22
-22
lines changed

gossip/service/channel.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func JoinChannelMessageFromBlock(block *common.Block) (api.JoinChannelMessage, e
4949
return nil, err
5050
}
5151
jcm := &joinChannelMessage{seqNum: block.Header.Number, anchorPeers: []api.AnchorPeer{}}
52-
for _, ap := range anchorPeers.AnchorPees {
52+
for _, ap := range anchorPeers.AnchorPeers {
5353
anchorPeer := api.AnchorPeer{
5454
Host: ap.Host,
5555
Port: int(ap.Port),
@@ -99,7 +99,7 @@ func parseBlock(block *common.Block) (*peer.AnchorPeers, error) {
9999
if err := unMarshal(rawAnchorPeersBytes, anchorPeers); err != nil {
100100
return nil, fmt.Errorf("Failed deserializing anchor peers from configuration item")
101101
}
102-
if len(anchorPeers.AnchorPees) == 0 {
102+
if len(anchorPeers.AnchorPeers) == 0 {
103103
return nil, fmt.Errorf("AnchorPeers field in configuration block was found, but is empty")
104104
}
105105
return anchorPeers, nil

gossip/service/channel_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestInvalidJoinChannelBlock(t *testing.T) {
9494
host := "localhost"
9595
port := 5611
9696
anchorPeers := &peer.AnchorPeers{
97-
AnchorPees: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
97+
AnchorPeers: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
9898
}
9999
confItem1 := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
100100
confItem2 := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
@@ -105,7 +105,7 @@ func TestInvalidJoinChannelBlock(t *testing.T) {
105105

106106
noAnchorPeers := func(_ *common.Block) *common.Block {
107107
anchorPeers := &peer.AnchorPeers{
108-
AnchorPees: []*peer.AnchorPeer{},
108+
AnchorPeers: []*peer.AnchorPeer{},
109109
}
110110
confItem := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
111111
block, _ := genesis.NewFactoryImpl(configtx.NewSimpleTemplate(confItem)).Block("TEST")
@@ -115,7 +115,7 @@ func TestInvalidJoinChannelBlock(t *testing.T) {
115115

116116
noAnchorPeerItemType := func(_ *common.Block) *common.Block {
117117
anchorPeers := &peer.AnchorPeers{
118-
AnchorPees: []*peer.AnchorPeer{},
118+
AnchorPeers: []*peer.AnchorPeer{},
119119
}
120120
confItem := createAnchorPeerConfItem(t, anchorPeers, "MSP configuration")
121121
block, _ := genesis.NewFactoryImpl(configtx.NewSimpleTemplate(confItem)).Block("TEST")
@@ -154,7 +154,7 @@ func testJoinChannelFails(t *testing.T, invalidator blockInvalidator, unMarshall
154154

155155
func createValidJoinChanMessage(t *testing.T, seqNum int, host string, port int, cert []byte) *common.Block {
156156
anchorPeers := &peer.AnchorPeers{
157-
AnchorPees: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
157+
AnchorPeers: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
158158
}
159159
confItem := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
160160
block, err := genesis.NewFactoryImpl(configtx.NewSimpleTemplate(confItem)).Block("TEST")

protos/peer/configuration.pb.go

+14-14
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protos/peer/configuration.proto

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ package protos;
2222

2323
// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem
2424
message AnchorPeers {
25-
repeated AnchorPeer anchorPees = 1;
25+
repeated AnchorPeer anchorPeers = 1;
2626
}
2727

2828
// AnchorPeer message structure which provides information about anchor peer, it includes host name,

protos/utils/blockutils.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func EncodeMSP(chainID string) *cb.SignedConfigurationItem {
198198
// EncodeAnchorPeers returns a configuration item with anchor peers
199199
func EncodeAnchorPeers() *cb.ConfigurationItem {
200200
anchorPeers := &peer.AnchorPeers{
201-
AnchorPees: []*peer.AnchorPeer{{Cert: []byte("cert"), Host: "fakeHost", Port: int32(5611)}},
201+
AnchorPeers: []*peer.AnchorPeer{{Cert: []byte("cert"), Host: "fakeHost", Port: int32(5611)}},
202202
}
203203
rawAnchorPeers := MarshalOrPanic(anchorPeers)
204204
// We don't populate the chainID because that value is over-written later on anyway

0 commit comments

Comments
 (0)