From e111bacbc0d6900d6963c2d2de6238bbcfd55fd7 Mon Sep 17 00:00:00 2001 From: Jason Yellick Date: Wed, 25 Jan 2017 11:17:44 -0500 Subject: [PATCH] [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 --- gossip/service/channel.go | 4 ++-- gossip/service/channel_test.go | 8 ++++---- protos/peer/configuration.pb.go | 28 ++++++++++++++-------------- protos/peer/configuration.proto | 2 +- protos/utils/blockutils.go | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gossip/service/channel.go b/gossip/service/channel.go index 428b3df4ce1..201b1ad2799 100644 --- a/gossip/service/channel.go +++ b/gossip/service/channel.go @@ -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), @@ -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 diff --git a/gossip/service/channel_test.go b/gossip/service/channel_test.go index 1cb9f9096c2..abb54cea4a5 100644 --- a/gossip/service/channel_test.go +++ b/gossip/service/channel_test.go @@ -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) @@ -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") @@ -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") @@ -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") diff --git a/protos/peer/configuration.pb.go b/protos/peer/configuration.pb.go index 88219a17b04..b0d0f140541 100644 --- a/protos/peer/configuration.pb.go +++ b/protos/peer/configuration.pb.go @@ -15,7 +15,7 @@ var _ = math.Inf // AnchorPeers simply represents list of anchor peers which is used in ConfigurationItem type AnchorPeers struct { - AnchorPees []*AnchorPeer `protobuf:"bytes,1,rep,name=anchorPees" json:"anchorPees,omitempty"` + AnchorPeers []*AnchorPeer `protobuf:"bytes,1,rep,name=anchorPeers" json:"anchorPeers,omitempty"` } func (m *AnchorPeers) Reset() { *m = AnchorPeers{} } @@ -23,9 +23,9 @@ func (m *AnchorPeers) String() string { return proto.CompactTextStrin func (*AnchorPeers) ProtoMessage() {} func (*AnchorPeers) Descriptor() ([]byte, []int) { return fileDescriptor3, []int{0} } -func (m *AnchorPeers) GetAnchorPees() []*AnchorPeer { +func (m *AnchorPeers) GetAnchorPeers() []*AnchorPeer { if m != nil { - return m.AnchorPees + return m.AnchorPeers } return nil } @@ -57,15 +57,15 @@ func init() { proto.RegisterFile("peer/configuration.proto", fileDescriptor3) } var fileDescriptor3 = []byte{ // 188 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x4c, 0x8f, 0x31, 0x6f, 0x83, 0x30, - 0x10, 0x85, 0xe5, 0xd2, 0x56, 0xaa, 0xe9, 0xe4, 0xc9, 0xa3, 0xc5, 0xe4, 0xaa, 0x12, 0x96, 0xe8, - 0x2f, 0xa0, 0x59, 0x18, 0x91, 0xc7, 0x6c, 0xe0, 0x1c, 0x60, 0x29, 0xe1, 0xd0, 0xd9, 0x0c, 0xf9, - 0xf7, 0x11, 0x46, 0x11, 0x99, 0xee, 0xbb, 0x77, 0xef, 0xa4, 0xf7, 0xb8, 0x5c, 0x00, 0xc8, 0x38, - 0x9c, 0x07, 0x3f, 0xae, 0xd4, 0x45, 0x8f, 0x73, 0xb9, 0x10, 0x46, 0x14, 0x9f, 0x69, 0x84, 0xa2, - 0xe6, 0x79, 0x3d, 0xbb, 0x09, 0xa9, 0x05, 0xa0, 0x20, 0x2a, 0xce, 0xbb, 0xe7, 0x1a, 0x24, 0x53, - 0x99, 0xce, 0x2b, 0xb1, 0xbf, 0x84, 0xf2, 0x30, 0xda, 0x17, 0x57, 0xd1, 0x70, 0x7e, 0x5c, 0x84, - 0xe0, 0xef, 0x0d, 0x86, 0x28, 0x99, 0x62, 0xfa, 0xcb, 0x26, 0xde, 0xb4, 0x16, 0x29, 0xca, 0x37, - 0xc5, 0xf4, 0x87, 0x4d, 0xbc, 0x69, 0x27, 0xa0, 0x28, 0x33, 0xc5, 0xf4, 0xb7, 0x4d, 0xfc, 0xff, - 0x7b, 0xfe, 0x19, 0x7d, 0x9c, 0xd6, 0xbe, 0x74, 0x78, 0x33, 0xd3, 0x7d, 0x01, 0xba, 0xc2, 0x65, - 0x04, 0x32, 0x43, 0xd7, 0x93, 0x77, 0x66, 0x0f, 0x62, 0xb6, 0x56, 0xfd, 0xde, 0xe0, 0xef, 0x11, - 0x00, 0x00, 0xff, 0xff, 0xc2, 0xa8, 0x53, 0x84, 0xe4, 0x00, 0x00, 0x00, + 0x10, 0x85, 0xe5, 0xd2, 0x56, 0xaa, 0xe9, 0xe4, 0xc9, 0xa3, 0xc5, 0xe4, 0xaa, 0x12, 0x96, 0x92, + 0xfc, 0x81, 0x84, 0x85, 0x11, 0x79, 0xcc, 0x06, 0xce, 0x01, 0x96, 0x12, 0x0e, 0x9d, 0xcd, 0x90, + 0x7f, 0x1f, 0x61, 0x06, 0x32, 0xdd, 0x77, 0xef, 0xde, 0x49, 0xef, 0x71, 0x39, 0x03, 0x90, 0x71, + 0x38, 0xf5, 0x7e, 0x58, 0xa8, 0x8d, 0x1e, 0xa7, 0x72, 0x26, 0x8c, 0x28, 0xbe, 0xd3, 0x08, 0x45, + 0xc5, 0xf3, 0xf3, 0xe4, 0x46, 0xa4, 0x06, 0x80, 0x82, 0x38, 0xf1, 0xbc, 0xdd, 0x57, 0xc9, 0x54, + 0xa6, 0xf3, 0x83, 0xd8, 0x7e, 0x42, 0xb9, 0x3b, 0xed, 0xbb, 0xad, 0xa8, 0x39, 0xdf, 0x4f, 0x42, + 0xf0, 0xcf, 0x1a, 0x43, 0x94, 0x4c, 0x31, 0xfd, 0x63, 0x13, 0xaf, 0x5a, 0x83, 0x14, 0xe5, 0x87, + 0x62, 0xfa, 0xcb, 0x26, 0x5e, 0xb5, 0x0a, 0x28, 0xca, 0x4c, 0x31, 0xfd, 0x6b, 0x13, 0x5f, 0xfe, + 0xaf, 0x7f, 0x83, 0x8f, 0xe3, 0xd2, 0x95, 0x0e, 0x1f, 0x66, 0x7c, 0xce, 0x40, 0x77, 0xb8, 0x0d, + 0x40, 0xa6, 0x6f, 0x3b, 0xf2, 0xce, 0x6c, 0x49, 0xcc, 0xda, 0xab, 0xdb, 0x3a, 0x1c, 0x5f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x67, 0x14, 0x11, 0x01, 0xe6, 0x00, 0x00, 0x00, } diff --git a/protos/peer/configuration.proto b/protos/peer/configuration.proto index 7dbb462a347..788659e30e3 100644 --- a/protos/peer/configuration.proto +++ b/protos/peer/configuration.proto @@ -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, diff --git a/protos/utils/blockutils.go b/protos/utils/blockutils.go index 436227fc2da..eceab42100c 100644 --- a/protos/utils/blockutils.go +++ b/protos/utils/blockutils.go @@ -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