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

Commit dfc3d5c

Browse files
committed
[FAB-9312] Resolve metalinter warnings
This change fixes MockSigningIdentity to have a pointer receiver. Change-Id: I1d5a9dbac1fdde37ab90533601af0ca9758a0058 Signed-off-by: Troy Ronda <troy@troyronda.com>
1 parent d38bc9c commit dfc3d5c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

pkg/msp/test/mockmsp/mockuser.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,46 +28,46 @@ func NewMockSigningIdentity(id string, mspid string) *MockSigningIdentity {
2828
}
2929

3030
// Identifier returns the identifier of that identity
31-
func (m MockSigningIdentity) Identifier() *msp.IdentityIdentifier {
31+
func (m *MockSigningIdentity) Identifier() *msp.IdentityIdentifier {
3232
return &msp.IdentityIdentifier{ID: m.id, MSPID: m.mspid}
3333
}
3434

3535
// Verify a signature over some message using this identity as reference
36-
func (m MockSigningIdentity) Verify(msg []byte, sig []byte) error {
36+
func (m *MockSigningIdentity) Verify(msg []byte, sig []byte) error {
3737
return nil
3838
}
3939

4040
// Serialize converts an identity to bytes
41-
func (m MockSigningIdentity) Serialize() ([]byte, error) {
41+
func (m *MockSigningIdentity) Serialize() ([]byte, error) {
4242
return []byte("test"), nil
4343
}
4444

4545
// SetEnrollmentCertificate sets yhe enrollment certificate.
46-
func (m MockSigningIdentity) SetEnrollmentCertificate(cert []byte) {
47-
m.enrollmentCertificate = cert //nolint
46+
func (m *MockSigningIdentity) SetEnrollmentCertificate(cert []byte) {
47+
m.enrollmentCertificate = cert
4848
}
4949

5050
// EnrollmentCertificate Returns the underlying ECert representing this user’s identity.
51-
func (m MockSigningIdentity) EnrollmentCertificate() []byte {
51+
func (m *MockSigningIdentity) EnrollmentCertificate() []byte {
5252
return m.enrollmentCertificate
5353
}
5454

5555
// Sign the message
56-
func (m MockSigningIdentity) Sign(msg []byte) ([]byte, error) {
56+
func (m *MockSigningIdentity) Sign(msg []byte) ([]byte, error) {
5757
return nil, nil
5858
}
5959

6060
// PublicVersion returns the public parts of this identity
61-
func (m MockSigningIdentity) PublicVersion() msp.Identity {
61+
func (m *MockSigningIdentity) PublicVersion() msp.Identity {
6262
return nil
6363
}
6464

6565
// SetPrivateKey sets the private key
66-
func (m MockSigningIdentity) SetPrivateKey(key core.Key) {
67-
m.privateKey = key //nolint
66+
func (m *MockSigningIdentity) SetPrivateKey(key core.Key) {
67+
m.privateKey = key
6868
}
6969

7070
// PrivateKey returns the crypto suite representation of the private key
71-
func (m MockSigningIdentity) PrivateKey() core.Key {
71+
func (m *MockSigningIdentity) PrivateKey() core.Key {
7272
return m.privateKey
7373
}

0 commit comments

Comments
 (0)