Skip to content

Commit

Permalink
[FAB-9312] Resolve metalinter warnings
Browse files Browse the repository at this point in the history
This change fixes MockSigningIdentity to have a pointer receiver.

Change-Id: I1d5a9dbac1fdde37ab90533601af0ca9758a0058
Signed-off-by: Troy Ronda <troy@troyronda.com>
  • Loading branch information
troyronda committed Apr 16, 2018
1 parent d38bc9c commit dfc3d5c
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions pkg/msp/test/mockmsp/mockuser.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,46 +28,46 @@ func NewMockSigningIdentity(id string, mspid string) *MockSigningIdentity {
}

// Identifier returns the identifier of that identity
func (m MockSigningIdentity) Identifier() *msp.IdentityIdentifier {
func (m *MockSigningIdentity) Identifier() *msp.IdentityIdentifier {
return &msp.IdentityIdentifier{ID: m.id, MSPID: m.mspid}
}

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

// Serialize converts an identity to bytes
func (m MockSigningIdentity) Serialize() ([]byte, error) {
func (m *MockSigningIdentity) Serialize() ([]byte, error) {
return []byte("test"), nil
}

// SetEnrollmentCertificate sets yhe enrollment certificate.
func (m MockSigningIdentity) SetEnrollmentCertificate(cert []byte) {
m.enrollmentCertificate = cert //nolint
func (m *MockSigningIdentity) SetEnrollmentCertificate(cert []byte) {
m.enrollmentCertificate = cert
}

// EnrollmentCertificate Returns the underlying ECert representing this user’s identity.
func (m MockSigningIdentity) EnrollmentCertificate() []byte {
func (m *MockSigningIdentity) EnrollmentCertificate() []byte {
return m.enrollmentCertificate
}

// Sign the message
func (m MockSigningIdentity) Sign(msg []byte) ([]byte, error) {
func (m *MockSigningIdentity) Sign(msg []byte) ([]byte, error) {
return nil, nil
}

// PublicVersion returns the public parts of this identity
func (m MockSigningIdentity) PublicVersion() msp.Identity {
func (m *MockSigningIdentity) PublicVersion() msp.Identity {
return nil
}

// SetPrivateKey sets the private key
func (m MockSigningIdentity) SetPrivateKey(key core.Key) {
m.privateKey = key //nolint
func (m *MockSigningIdentity) SetPrivateKey(key core.Key) {
m.privateKey = key
}

// PrivateKey returns the crypto suite representation of the private key
func (m MockSigningIdentity) PrivateKey() core.Key {
func (m *MockSigningIdentity) PrivateKey() core.Key {
return m.privateKey
}

0 comments on commit dfc3d5c

Please sign in to comment.