Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Commit f662850

Browse files
committed
[FAB-8866] Rename MspID to MSPID
Change-Id: I09f9f88d0a79250eaafe8346f47689fc00c948b7 Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent a854819 commit f662850

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+143
-143
lines changed

pkg/client/channel/api_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestWithTargetURLsValid(t *testing.T) {
4444

4545
npConfig1 := core.NetworkPeer{
4646
PeerConfig: pConfig1,
47-
MspID: "MYMSP",
47+
MSPID: "MYMSP",
4848
}
4949

5050
pConfig2 := core.PeerConfig{
@@ -53,7 +53,7 @@ func TestWithTargetURLsValid(t *testing.T) {
5353

5454
npConfig2 := core.NetworkPeer{
5555
PeerConfig: pConfig2,
56-
MspID: "OTHERMSP",
56+
MSPID: "OTHERMSP",
5757
}
5858

5959
mockConfig.SetCustomPeerCfg(&pConfig1)
@@ -66,7 +66,7 @@ func TestWithTargetURLsValid(t *testing.T) {
6666

6767
assert.Equal(t, 1, len(opts.Targets), "should have one peer")
6868
assert.Equal(t, pConfig1.URL, opts.Targets[0].URL(), "", "Wrong URL")
69-
assert.Equal(t, npConfig1.MspID, opts.Targets[0].MSPID(), "", "Wrong MSP")
69+
assert.Equal(t, npConfig1.MSPID, opts.Targets[0].MSPID(), "", "Wrong MSP")
7070
}
7171

7272
func setupMockTestContext(userName string, mspID string) *fcmocks.MockContext {

pkg/client/ledger/ledger.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func New(channelProvider context.ChannelProvider, opts ...ClientOption) (*Client
8181
// check if target filter was set - if not set the default
8282
if ledgerClient.filter == nil {
8383
// Default target filter is based on user msp
84-
if channelContext.MspID() == "" {
84+
if channelContext.MSPID() == "" {
8585
return nil, errors.New("mspID not available in user context")
8686
}
87-
filter := &mspFilter{mspID: channelContext.MspID()}
87+
filter := &mspFilter{mspID: channelContext.MSPID()}
8888
ledgerClient.filter = filter
8989
}
9090

pkg/client/ledger/opts_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestWithTargetURLsValid(t *testing.T) {
4444

4545
npConfig1 := core.NetworkPeer{
4646
PeerConfig: pConfig1,
47-
MspID: "MYMSP",
47+
MSPID: "MYMSP",
4848
}
4949

5050
pConfig2 := core.PeerConfig{
@@ -53,7 +53,7 @@ func TestWithTargetURLsValid(t *testing.T) {
5353

5454
npConfig2 := core.NetworkPeer{
5555
PeerConfig: pConfig2,
56-
MspID: "OTHERMSP",
56+
MSPID: "OTHERMSP",
5757
}
5858

5959
mockConfig.SetCustomPeerCfg(&pConfig1)
@@ -66,7 +66,7 @@ func TestWithTargetURLsValid(t *testing.T) {
6666

6767
assert.Equal(t, 1, len(opts.Targets), "should have one peer")
6868
assert.Equal(t, pConfig1.URL, opts.Targets[0].URL(), "", "Wrong URL")
69-
assert.Equal(t, npConfig1.MspID, opts.Targets[0].MSPID(), "", "Wrong MSP")
69+
assert.Equal(t, npConfig1.MSPID, opts.Targets[0].MSPID(), "", "Wrong MSP")
7070
}
7171

7272
func setupTestContext(userName string, mspID string) *fcmocks.MockContext {

pkg/client/msp/msp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ func (c *Client) GetSigningIdentity(userName string) (*SigningIdentity, error) {
189189
}
190190
return nil, err
191191
}
192-
signingIdentity := &SigningIdentity{MspID: user.MspID(), PrivateKey: user.PrivateKey(), EnrollmentCert: user.EnrollmentCertificate()}
192+
signingIdentity := &SigningIdentity{MSPID: user.MSPID(), PrivateKey: user.PrivateKey(), EnrollmentCert: user.EnrollmentCertificate()}
193193
return signingIdentity, nil
194194
}
195195

pkg/client/msp/msp_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func TestMSP(t *testing.T) {
8282
t.Fatalf("Enrolled user name doesn't match")
8383
}
8484

85-
if enrolledUser.MspID() != "Org1MSP" {
85+
if enrolledUser.MSPID() != "Org1MSP" {
8686
t.Fatalf("Enrolled user mspID doesn't match")
8787
}
8888

@@ -123,7 +123,7 @@ func TestMSP(t *testing.T) {
123123
t.Fatalf("Enrolled user name doesn't match")
124124
}
125125

126-
if org2EnrolledUser.MspID() != "Org2MSP" {
126+
if org2EnrolledUser.MSPID() != "Org2MSP" {
127127
t.Fatalf("Enrolled user mspID doesn't match")
128128
}
129129

@@ -194,7 +194,7 @@ func myMSPID(t *testing.T, c core.Config) string {
194194
if !ok {
195195
t.Fatalf("org config retrieval failed: %v", err)
196196
}
197-
return orgConfig.MspID
197+
return orgConfig.MSPID
198198
}
199199

200200
func randomUserName() string {

pkg/client/msp/user.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ var (
1818

1919
// Identity supplies the serialized identity and key reference.
2020
type Identity interface {
21-
MspID() string
21+
MSPID() string
2222
SerializedIdentity() ([]byte, error)
2323
PrivateKey() core.Key
2424
}
2525

2626
// SigningIdentity is the identity object that encapsulates the user's private key for signing
2727
// and the user's enrollment certificate (identity)
2828
type SigningIdentity struct {
29-
MspID string
29+
MSPID string
3030
EnrollmentCert []byte
3131
PrivateKey core.Key
3232
}
@@ -52,7 +52,7 @@ type IdentityManager interface {
5252
// An application cannot use the Peer identity to sign things because the application doesn’t
5353
// have access to the Peer identity’s private key.
5454
type User interface {
55-
MspID() string
55+
MSPID() string
5656
Name() string
5757
SerializedIdentity() ([]byte, error)
5858
PrivateKey() core.Key
@@ -63,7 +63,7 @@ type User interface {
6363
// PrivateKey is stored separately, in the crypto store
6464
type UserData struct {
6565
Name string
66-
MspID string
66+
MSPID string
6767
EnrollmentCertificate []byte
6868
}
6969

@@ -75,19 +75,19 @@ type UserStore interface {
7575

7676
// UserIdentifier is the User's unique identifier
7777
type UserIdentifier struct {
78-
MspID string
78+
MSPID string
7979
Name string
8080
}
8181

8282
// PrivKeyKey is a composite key for accessing a private key in the key store
8383
type PrivKeyKey struct {
84-
MspID string
84+
MSPID string
8585
UserName string
8686
SKI []byte
8787
}
8888

8989
// CertKey is a composite key for accessing a cert in the cert store
9090
type CertKey struct {
91-
MspID string
91+
MSPID string
9292
UserName string
9393
}

pkg/client/resmgmt/opts_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestWithTargetURLsValid(t *testing.T) {
4444

4545
npConfig1 := core.NetworkPeer{
4646
PeerConfig: pConfig1,
47-
MspID: "MYMSP",
47+
MSPID: "MYMSP",
4848
}
4949

5050
pConfig2 := core.PeerConfig{
@@ -53,7 +53,7 @@ func TestWithTargetURLsValid(t *testing.T) {
5353

5454
npConfig2 := core.NetworkPeer{
5555
PeerConfig: pConfig2,
56-
MspID: "OTHERMSP",
56+
MSPID: "OTHERMSP",
5757
}
5858

5959
mockConfig.SetCustomPeerCfg(&pConfig1)
@@ -66,5 +66,5 @@ func TestWithTargetURLsValid(t *testing.T) {
6666

6767
assert.Equal(t, 1, len(opts.Targets), "should have one peer")
6868
assert.Equal(t, pConfig1.URL, opts.Targets[0].URL(), "", "Wrong URL")
69-
assert.Equal(t, npConfig1.MspID, opts.Targets[0].MSPID(), "", "Wrong MSP")
69+
assert.Equal(t, npConfig1.MSPID, opts.Targets[0].MSPID(), "", "Wrong MSP")
7070
}

pkg/client/resmgmt/resmgmt.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@ func New(clientProvider context.ClientProvider, opts ...ClientOption) (*Client,
154154
//check if target filter was set - if not set the default
155155
if resourceClient.filter == nil {
156156
// Default target filter is based on user msp
157-
if ctx.MspID() == "" {
157+
if ctx.MSPID() == "" {
158158
return nil, errors.New("mspID not available in user context")
159159
}
160-
rcFilter := &mspFilter{mspID: ctx.MspID()}
160+
rcFilter := &mspFilter{mspID: ctx.MSPID()}
161161
resourceClient.filter = rcFilter
162162
}
163163
return resourceClient, nil

pkg/client/resmgmt/resmgmt_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func TestJoinChannelWithOptsRequiredParameters(t *testing.T) {
212212
peers = append(peers, peer1)
213213

214214
// Test both targets and filter provided (error condition)
215-
err = rc.JoinChannel("mychannel", WithTargets(peers...), WithTargetFilter(&mspFilter{mspID: "MspID"}))
215+
err = rc.JoinChannel("mychannel", WithTargets(peers...), WithTargetFilter(&mspFilter{mspID: "MSPID"}))
216216
if err == nil || !strings.Contains(err.Error(), "If targets are provided, filter cannot be provided") {
217217
t.Fatalf("Should have failed if both target and filter provided")
218218
}
@@ -224,7 +224,7 @@ func TestJoinChannelWithOptsRequiredParameters(t *testing.T) {
224224
}
225225

226226
// Test filter only (filter has no match)
227-
err = rc.JoinChannel("mychannel", WithTargetFilter(&mspFilter{mspID: "MspID"}))
227+
err = rc.JoinChannel("mychannel", WithTargetFilter(&mspFilter{mspID: "MSPID"}))
228228
if err == nil || !strings.Contains(err.Error(), "No targets available") {
229229
t.Fatalf("InstallCC should have failed with no targets error")
230230
}

pkg/common/context/mocks/mockcontext.gen.go

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)