forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 1
/
mockcaclient.go
68 lines (54 loc) · 2.09 KB
/
mockcaclient.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package mocks
import (
"github.com/hyperledger/fabric-sdk-go/pkg/common/providers/core"
"github.com/hyperledger/fabric-sdk-go/pkg/msp/api"
"github.com/pkg/errors"
)
// MockCAClient is a mock CAClient
type MockCAClient struct {
}
// NewMockCAClient Constructor for a CA client.
func NewMockCAClient(orgName string, cryptoProvider core.CryptoSuite) (api.CAClient, error) {
mcm := MockCAClient{}
return &mcm, nil
}
// Enroll enrolls a user with a Fabric network
func (mgr *MockCAClient) Enroll(enrollmentID string, enrollmentSecret string) error {
return errors.New("not implemented")
}
// Reenroll re-enrolls a user
func (mgr *MockCAClient) Reenroll(enrollmentID string) error {
return errors.New("not implemented")
}
// Register registers a user with a Fabric network
func (mgr *MockCAClient) Register(request *api.RegistrationRequest) (string, error) {
return "", errors.New("not implemented")
}
// Revoke revokes a user
func (mgr *MockCAClient) Revoke(request *api.RevocationRequest) (*api.RevocationResponse, error) {
return nil, errors.New("not implemented")
}
// CreateIdentity creates an identity
func (mgr *MockCAClient) CreateIdentity(request *api.IdentityRequest) (*api.IdentityResponse, error) {
return nil, errors.New("not implemented")
}
//GetIdentity returns an identity by id
func (mgr *MockCAClient) GetIdentity(id, caname string) (*api.IdentityResponse, error) {
return nil, errors.New("not implemented")
}
// GetAllIdentities returns all identities that the caller is authorized to see
func (mgr *MockCAClient) GetAllIdentities(caname string) ([]*api.IdentityResponse, error) {
return nil, errors.New("not implemented")
}
// ModifyIdentity updates identity
func (mgr *MockCAClient) ModifyIdentity(request *api.IdentityRequest) (*api.IdentityResponse, error) {
return nil, errors.New("not implemented")
}
// RemoveIdentity removes identity
func (mgr *MockCAClient) RemoveIdentity(request *api.RemoveIdentityRequest) (*api.IdentityResponse, error) {
return nil, errors.New("not implemented")
}