Skip to content

Commit

Permalink
[FAB-1848] Fix typo AnchorPees
Browse files Browse the repository at this point in the history
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 <jyellick@us.ibm.com>
  • Loading branch information
Jason Yellick committed Jan 25, 2017
1 parent cb39a14 commit e111bac
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
4 changes: 2 additions & 2 deletions gossip/service/channel.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func JoinChannelMessageFromBlock(block *common.Block) (api.JoinChannelMessage, e
return nil, err
}
jcm := &joinChannelMessage{seqNum: block.Header.Number, anchorPeers: []api.AnchorPeer{}}
for _, ap := range anchorPeers.AnchorPees {
for _, ap := range anchorPeers.AnchorPeers {
anchorPeer := api.AnchorPeer{
Host: ap.Host,
Port: int(ap.Port),
Expand Down Expand Up @@ -99,7 +99,7 @@ func parseBlock(block *common.Block) (*peer.AnchorPeers, error) {
if err := unMarshal(rawAnchorPeersBytes, anchorPeers); err != nil {
return nil, fmt.Errorf("Failed deserializing anchor peers from configuration item")
}
if len(anchorPeers.AnchorPees) == 0 {
if len(anchorPeers.AnchorPeers) == 0 {
return nil, fmt.Errorf("AnchorPeers field in configuration block was found, but is empty")
}
return anchorPeers, nil
Expand Down
8 changes: 4 additions & 4 deletions gossip/service/channel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func TestInvalidJoinChannelBlock(t *testing.T) {
host := "localhost"
port := 5611
anchorPeers := &peer.AnchorPeers{
AnchorPees: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
AnchorPeers: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
}
confItem1 := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
confItem2 := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
Expand All @@ -105,7 +105,7 @@ func TestInvalidJoinChannelBlock(t *testing.T) {

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

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

func createValidJoinChanMessage(t *testing.T, seqNum int, host string, port int, cert []byte) *common.Block {
anchorPeers := &peer.AnchorPeers{
AnchorPees: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
AnchorPeers: []*peer.AnchorPeer{{Cert: cert, Host: host, Port: int32(port)}},
}
confItem := createAnchorPeerConfItem(t, anchorPeers, utils.AnchorPeerConfItemKey)
block, err := genesis.NewFactoryImpl(configtx.NewSimpleTemplate(confItem)).Block("TEST")
Expand Down
28 changes: 14 additions & 14 deletions protos/peer/configuration.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protos/peer/configuration.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package protos;

// AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem
message AnchorPeers {
repeated AnchorPeer anchorPees = 1;
repeated AnchorPeer anchorPeers = 1;
}

// AnchorPeer message structure which provides information about anchor peer, it includes host name,
Expand Down
2 changes: 1 addition & 1 deletion protos/utils/blockutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ func EncodeMSP(chainID string) *cb.SignedConfigurationItem {
// EncodeAnchorPeers returns a configuration item with anchor peers
func EncodeAnchorPeers() *cb.ConfigurationItem {
anchorPeers := &peer.AnchorPeers{
AnchorPees: []*peer.AnchorPeer{{Cert: []byte("cert"), Host: "fakeHost", Port: int32(5611)}},
AnchorPeers: []*peer.AnchorPeer{{Cert: []byte("cert"), Host: "fakeHost", Port: int32(5611)}},
}
rawAnchorPeers := MarshalOrPanic(anchorPeers)
// We don't populate the chainID because that value is over-written later on anyway
Expand Down

0 comments on commit e111bac

Please sign in to comment.