Skip to content

Commit 31b9c40

Browse files
author
Jason Yellick
committed
[FAB-2029] Fix proto enum style
https://jira.hyperledger.org/browse/FAB-2029 Per the official proto style guide, enums should be UPPER_CASE but the current code has a mixture of UPPER_CASE and CamelCase. This is internal inconsistency is a problem, and this CR fixes the fabric protos to adhere to the official proto style. Change-Id: I95af90f29f9e8fa8a6eecbb528516cccc3187979 Signed-off-by: Jason Yellick <[email protected]>
1 parent 083e0de commit 31b9c40

32 files changed

+219
-222
lines changed

common/cauthdsl/cauthdsl_builder.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func init() {
5555
func Envelope(policy *cb.SignaturePolicy, identities [][]byte) *cb.SignaturePolicyEnvelope {
5656
ids := make([]*cb.MSPPrincipal, len(identities))
5757
for i, _ := range ids {
58-
ids[i] = &cb.MSPPrincipal{PrincipalClassification: cb.MSPPrincipal_ByIdentity, Principal: identities[i]}
58+
ids[i] = &cb.MSPPrincipal{PrincipalClassification: cb.MSPPrincipal_IDENTITY, Principal: identities[i]}
5959
}
6060

6161
return &cb.SignaturePolicyEnvelope{
@@ -79,8 +79,8 @@ func SignedBy(index int32) *cb.SignaturePolicy {
7979
func SignedByMspMember(mspId string) *cb.SignaturePolicyEnvelope {
8080
// specify the principal: it's a member of the msp we just found
8181
principal := &cb.MSPPrincipal{
82-
PrincipalClassification: cb.MSPPrincipal_ByMSPRole,
83-
Principal: utils.MarshalOrPanic(&cb.MSPRole{Role: cb.MSPRole_Member, MSPIdentifier: mspId})}
82+
PrincipalClassification: cb.MSPPrincipal_ROLE,
83+
Principal: utils.MarshalOrPanic(&cb.MSPRole{Role: cb.MSPRole_MEMBER, MSPIdentifier: mspId})}
8484

8585
// create the policy: it requires exactly 1 signature from the first (and only) principal
8686
p := &cb.SignaturePolicyEnvelope{

common/cauthdsl/policy_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func makePolicySource(policyResult bool) []byte {
6060
func addPolicy(manager *policies.ManagerImpl, id string, policy []byte) {
6161
manager.BeginConfig()
6262
err := manager.ProposeConfig(&cb.ConfigItem{
63-
Type: cb.ConfigItem_Policy,
63+
Type: cb.ConfigItem_POLICY,
6464
Key: id,
6565
Value: policy,
6666
})

common/cauthdsl/policy_util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
// TemplatePolicy creates a headerless configuration item representing a policy for a given key
2525
func TemplatePolicy(key string, sigPolicyEnv *cb.SignaturePolicyEnvelope) *cb.ConfigItem {
2626
return &cb.ConfigItem{
27-
Type: cb.ConfigItem_Policy,
27+
Type: cb.ConfigItem_POLICY,
2828
Key: key,
2929
Value: utils.MarshalOrPanic(&cb.Policy{
3030
Type: int32(cb.Policy_SIGNATURE),

common/cauthdsl/policyparser.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,14 @@ func secondPass(args ...interface{}) (interface{}, error) {
140140
/* get the right role */
141141
var r common.MSPRole_MSPRoleType
142142
if subm[0][3] == "member" {
143-
r = common.MSPRole_Member
143+
r = common.MSPRole_MEMBER
144144
} else {
145-
r = common.MSPRole_Admin
145+
r = common.MSPRole_ADMIN
146146
}
147147

148148
/* build the principal we've been told */
149149
p := &common.MSPPrincipal{
150-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
150+
PrincipalClassification: common.MSPPrincipal_ROLE,
151151
Principal: utils.MarshalOrPanic(&common.MSPRole{MSPIdentifier: subm[0][1], Role: r})}
152152
ctx.principals = append(ctx.principals, p)
153153

common/cauthdsl/policyparser_test.go

+22-22
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ func TestAnd(t *testing.T) {
3232
principals := make([]*common.MSPPrincipal, 0)
3333

3434
principals = append(principals, &common.MSPPrincipal{
35-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
36-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "A"})})
35+
PrincipalClassification: common.MSPPrincipal_ROLE,
36+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "A"})})
3737

3838
principals = append(principals, &common.MSPPrincipal{
39-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
40-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "B"})})
39+
PrincipalClassification: common.MSPPrincipal_ROLE,
40+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "B"})})
4141

4242
p2 := &common.SignaturePolicyEnvelope{
4343
Version: 0,
@@ -55,12 +55,12 @@ func TestOr(t *testing.T) {
5555
principals := make([]*common.MSPPrincipal, 0)
5656

5757
principals = append(principals, &common.MSPPrincipal{
58-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
59-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "A"})})
58+
PrincipalClassification: common.MSPPrincipal_ROLE,
59+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "A"})})
6060

