Skip to content

Commit 81f742f

Browse files
committed
[FAB-14324] unexport OrdererRootCAsByChain
Change-Id: I83b36c1a6a6eefd4592f482d8d8e1541c5bd7469 Signed-off-by: Matthew Sykes <sykesmat@us.ibm.com>
1 parent eaa1141 commit 81f742f

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

core/comm/connection.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var commLogger = flogging.MustGetLogger("comm")
2424
type CredentialSupport struct {
2525
mutex sync.RWMutex
2626
appRootCAsByChain map[string][][]byte
27-
OrdererRootCAsByChain map[string][][]byte
27+
ordererRootCAsByChain map[string][][]byte
2828
ServerRootCAs [][]byte
2929
clientCert tls.Certificate
3030
}
@@ -33,7 +33,7 @@ type CredentialSupport struct {
3333
func NewCredentialSupport() *CredentialSupport {
3434
return &CredentialSupport{
3535
appRootCAsByChain: make(map[string][][]byte),
36-
OrdererRootCAsByChain: make(map[string][][]byte),
36+
ordererRootCAsByChain: make(map[string][][]byte),
3737
}
3838
}
3939

@@ -59,7 +59,7 @@ func (cs *CredentialSupport) GetDeliverServiceCredentials(channelID string) (cre
5959
cs.mutex.RLock()
6060
defer cs.mutex.RUnlock()
6161

62-
rootCACerts, exists := cs.OrdererRootCAsByChain[channelID]
62+
rootCACerts, exists := cs.ordererRootCAsByChain[channelID]
6363
if !exists {
6464
commLogger.Errorf("Attempted to obtain root CA certs of an unknown channel: %s", channelID)
6565
return nil, fmt.Errorf("didn't find any root CA certs for channel %s", channelID)
@@ -172,6 +172,6 @@ func (cs *CredentialSupport) BuildTrustedRootsForChain(cm channelconfig.Resource
172172

173173
cs.mutex.Lock()
174174
cs.appRootCAsByChain[cid] = appRootCAs
175-
cs.OrdererRootCAsByChain[cid] = ordererRootCAs
175+
cs.ordererRootCAsByChain[cid] = ordererRootCAs
176176
cs.mutex.Unlock()
177177
}

core/comm/connection_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ func loadRootCAs() [][]byte {
6767
func TestNewCredentialSupport(t *testing.T) {
6868
expected := &CredentialSupport{
6969
appRootCAsByChain: make(map[string][][]byte),
70-
OrdererRootCAsByChain: make(map[string][][]byte),
70+
ordererRootCAsByChain: make(map[string][][]byte),
7171
}
7272
assert.Equal(t, expected, NewCredentialSupport())
7373
}
@@ -82,7 +82,7 @@ func TestCredentialSupport(t *testing.T) {
8282

8383
cs := &CredentialSupport{
8484
appRootCAsByChain: make(map[string][][]byte),
85-
OrdererRootCAsByChain: make(map[string][][]byte),
85+
ordererRootCAsByChain: make(map[string][][]byte),
8686
}
8787
cert := tls.Certificate{Certificate: [][]byte{}}
8888
cs.SetClientCertificate(cert)
@@ -92,8 +92,8 @@ func TestCredentialSupport(t *testing.T) {
9292
cs.appRootCAsByChain["channel1"] = [][]byte{rootCAs[0]}
9393
cs.appRootCAsByChain["channel2"] = [][]byte{rootCAs[1]}
9494
cs.appRootCAsByChain["channel3"] = [][]byte{rootCAs[2]}
95-
cs.OrdererRootCAsByChain["channel1"] = [][]byte{rootCAs[3]}
96-
cs.OrdererRootCAsByChain["channel2"] = [][]byte{rootCAs[4]}
95+
cs.ordererRootCAsByChain["channel1"] = [][]byte{rootCAs[3]}
96+
cs.ordererRootCAsByChain["channel2"] = [][]byte{rootCAs[4]}
9797
cs.ServerRootCAs = [][]byte{rootCAs[5]}
9898

9999
creds, _ := cs.GetDeliverServiceCredentials("channel1")
@@ -192,13 +192,13 @@ func TestImpersonation(t *testing.T) {
192192

193193
cs := &CredentialSupport{
194194
appRootCAsByChain: make(map[string][][]byte),
195-
OrdererRootCAsByChain: make(map[string][][]byte),
195+
ordererRootCAsByChain: make(map[string][][]byte),
196196
}
197197
_, err := cs.GetDeliverServiceCredentials("C")
198198
assert.Error(t, err)
199199

200-
cs.OrdererRootCAsByChain["A"] = [][]byte{osA.caCert}
201-
cs.OrdererRootCAsByChain["B"] = [][]byte{osB.caCert}
200+
cs.ordererRootCAsByChain["A"] = [][]byte{osA.caCert}
201+
cs.ordererRootCAsByChain["B"] = [][]byte{osB.caCert}
202202

203203
var tests = []struct {
204204
channel string

0 commit comments

Comments
 (0)