6161
principals = append(principals, &common.MSPPrincipal{
62-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
63-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "B"})})
62+
PrincipalClassification: common.MSPPrincipal_ROLE,
63+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "B"})})
6464

6565
p2 := &common.SignaturePolicyEnvelope{
6666
Version: 0,
@@ -78,16 +78,16 @@ func TestComplex1(t *testing.T) {
7878
principals := make([]*common.MSPPrincipal, 0)
7979

8080
principals = append(principals, &common.MSPPrincipal{
81-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
82-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "B"})})
81+
PrincipalClassification: common.MSPPrincipal_ROLE,
82+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "B"})})
8383

8484
principals = append(principals, &common.MSPPrincipal{
85-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
86-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "C"})})
85+
PrincipalClassification: common.MSPPrincipal_ROLE,
86+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "C"})})
8787

8888
principals = append(principals, &common.MSPPrincipal{
89-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
90-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "A"})})
89+
PrincipalClassification: common.MSPPrincipal_ROLE,
90+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "A"})})
9191

9292
p2 := &common.SignaturePolicyEnvelope{
9393
Version: 0,
@@ -105,20 +105,20 @@ func TestComplex2(t *testing.T) {
105105
principals := make([]*common.MSPPrincipal, 0)
106106

107107
principals = append(principals, &common.MSPPrincipal{
108-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
109-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "A"})})
108+
PrincipalClassification: common.MSPPrincipal_ROLE,
109+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "A"})})
110110

111111
principals = append(principals, &common.MSPPrincipal{
112-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
113-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "B"})})
112+
PrincipalClassification: common.MSPPrincipal_ROLE,
113+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "B"})})
114114

115115
principals = append(principals, &common.MSPPrincipal{
116-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
117-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Admin, MSPIdentifier: "C"})})
116+
PrincipalClassification: common.MSPPrincipal_ROLE,
117+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_ADMIN, MSPIdentifier: "C"})})
118118

119119
principals = append(principals, &common.MSPPrincipal{
120-
PrincipalClassification: common.MSPPrincipal_ByMSPRole,
121-
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_Member, MSPIdentifier: "D"})})
120+
PrincipalClassification: common.MSPPrincipal_ROLE,
121+
Principal: utils.MarshalOrPanic(&common.MSPRole{Role: common.MSPRole_MEMBER, MSPIdentifier: "D"})})
122122

123123
p2 := &common.SignaturePolicyEnvelope{
124124
Version: 0,

common/chainconfig/chainconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ func (pm *DescriptorImpl) CommitConfig() {
123123

124124
// ProposeConfig is used to add new config to the config proposal
125125
func (pm *DescriptorImpl) ProposeConfig(configItem *cb.ConfigItem) error {
126-
if configItem.Type != cb.ConfigItem_Chain {
126+
if configItem.Type != cb.ConfigItem_CHAIN {
127127
return fmt.Errorf("Expected type of ConfigItem_Chain, got %v", configItem.Type)
128128
}
129129

common/chainconfig/chainconfig_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ func init() {
3131

3232
func makeInvalidConfigItem(key string) *cb.ConfigItem {
3333
return &cb.ConfigItem{
34-
Type: cb.ConfigItem_Chain,
34+
Type: cb.ConfigItem_CHAIN,
3535
Key: key,
3636
Value: []byte("Garbage Data"),
3737
}

common/chainconfig/chainconfig_util.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const defaultHashingAlgorithm = SHA3Shake256
2828
// TemplateHashingAlgorithm creates a headerless config item representing the hashing algorithm
2929
func TemplateHashingAlgorithm(name string) *cb.ConfigItem {
3030
return &cb.ConfigItem{
31-
Type: cb.ConfigItem_Chain,
31+
Type: cb.ConfigItem_CHAIN,
3232
Key: HashingAlgorithmKey,
3333
Value: utils.MarshalOrPanic(&cb.HashingAlgorithm{Name: name}),
3434
}
@@ -45,7 +45,7 @@ const defaultBlockDataHashingStructureWidth = math.MaxUint32
4545
// TemplateBlockDataHashingStructure creates a headerless config item representing the block data hashing structure
4646
func TemplateBlockDataHashingStructure(width uint32) *cb.ConfigItem {
4747
return &cb.ConfigItem{
48-
Type: cb.ConfigItem_Chain,
48+
Type: cb.ConfigItem_CHAIN,
4949
Key: BlockDataHashingStructureKey,
5050
Value: utils.MarshalOrPanic(&cb.BlockDataHashingStructure{Width: width}),
5151
}
@@ -61,7 +61,7 @@ var defaultOrdererAddresses = []string{"127.0.0.1:7050"}
6161
// TemplateOrdererAddressess creates a headerless config item representing the orderer addresses
6262
func TemplateOrdererAddresses(addresses []string) *cb.ConfigItem {
6363
return &cb.ConfigItem{
64-
Type: cb.ConfigItem_Chain,
64+
Type: cb.ConfigItem_CHAIN,
6565
Key: OrdererAddressesKey,
6666
Value: utils.MarshalOrPanic(&cb.OrdererAddresses{Addresses: addresses}),
6767
}

common/configtx/handlers/application/sharedconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ func (di *SharedConfigImpl) CommitConfig() {
8484

8585
// ProposeConfig is used to add new config to the config proposal
8686
func (di *SharedConfigImpl) ProposeConfig(configItem *cb.ConfigItem) error {
87-
if configItem.Type != cb.ConfigItem_Peer {
87+
if configItem.Type != cb.ConfigItem_PEER {
8888
return fmt.Errorf("Expected type of ConfigItem_Peer, got %v", configItem.Type)
8989
}
9090

common/configtx/handlers/application/sharedconfig_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func init() {
3333

3434
func makeInvalidConfigItem(key string) *cb.ConfigItem {
3535
return &cb.ConfigItem{
36-
Type: cb.ConfigItem_Peer,
36+
Type: cb.ConfigItem_PEER,
3737
Key: key,
3838
Value: []byte("Garbage Data"),
3939
}

common/configtx/handlers/application/sharedconfig_util.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var defaultAnchorPeers = []*pb.AnchorPeer{}
2727
// TemplateAnchorPeers creates a headerless config item representing the anchor peers
2828
func TemplateAnchorPeers(anchorPeers []*pb.AnchorPeer) *cb.ConfigItem {
2929
return &cb.ConfigItem{
30-
Type: cb.ConfigItem_Peer,
30+
Type: cb.ConfigItem_PEER,
3131
Key: AnchorPeersKey,
3232
Value: utils.MarshalOrPanic(&pb.AnchorPeers{AnchorPeers: anchorPeers}),
3333
}

common/configtx/handlers/orderer/sharedconfig.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (pm *ManagerImpl) CommitConfig() {
143143

144144
// ProposeConfig is used to add new config to the config proposal
145145
func (pm *ManagerImpl) ProposeConfig(configItem *cb.ConfigItem) error {
146-
if configItem.Type != cb.ConfigItem_Orderer {
146+
if configItem.Type != cb.ConfigItem_ORDERER {
147147
return fmt.Errorf("Expected type of ConfigItem_Orderer, got %v", configItem.Type)
148148
}
149149

common/configtx/handlers/orderer/sharedconfig_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func init() {
3737

3838
func invalidMessage(key string) *cb.ConfigItem {
3939
return &cb.ConfigItem{
40-
Type: cb.ConfigItem_Orderer,
40+
Type: cb.ConfigItem_ORDERER,
4141
Key: key,
4242
Value: []byte("Garbage Data"),
4343
}

common/configtx/handlers/orderer/sharedconfig_util.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
// TemplateConsensusType creates a headerless config item representing the consensus type
2626
func TemplateConsensusType(typeValue string) *cb.ConfigItem {
2727
return &cb.ConfigItem{
28-
Type: cb.ConfigItem_Orderer,
28+
Type: cb.ConfigItem_ORDERER,
2929
Key: ConsensusTypeKey,
3030
Value: utils.MarshalOrPanic(&ab.ConsensusType{Type: typeValue}),
3131
}
@@ -34,7 +34,7 @@ func TemplateConsensusType(typeValue string) *cb.ConfigItem {
3434
// TemplateBatchSize creates a headerless config item representing the batch size
3535
func TemplateBatchSize(batchSize *ab.BatchSize) *cb.ConfigItem {
3636
return &cb.ConfigItem{
37-
Type: cb.ConfigItem_Orderer,
37+
Type: cb.ConfigItem_ORDERER,
3838
Key: BatchSizeKey,
3939
Value: utils.MarshalOrPanic(batchSize),
4040
}
@@ -43,7 +43,7 @@ func TemplateBatchSize(batchSize *ab.BatchSize) *cb.ConfigItem {
4343
// TemplateBatchTimeout creates a headerless config item representing the batch timeout
4444
func TemplateBatchTimeout(batchTimeout string) *cb.ConfigItem {
4545
return &cb.ConfigItem{
46-
Type: cb.ConfigItem_Orderer,
46+
Type: cb.ConfigItem_ORDERER,
4747
Key: BatchTimeoutKey,
4848
Value: utils.MarshalOrPanic(&ab.BatchTimeout{Timeout: batchTimeout}),
4949
}
@@ -52,7 +52,7 @@ func TemplateBatchTimeout(batchTimeout string) *cb.ConfigItem {
5252
// TemplateChainCreationPolicyNames creates a headerless configuraiton item representing the chain creation policy names
5353
func TemplateChainCreationPolicyNames(names []string) *cb.ConfigItem {
5454
return &cb.ConfigItem{
55-
Type: cb.ConfigItem_Orderer,
55+
Type: cb.ConfigItem_ORDERER,
5656
Key: ChainCreationPolicyNamesKey,
5757
Value: utils.MarshalOrPanic(&ab.ChainCreationPolicyNames{Names: names}),
5858
}
@@ -61,7 +61,7 @@ func TemplateChainCreationPolicyNames(names []string) *cb.ConfigItem {
6161
// TemplateIngressPolicyNames creates a headerless config item representing the ingress policy names
6262
func TemplateIngressPolicyNames(names []string) *cb.ConfigItem {
6363
return &cb.ConfigItem{
64-
Type: cb.ConfigItem_Orderer,
64+
Type: cb.ConfigItem_ORDERER,
6565
Key: IngressPolicyNamesKey,
6666
Value: utils.MarshalOrPanic(&ab.IngressPolicyNames{Names: names}),
6767
}
@@ -70,7 +70,7 @@ func TemplateIngressPolicyNames(names []string) *cb.ConfigItem {
7070
// TemplateEgressPolicyNames creates a headerless config item representing the egress policy names
7171
func TemplateEgressPolicyNames(names []string) *cb.ConfigItem {
7272
return &cb.ConfigItem{
73-
Type: cb.ConfigItem_Orderer,
73+
Type: cb.ConfigItem_ORDERER,
7474
Key: EgressPolicyNamesKey,
7575
Value: utils.MarshalOrPanic(&ab.EgressPolicyNames{Names: names}),
7676
}
@@ -79,7 +79,7 @@ func TemplateEgressPolicyNames(names []string) *cb.ConfigItem {
7979
// TemplateKafkaBrokers creates a headerless config item representing the kafka brokers
8080
func TemplateKafkaBrokers(brokers []string) *cb.ConfigItem {
8181
return &cb.ConfigItem{
82-
Type: cb.ConfigItem_Orderer,
82+
Type: cb.ConfigItem_ORDERER,
8383
Key: KafkaBrokersKey,
8484
Value: utils.MarshalOrPanic(&ab.KafkaBrokers{Brokers: brokers}),
8585
}

common/configtx/inspector/orderer_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ func viewableBatchSize(name string, batchSize *ab.BatchSize) Viewable {
147147
}
148148

149149
func init() {
150-
typeMap[cb.ConfigItem_Orderer] = ordererTypes{}
150+
typeMap[cb.ConfigItem_ORDERER] = ordererTypes{}
151151
}

common/configtx/inspector/policy_types.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ func viewableSignaturePolicyEnvelope(name string, signaturePolicyEnvelope *cb.Si
5959
}
6060

6161
func init() {
62-
typeMap[cb.ConfigItem_Policy] = policyTypes{}
62+
typeMap[cb.ConfigItem_POLICY] = policyTypes{}
6363
}

common/configtx/resources.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,9 @@ func NewInitializer() api.Initializer {
7676
for ctype := range cb.ConfigItem_ConfigType_name {
7777
rtype := cb.ConfigItem_ConfigType(ctype)
7878
switch rtype {
79-
case cb.ConfigItem_Chain:
79+
case cb.ConfigItem_CHAIN:
8080
handlers[rtype] = chainConfig
81-
case cb.ConfigItem_Policy:
81+
case cb.ConfigItem_POLICY:
8282
handlers[rtype] = policyManager
8383
case cb.ConfigItem_MSP:
8484
handlers[rtype] = mspConfigHandler

common/configtx/template.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ func (st *simpleTemplate) Envelope(chainID string) (*cb.ConfigEnvelope, error) {
6363
for _, item := range st.items {
6464
var values map[string]*cb.ConfigValue
6565
switch item.Type {
66-
case cb.ConfigItem_Peer:
66+
case cb.ConfigItem_PEER:
6767
values = channel.Groups[ApplicationGroup].Values
68-
case cb.ConfigItem_Orderer:
68+
case cb.ConfigItem_ORDERER:
6969
values = channel.Groups[OrdererGroup].Values
70-
case cb.ConfigItem_Chain:
70+
case cb.ConfigItem_CHAIN:
7171
values = channel.Values
72-
case cb.ConfigItem_Policy:
72+
case cb.ConfigItem_POLICY:
7373
logger.Debugf("Templating about policy %s", item.Key)
7474
policy := &cb.Policy{}
7575
err := proto.Unmarshal(item.Value, policy)
@@ -190,7 +190,7 @@ func (ct *compositeTemplate) Envelope(chainID string) (*cb.ConfigEnvelope, error
190190
// a CompositeTemplate will invalidate the CreationPolicy
191191
func NewChainCreationTemplate(creationPolicy string, template Template) Template {
192192
creationPolicyTemplate := NewSimpleTemplate(&cb.ConfigItem{
193-
Type: cb.ConfigItem_Orderer,
193+
Type: cb.ConfigItem_ORDERER,
194194
Key: CreationPolicyKey,
195195
Value: utils.MarshalOrPanic(&ab.CreationPolicy{
196196
Policy: creationPolicy,

common/configtx/template_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ func verifyItemsResult(t *testing.T, template Template, count int) {
5757

5858
func TestSimpleTemplate(t *testing.T) {
5959
simple := NewSimpleTemplate(
60-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "0"},
61-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "1"},
60+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "0"},
61+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "1"},
6262
)
6363
verifyItemsResult(t, simple, 2)
6464
}
6565

6666
func TestCompositeTemplate(t *testing.T) {
6767
composite := NewCompositeTemplate(
6868
NewSimpleTemplate(
69-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "0"},
70-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "1"},
69+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "0"},
70+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "1"},
7171
),
7272
NewSimpleTemplate(
73-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "2"},
73+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "2"},
7474
),
7575
)
7676

@@ -79,8 +79,8 @@ func TestCompositeTemplate(t *testing.T) {
7979

8080
func TestNewChainTemplate(t *testing.T) {
8181
simple := NewSimpleTemplate(
82-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "0"},
83-
&cb.ConfigItem{Type: cb.ConfigItem_Orderer, Key: "1"},
82+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "0"},
83+
&cb.ConfigItem{Type: cb.ConfigItem_ORDERER, Key: "1"},
8484
)
8585

8686
creationPolicy := "Test"

0 commit comments

Comments
 (0)