Documentation ¶
Index ¶
- Variables
- func CreateBlockWithCCEvent(events *pp.ChaincodeEvent, txID string, channelID string) (*common.Block, error)
- func CreateBlockWithCCEventAndTxStatus(events *pp.ChaincodeEvent, txID string, channelID string, ...) (*common.Block, error)
- func NewMockCAClient(orgName string, cryptoProvider core.CryptoSuite, config core.Config) (api.CAClient, error)
- func NewMockConfig() config.Config
- func NewMockConfigCustomized(tlsEnabled, mutualTLSEnabled, errorCase bool) config.Config
- func NewMockIdentity(err error) (msp.Identity, error)
- func NewMockIdentityManager(opts ...UsersOption) msp.IdentityManager
- func NewMockSigningIdentity() (msp.SigningIdentity, error)
- func NewMockTransactionHeader(channelID string) (fab.TransactionHeader, error)
- func NewSimpleMockBlock() *common.Block
- func NewSimpleMockError() error
- type MockBroadcastServer
- type MockCAClient
- func (mgr *MockCAClient) Enroll(enrollmentID string, enrollmentSecret string) error
- func (mgr *MockCAClient) Reenroll(enrollmentID string) error
- func (mgr *MockCAClient) Register(request *api.RegistrationRequest) (string, error)
- func (mgr *MockCAClient) Revoke(request *api.RevocationRequest) (*api.RevocationResponse, error)
- type MockChannelCfg
- type MockChannelConfig
- type MockChannelContext
- type MockChannelProvider
- type MockChannelService
- func (cs *MockChannelService) ChannelConfig() (fab.ChannelCfg, error)
- func (cs *MockChannelService) Config() (fab.ChannelConfig, error)
- func (cs *MockChannelService) EventService() (fab.EventService, error)
- func (cs *MockChannelService) Membership() (fab.ChannelMembership, error)
- func (cs *MockChannelService) SetOrderers(orderers []string)
- func (cs *MockChannelService) SetTransactor(t fab.Transactor)
- type MockConfig
- func (c *MockConfig) CAClientCertPath(org string) (string, error)
- func (c *MockConfig) CAClientCertPem(org string) (string, error)
- func (c *MockConfig) CAClientKeyPath(org string) (string, error)
- func (c *MockConfig) CAClientKeyPem(org string) (string, error)
- func (c *MockConfig) CAConfig(org string) (*config.CAConfig, error)
- func (c *MockConfig) CAKeyStorePath() string
- func (c *MockConfig) CAServerCertPaths(org string) ([]string, error)
- func (c *MockConfig) CAServerCertPems(org string) ([]string, error)
- func (c *MockConfig) ChannelConfig(name string) (*config.ChannelConfig, error)
- func (c *MockConfig) ChannelOrderers(name string) ([]config.OrdererConfig, error)
- func (c *MockConfig) ChannelPeers(name string) ([]config.ChannelPeer, error)
- func (c *MockConfig) Client() (*config.ClientConfig, error)
- func (c *MockConfig) CredentialStorePath() string
- func (c *MockConfig) CryptoConfigPath() string
- func (c *MockConfig) Ephemeral() bool
- func (c *MockConfig) EventServiceType() config.EventServiceType
- func (c *MockConfig) IsSecurityEnabled() bool
- func (c *MockConfig) KeyStorePath() string
- func (c *MockConfig) MSPID(org string) (string, error)
- func (c *MockConfig) NetworkConfig() (*config.NetworkConfig, error)
- func (c *MockConfig) NetworkPeers() ([]config.NetworkPeer, error)
- func (c *MockConfig) OrdererConfig(name string) (*config.OrdererConfig, error)
- func (c *MockConfig) OrderersConfig() ([]config.OrdererConfig, error)
- func (c *MockConfig) PeerConfig(org string, name string) (*config.PeerConfig, error)
- func (c *MockConfig) PeerConfigByURL(url string) (*config.PeerConfig, error)
- func (c *MockConfig) PeerMSPID(name string) (string, error)
- func (c *MockConfig) PeersConfig(org string) ([]config.PeerConfig, error)
- func (c *MockConfig) RandomOrdererConfig() (*config.OrdererConfig, error)
- func (c *MockConfig) SecurityAlgorithm() string
- func (c *MockConfig) SecurityLevel() int
- func (c *MockConfig) SecurityProvider() string
- func (c *MockConfig) SecurityProviderLabel() string
- func (c *MockConfig) SecurityProviderLibPath() string
- func (c *MockConfig) SecurityProviderPin() string
- func (c *MockConfig) SetCustomNetworkPeerCfg(customNetworkPeerCfg []config.NetworkPeer)
- func (c *MockConfig) SetCustomOrdererCfg(customOrdererCfg *config.OrdererConfig)
- func (c *MockConfig) SetCustomPeerCfg(customPeerCfg *config.PeerConfig)
- func (c *MockConfig) SetCustomRandomOrdererCfg(customRandomOrdererCfg *config.OrdererConfig)
- func (c *MockConfig) SoftVerify() bool
- func (c *MockConfig) TLSCACertPool(cert ...*x509.Certificate) (*x509.CertPool, error)
- func (c *MockConfig) TLSClientCerts() ([]tls.Certificate, error)
- func (c *MockConfig) TcertBatchSize() int
- func (c *MockConfig) Timeout(arg config.TimeoutType) time.Duration
- func (c *MockConfig) TimeoutOrDefault(arg config.TimeoutType) time.Duration
- type MockConfigBlockBuilder
- type MockConfigGroupBuilder
- type MockConfigUpdateEnvelopeBuilder
- type MockContext
- func (m MockContext) EnrollmentCertificate() []byte
- func (m MockContext) Identifier() *msp.IdentityIdentifier
- func (m MockContext) PrivateKey() core.Key
- func (m MockContext) PublicVersion() msp.Identity
- func (m MockContext) Serialize() ([]byte, error)
- func (m MockContext) Sign(msg []byte) ([]byte, error)
- func (m MockContext) Verify(msg []byte, sig []byte) error
- type MockCryptoSuite
- func (m *MockCryptoSuite) GetHash(opts core.HashOpts) (hash.Hash, error)
- func (m *MockCryptoSuite) GetKey(ski []byte) (k core.Key, err error)
- func (m *MockCryptoSuite) Hash(msg []byte, opts core.HashOpts) (hash []byte, err error)
- func (m *MockCryptoSuite) KeyGen(opts core.KeyGenOpts) (k core.Key, err error)
- func (m *MockCryptoSuite) KeyImport(raw interface{}, opts core.KeyImportOpts) (k core.Key, err error)
- func (m *MockCryptoSuite) Sign(k core.Key, digest []byte, opts core.SignerOpts) (signature []byte, err error)
- func (m *MockCryptoSuite) Verify(k core.Key, signature, digest []byte, opts core.SignerOpts) (valid bool, err error)
- type MockEndorserServer
- type MockEventServer
- type MockEventService
- func (m *MockEventService) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error)
- func (m *MockEventService) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
- func (m *MockEventService) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)
- func (m *MockEventService) RegisterTxStatusEvent(txID string) (fab.Registration, <-chan *fab.TxStatusEvent, error)
- func (m *MockEventService) Unregister(reg fab.Registration)
- type MockIdentity
- func (id *MockIdentity) ExpiresAt() time.Time
- func (id *MockIdentity) GetIdentifier() *msp.IdentityIdentifier
- func (id *MockIdentity) GetMSPIdentifier() string
- func (id *MockIdentity) GetOrganizationalUnits() []*msp.OUIdentifier
- func (id *MockIdentity) SatisfiesPrincipal(principal *msp_protos.MSPPrincipal) error
- func (id *MockIdentity) Serialize() ([]byte, error)
- func (id *MockIdentity) Validate() error
- func (id *MockIdentity) Verify(msg []byte, sig []byte) error
- type MockIdentityManager
- type MockInfraProvider
- func (f *MockInfraProvider) Close()
- func (f *MockInfraProvider) CommManager() fab.CommManager
- func (f *MockInfraProvider) CreateChannelCfg(ctx fab.ClientContext, name string) (fab.ChannelCfg, error)
- func (f *MockInfraProvider) CreateChannelConfig(channelID string) (fab.ChannelConfig, error)
- func (f *MockInfraProvider) CreateChannelMembership(ctx fab.ClientContext, channel string) (fab.ChannelMembership, error)
- func (f *MockInfraProvider) CreateChannelTransactor(reqCtx reqContext.Context, cfg fab.ChannelCfg) (fab.Transactor, error)
- func (f *MockInfraProvider) CreateEventService(ic fab.ClientContext, channelID string) (fab.EventService, error)
- func (f *MockInfraProvider) CreateOrdererFromConfig(cfg *core.OrdererConfig) (fab.Orderer, error)
- func (f *MockInfraProvider) CreatePeerFromConfig(peerCfg *core.NetworkPeer) (fab.Peer, error)
- func (f *MockInfraProvider) SetCustomOrderer(customOrderer fab.Orderer)
- func (f *MockInfraProvider) SetCustomTransactor(customTransactor fab.Transactor)
- type MockMSP
- func (m *MockMSP) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error)
- func (m *MockMSP) GetDefaultSigningIdentity() (msp.SigningIdentity, error)
- func (m *MockMSP) GetIdentifier() (string, error)
- func (m *MockMSP) GetMSPs() (map[string]msp.MSP, error)
- func (m *MockMSP) GetSigningIdentity(identifier *msp.IdentityIdentifier) (msp.SigningIdentity, error)
- func (m *MockMSP) GetTLSIntermediateCerts() [][]byte
- func (m *MockMSP) GetTLSRootCerts() [][]byte
- func (m *MockMSP) GetType() msp.ProviderType
- func (m *MockMSP) GetVersion() msp.MSPVersion
- func (m *MockMSP) IsWellFormed(identity *msp_protos.SerializedIdentity) error
- func (m *MockMSP) SatisfiesPrincipal(id msp.Identity, principal *msp_protos.MSPPrincipal) error
- func (m *MockMSP) Setup(config *msp_protos.MSPConfig) error
- func (m *MockMSP) Validate(id msp.Identity) error
- type MockMSPManager
- func (mgr *MockMSPManager) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error)
- func (mgr *MockMSPManager) GetMSPs() (map[string]msp.MSP, error)
- func (mgr *MockMSPManager) IsWellFormed(identity *msp_protos.SerializedIdentity) error
- func (mgr *MockMSPManager) Setup(msps []msp.MSP) error
- type MockMembership
- type MockOrderer
- func (o *MockOrderer) Close()
- func (o *MockOrderer) EnqueueForSendDeliver(value interface{})
- func (o *MockOrderer) EnqueueSendBroadcastError(err error)
- func (o *MockOrderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error)
- func (o *MockOrderer) SendDeliver(ctx reqContext.Context, envelope *fab.SignedEnvelope) (chan *common.Block, chan error)
- func (o *MockOrderer) URL() string
- type MockPeer
- func (p *MockPeer) EnrollmentCertificate() *pem.Block
- func (p *MockPeer) MSPID() string
- func (p *MockPeer) Name() string
- func (p *MockPeer) ProcessTransactionProposal(ctx reqContext.Context, tp fab.ProcessProposalRequest) (*fab.TransactionProposalResponse, error)
- func (p *MockPeer) Roles() []string
- func (p *MockPeer) SetEnrollmentCertificate(pem *pem.Block)
- func (p *MockPeer) SetMSPID(mspID string)
- func (p *MockPeer) SetName(name string)
- func (p *MockPeer) SetRoles(roles []string)
- func (p *MockPeer) URL() string
- type MockProviderContext
- func (pc *MockProviderContext) ChannelProvider() fab.ChannelProvider
- func (pc *MockProviderContext) Config() config.Config
- func (pc *MockProviderContext) CryptoSuite() core.CryptoSuite
- func (pc *MockProviderContext) DiscoveryProvider() fab.DiscoveryProvider
- func (pc *MockProviderContext) IdentityManager(orgName string) (msp.IdentityManager, bool)
- func (pc *MockProviderContext) InfraProvider() fab.InfraProvider
- func (pc *MockProviderContext) PrivateKey() core.Key
- func (pc *MockProviderContext) PublicVersion() msp.Identity
- func (pc *MockProviderContext) SelectionProvider() fab.SelectionProvider
- func (pc *MockProviderContext) SetConfig(config config.Config)
- func (pc *MockProviderContext) SetCustomInfraProvider(customInfraProvider fab.InfraProvider)
- func (pc *MockProviderContext) Sign(msg []byte) ([]byte, error)
- func (pc *MockProviderContext) SigningManager() core.SigningManager
- func (pc *MockProviderContext) UserStore() msp.UserStore
- type MockSelectionProvider
- type MockSelectionService
- type MockSigningIdentity
- type MockStaticDiscoveryProvider
- type MockStaticDiscoveryService
- type MockTransactionHeader
- type MockTransactor
- func (t *MockTransactor) CreateTransaction(request fab.TransactionRequest) (*fab.Transaction, error)
- func (t *MockTransactor) CreateTransactionHeader() (fab.TransactionHeader, error)
- func (t *MockTransactor) SendTransaction(tx *fab.Transaction) (*fab.TransactionResponse, error)
- func (t *MockTransactor) SendTransactionProposal(proposal *fab.TransactionProposal, targets []fab.ProposalProcessor) ([]*fab.TransactionProposalResponse, error)
- type ProviderOption
- type ProviderUsersOptions
- type UsersOption
- type UsersOptions
Constants ¶
This section is empty.
Variables ¶
var TestBlock = &po.DeliverResponse{ Type: &po.DeliverResponse_Block{ Block: &common.Block{ Data: &common.BlockData{ Data: [][]byte{[]byte("test")}, }, }, }, }
TestBlock is a test block
Functions ¶
func CreateBlockWithCCEvent ¶
func CreateBlockWithCCEvent(events *pp.ChaincodeEvent, txID string, channelID string) (*common.Block, error)
CreateBlockWithCCEvent creates a mock block
func CreateBlockWithCCEventAndTxStatus ¶
func CreateBlockWithCCEventAndTxStatus(events *pp.ChaincodeEvent, txID string, channelID string, txValidationCode pp.TxValidationCode) (*common.Block, error)
CreateBlockWithCCEventAndTxStatus creates a mock block with the given CC event and TX validation code
func NewMockCAClient ¶
func NewMockCAClient(orgName string, cryptoProvider core.CryptoSuite, config core.Config) (api.CAClient, error)
NewMockCAClient Constructor for a CA client.
func NewMockConfigCustomized ¶
NewMockConfigCustomized ...
func NewMockIdentity ¶
NewMockIdentity creates new mock identity
func NewMockIdentityManager ¶
func NewMockIdentityManager(opts ...UsersOption) msp.IdentityManager
NewMockIdentityManager Constructor for a identity manager.
func NewMockSigningIdentity ¶
func NewMockSigningIdentity() (msp.SigningIdentity, error)
NewMockSigningIdentity ...
func NewMockTransactionHeader ¶
func NewMockTransactionHeader(channelID string) (fab.TransactionHeader, error)
NewMockTransactionHeader creates mock TxnID based on mock user.
func NewSimpleMockBlock ¶
NewSimpleMockBlock returns a simple mock block
Types ¶
type MockBroadcastServer ¶
type MockBroadcastServer struct { DeliverError error BroadcastInternalServerError bool DeliverResponse *po.DeliverResponse BroadcastError error BroadcastCustomResponse *po.BroadcastResponse }
MockBroadcastServer mock broadcast server
func StartMockBroadcastServer ¶
func StartMockBroadcastServer(broadcastTestURL string, grpcServer *grpc.Server) (*MockBroadcastServer, string)
StartMockBroadcastServer starts mock server for unit testing purpose
func (*MockBroadcastServer) Broadcast ¶
func (m *MockBroadcastServer) Broadcast(server po.AtomicBroadcast_BroadcastServer) error
Broadcast mock broadcast
func (*MockBroadcastServer) Deliver ¶
func (m *MockBroadcastServer) Deliver(server po.AtomicBroadcast_DeliverServer) error
Deliver mock deliver
type MockCAClient ¶
type MockCAClient struct { }
MockCAClient is a mock CAClient
func (*MockCAClient) Enroll ¶
func (mgr *MockCAClient) Enroll(enrollmentID string, enrollmentSecret string) error
Enroll enrolls a user with a Fabric network
func (*MockCAClient) Reenroll ¶
func (mgr *MockCAClient) Reenroll(enrollmentID string) error
Reenroll re-enrolls a user
func (*MockCAClient) Register ¶
func (mgr *MockCAClient) Register(request *api.RegistrationRequest) (string, error)
Register registers a user with a Fabric network
func (*MockCAClient) Revoke ¶
func (mgr *MockCAClient) Revoke(request *api.RevocationRequest) (*api.RevocationResponse, error)
Revoke revokes a user
type MockChannelCfg ¶
type MockChannelCfg struct { MockID string MockMSPs []*msp.MSPConfig MockAnchorPeers []*fab.OrgAnchorPeer MockOrderers []string MockVersions *fab.Versions MockMembership fab.ChannelMembership }
MockChannelCfg contains mock channel configuration
func (*MockChannelCfg) AnchorPeers ¶
func (cfg *MockChannelCfg) AnchorPeers() []*fab.OrgAnchorPeer
AnchorPeers returns anchor peers
func (*MockChannelCfg) Orderers ¶
func (cfg *MockChannelCfg) Orderers() []string
Orderers returns orderers
func (*MockChannelCfg) Versions ¶
func (cfg *MockChannelCfg) Versions() *fab.Versions
Versions returns versions
type MockChannelConfig ¶
type MockChannelConfig struct {
// contains filtered or unexported fields
}
MockChannelConfig mockcore query channel configuration
func NewMockChannelConfig ¶
func NewMockChannelConfig(ctx context.Client, channelID string) (*MockChannelConfig, error)
NewMockChannelConfig mockcore channel config implementation
func (*MockChannelConfig) Query ¶
func (c *MockChannelConfig) Query(reqCtx reqContext.Context) (fab.ChannelCfg, error)
Query mockcore query for channel configuration
type MockChannelContext ¶
type MockChannelContext struct { *MockContext Discovery fab.DiscoveryService Selection fab.SelectionService Channel fab.ChannelService // contains filtered or unexported fields }
MockChannelContext holds the client context plus channel-specific entities
func NewMockChannelContext ¶
func NewMockChannelContext(context *MockContext, channelID string) *MockChannelContext
NewMockChannelContext returns a new MockChannelContext
func (*MockChannelContext) ChannelID ¶
func (c *MockChannelContext) ChannelID() string
ChannelID returns the channel ID
func (*MockChannelContext) ChannelService ¶
func (c *MockChannelContext) ChannelService() fab.ChannelService
ChannelService returns the ChannelService
func (*MockChannelContext) DiscoveryService ¶
func (c *MockChannelContext) DiscoveryService() fab.DiscoveryService
DiscoveryService returns a discovery service
func (*MockChannelContext) SelectionService ¶
func (c *MockChannelContext) SelectionService() fab.SelectionService
SelectionService returns the selection service
type MockChannelProvider ¶
type MockChannelProvider struct {
// contains filtered or unexported fields
}
MockChannelProvider holds a mock channel provider.
func NewMockChannelProvider ¶
func NewMockChannelProvider(ctx context.Client) (*MockChannelProvider, error)
NewMockChannelProvider returns a mock ChannelProvider
func (*MockChannelProvider) ChannelService ¶
func (cp *MockChannelProvider) ChannelService(ctx fab.ClientContext, channelID string) (fab.ChannelService, error)
ChannelService returns a mock ChannelService
func (*MockChannelProvider) SetCustomChannelService ¶
func (cp *MockChannelProvider) SetCustomChannelService(customSelectionService fab.ChannelService)
SetCustomChannelService sets custom channel service for unit-test purposes
func (*MockChannelProvider) SetTransactor ¶
func (cp *MockChannelProvider) SetTransactor(transactor fab.Transactor)
SetTransactor sets the default transactor for all mock channel services
type MockChannelService ¶
type MockChannelService struct {
// contains filtered or unexported fields
}
MockChannelService holds a mock channel service.
func (*MockChannelService) ChannelConfig ¶
func (cs *MockChannelService) ChannelConfig() (fab.ChannelCfg, error)
ChannelConfig returns channel config
func (*MockChannelService) Config ¶
func (cs *MockChannelService) Config() (fab.ChannelConfig, error)
Config ...
func (*MockChannelService) EventService ¶
func (cs *MockChannelService) EventService() (fab.EventService, error)
EventService returns a mock event service
func (*MockChannelService) Membership ¶
func (cs *MockChannelService) Membership() (fab.ChannelMembership, error)
Membership returns member identification
func (*MockChannelService) SetOrderers ¶
func (cs *MockChannelService) SetOrderers(orderers []string)
SetOrderers sets orderes to mock channel service for unit-test purposes
func (*MockChannelService) SetTransactor ¶
func (cs *MockChannelService) SetTransactor(t fab.Transactor)
SetTransactor changes the return value of Transactor
type MockConfig ¶
type MockConfig struct {
// contains filtered or unexported fields
}
MockConfig ...
func (*MockConfig) CAClientCertPath ¶
func (c *MockConfig) CAClientCertPath(org string) (string, error)
CAClientCertPath Read configuration option for the fabric CA client cert file
func (*MockConfig) CAClientCertPem ¶
func (c *MockConfig) CAClientCertPem(org string) (string, error)
CAClientCertPem Read configuration option for the fabric CA client cert from a string
func (*MockConfig) CAClientKeyPath ¶
func (c *MockConfig) CAClientKeyPath(org string) (string, error)
CAClientKeyPath Read configuration option for the fabric CA client key file
func (*MockConfig) CAClientKeyPem ¶
func (c *MockConfig) CAClientKeyPem(org string) (string, error)
CAClientKeyPem Read configuration option for the fabric CA client key from a string
func (*MockConfig) CAConfig ¶
func (c *MockConfig) CAConfig(org string) (*config.CAConfig, error)
CAConfig not implemented
func (*MockConfig) CAKeyStorePath ¶
func (c *MockConfig) CAKeyStorePath() string
CAKeyStorePath not implemented
func (*MockConfig) CAServerCertPaths ¶
func (c *MockConfig) CAServerCertPaths(org string) ([]string, error)
CAServerCertPaths Read configuration option for the server certificate files
func (*MockConfig) CAServerCertPems ¶
func (c *MockConfig) CAServerCertPems(org string) ([]string, error)
CAServerCertPems Read configuration option for the server certificate embedded pems
func (*MockConfig) ChannelConfig ¶
func (c *MockConfig) ChannelConfig(name string) (*config.ChannelConfig, error)
ChannelConfig returns the channel configuration
func (*MockConfig) ChannelOrderers ¶
func (c *MockConfig) ChannelOrderers(name string) ([]config.OrdererConfig, error)
ChannelOrderers returns a list of channel orderers
func (*MockConfig) ChannelPeers ¶
func (c *MockConfig) ChannelPeers(name string) ([]config.ChannelPeer, error)
ChannelPeers returns the channel peers configuration
func (*MockConfig) CredentialStorePath ¶
func (c *MockConfig) CredentialStorePath() string
CredentialStorePath ...
func (*MockConfig) CryptoConfigPath ¶
func (c *MockConfig) CryptoConfigPath() string
CryptoConfigPath ...
func (*MockConfig) EventServiceType ¶
func (c *MockConfig) EventServiceType() config.EventServiceType
EventServiceType returns the type of event service client to use
func (*MockConfig) IsSecurityEnabled ¶
func (c *MockConfig) IsSecurityEnabled() bool
IsSecurityEnabled ...
func (*MockConfig) MSPID ¶
func (c *MockConfig) MSPID(org string) (string, error)
MSPID not implemented
func (*MockConfig) NetworkConfig ¶
func (c *MockConfig) NetworkConfig() (*config.NetworkConfig, error)
NetworkConfig not implemented
func (*MockConfig) NetworkPeers ¶
func (c *MockConfig) NetworkPeers() ([]config.NetworkPeer, error)
NetworkPeers returns the mock network peers configuration
func (*MockConfig) OrdererConfig ¶
func (c *MockConfig) OrdererConfig(name string) (*config.OrdererConfig, error)
OrdererConfig not implemented
func (*MockConfig) OrderersConfig ¶
func (c *MockConfig) OrderersConfig() ([]config.OrdererConfig, error)
OrderersConfig returns a list of defined orderers
func (*MockConfig) PeerConfig ¶
func (c *MockConfig) PeerConfig(org string, name string) (*config.PeerConfig, error)
PeerConfig Retrieves a specific peer from the configuration by org and name
func (*MockConfig) PeerConfigByURL ¶
func (c *MockConfig) PeerConfigByURL(url string) (*config.PeerConfig, error)
PeerConfigByURL retrieves PeerConfig by URL
func (*MockConfig) PeerMSPID ¶
func (c *MockConfig) PeerMSPID(name string) (string, error)
PeerMSPID not implemented
func (*MockConfig) PeersConfig ¶
func (c *MockConfig) PeersConfig(org string) ([]config.PeerConfig, error)
PeersConfig Retrieves the fabric peers from the config file provided
func (*MockConfig) RandomOrdererConfig ¶
func (c *MockConfig) RandomOrdererConfig() (*config.OrdererConfig, error)
RandomOrdererConfig not implemented
func (*MockConfig) SecurityAlgorithm ¶
func (c *MockConfig) SecurityAlgorithm() string
SecurityAlgorithm ...
func (*MockConfig) SecurityProvider ¶
func (c *MockConfig) SecurityProvider() string
SecurityProvider ...
func (*MockConfig) SecurityProviderLabel ¶
func (c *MockConfig) SecurityProviderLabel() string
SecurityProviderLabel ...
func (*MockConfig) SecurityProviderLibPath ¶
func (c *MockConfig) SecurityProviderLibPath() string
SecurityProviderLibPath will be set only if provider is PKCS11
func (*MockConfig) SecurityProviderPin ¶
func (c *MockConfig) SecurityProviderPin() string
SecurityProviderPin ...
func (*MockConfig) SetCustomNetworkPeerCfg ¶
func (c *MockConfig) SetCustomNetworkPeerCfg(customNetworkPeerCfg []config.NetworkPeer)
SetCustomNetworkPeerCfg sets custom orderer config for unit-tests
func (*MockConfig) SetCustomOrdererCfg ¶
func (c *MockConfig) SetCustomOrdererCfg(customOrdererCfg *config.OrdererConfig)
SetCustomOrdererCfg sets custom orderer config for unit-tests
func (*MockConfig) SetCustomPeerCfg ¶
func (c *MockConfig) SetCustomPeerCfg(customPeerCfg *config.PeerConfig)
SetCustomPeerCfg sets custom orderer config for unit-tests
func (*MockConfig) SetCustomRandomOrdererCfg ¶
func (c *MockConfig) SetCustomRandomOrdererCfg(customRandomOrdererCfg *config.OrdererConfig)
SetCustomRandomOrdererCfg sets custom random orderer config for unit-tests
func (*MockConfig) TLSCACertPool ¶
func (c *MockConfig) TLSCACertPool(cert ...*x509.Certificate) (*x509.CertPool, error)
TLSCACertPool ...
func (*MockConfig) TLSClientCerts ¶
func (c *MockConfig) TLSClientCerts() ([]tls.Certificate, error)
TLSClientCerts ...
func (*MockConfig) Timeout ¶
func (c *MockConfig) Timeout(arg config.TimeoutType) time.Duration
Timeout not implemented
func (*MockConfig) TimeoutOrDefault ¶
func (c *MockConfig) TimeoutOrDefault(arg config.TimeoutType) time.Duration
TimeoutOrDefault not implemented
type MockConfigBlockBuilder ¶
type MockConfigBlockBuilder struct { MockConfigGroupBuilder Index uint64 LastConfigIndex uint64 }
MockConfigBlockBuilder is used to build a mock Chain configuration block
func (*MockConfigBlockBuilder) Build ¶
func (b *MockConfigBlockBuilder) Build() *common.Block
Build creates a mock Chain configuration Block
type MockConfigGroupBuilder ¶
type MockConfigGroupBuilder struct { Version uint64 ModPolicy string OrdererAddress string MSPNames []string RootCA string Groups map[string]*common.ConfigGroup }
MockConfigGroupBuilder is used to build a mock ConfigGroup
type MockConfigUpdateEnvelopeBuilder ¶
type MockConfigUpdateEnvelopeBuilder struct { MockConfigGroupBuilder ChannelID string }
MockConfigUpdateEnvelopeBuilder builds a mock ConfigUpdateEnvelope
func (*MockConfigUpdateEnvelopeBuilder) Build ¶
func (b *MockConfigUpdateEnvelopeBuilder) Build() *common.Envelope
Build builds an Envelope that contains a mock ConfigUpdateEnvelope
func (*MockConfigUpdateEnvelopeBuilder) BuildBytes ¶
func (b *MockConfigUpdateEnvelopeBuilder) BuildBytes() []byte
BuildBytes builds an Envelope that contains a mock ConfigUpdateEnvelope and returns the marshaled bytes
func (*MockConfigUpdateEnvelopeBuilder) BuildConfigUpdateBytes ¶
func (b *MockConfigUpdateEnvelopeBuilder) BuildConfigUpdateBytes() []byte
BuildConfigUpdateBytes builds an mock ConfigUpdate returns the marshaled bytes
type MockContext ¶
type MockContext struct { *MockProviderContext SigningIdentity msp.SigningIdentity }
MockContext holds core providers and identity to enable mocking.
func NewMockContext ¶
func NewMockContext(si msp.SigningIdentity) *MockContext
NewMockContext creates a MockContext consisting of defaults and an identity
func NewMockContextWithCustomDiscovery ¶
func NewMockContextWithCustomDiscovery(ic msp.SigningIdentity, discPvdr fab.DiscoveryProvider) *MockContext
NewMockContextWithCustomDiscovery creates a MockContext consisting of defaults and an identity
func (MockContext) EnrollmentCertificate ¶
func (m MockContext) EnrollmentCertificate() []byte
EnrollmentCertificate Returns the underlying ECert representing this user’s identity.
func (MockContext) Identifier ¶
func (m MockContext) Identifier() *msp.IdentityIdentifier
Identifier returns the identifier of that identity
func (MockContext) PrivateKey ¶
func (m MockContext) PrivateKey() core.Key
PrivateKey returns the crypto suite representation of the private key
func (MockContext) PublicVersion ¶
func (m MockContext) PublicVersion() msp.Identity
PublicVersion returns the public parts of this identity
func (MockContext) Serialize ¶
func (m MockContext) Serialize() ([]byte, error)
Serialize converts an identity to bytes
type MockCryptoSuite ¶
type MockCryptoSuite struct { }
MockCryptoSuite implementation
func (*MockCryptoSuite) GetKey ¶
func (m *MockCryptoSuite) GetKey(ski []byte) (k core.Key, err error)
GetKey mock get key
func (*MockCryptoSuite) KeyGen ¶
func (m *MockCryptoSuite) KeyGen(opts core.KeyGenOpts) (k core.Key, err error)
KeyGen mock key gen
func (*MockCryptoSuite) KeyImport ¶
func (m *MockCryptoSuite) KeyImport(raw interface{}, opts core.KeyImportOpts) (k core.Key, err error)
KeyImport mock key import
func (*MockCryptoSuite) Sign ¶
func (m *MockCryptoSuite) Sign(k core.Key, digest []byte, opts core.SignerOpts) (signature []byte, err error)
Sign mock signing
func (*MockCryptoSuite) Verify ¶
func (m *MockCryptoSuite) Verify(k core.Key, signature, digest []byte, opts core.SignerOpts) (valid bool, err error)
Verify mock verify implementation
type MockEndorserServer ¶
MockEndorserServer mock endoreser server to process endorsement proposals
func StartEndorserServer ¶
func StartEndorserServer(endorserTestURL string) *MockEndorserServer
StartEndorserServer starts mock server for unit testing purpose
func (*MockEndorserServer) ProcessProposal ¶
func (m *MockEndorserServer) ProcessProposal(context context.Context, proposal *pb.SignedProposal) (*pb.ProposalResponse, error)
ProcessProposal mock implementation that returns success if error is not set error if it is
type MockEventServer ¶
type MockEventServer struct {
// contains filtered or unexported fields
}
MockEventServer ...
func StartMockEventServer ¶
func StartMockEventServer(testAddress string) (*MockEventServer, error)
StartMockEventServer will start mock event server for unit testing purpose
func (*MockEventServer) Chat ¶
func (m *MockEventServer) Chat(srv pb.Events_ChatServer) error
Chat for event chatting
func (*MockEventServer) SendMockEvent ¶
func (m *MockEventServer) SendMockEvent(event *pb.Event)
SendMockEvent used for sending mock events to event server
type MockEventService ¶
type MockEventService struct {
TxStatusRegCh chan *dispatcher.TxStatusReg
}
MockEventService implements a mock event service
func NewMockEventService ¶
func NewMockEventService() *MockEventService
NewMockEventService returns a new mock event service
func (*MockEventService) RegisterBlockEvent ¶
func (m *MockEventService) RegisterBlockEvent(filter ...fab.BlockFilter) (fab.Registration, <-chan *fab.BlockEvent, error)
RegisterBlockEvent registers for block events.
func (*MockEventService) RegisterChaincodeEvent ¶
func (m *MockEventService) RegisterChaincodeEvent(ccID, eventFilter string) (fab.Registration, <-chan *fab.CCEvent, error)
RegisterChaincodeEvent registers for chaincode events.
func (*MockEventService) RegisterFilteredBlockEvent ¶
func (m *MockEventService) RegisterFilteredBlockEvent() (fab.Registration, <-chan *fab.FilteredBlockEvent, error)
RegisterFilteredBlockEvent registers for filtered block events.
func (*MockEventService) RegisterTxStatusEvent ¶
func (m *MockEventService) RegisterTxStatusEvent(txID string) (fab.Registration, <-chan *fab.TxStatusEvent, error)
RegisterTxStatusEvent registers for transaction status events.
func (*MockEventService) Unregister ¶
func (m *MockEventService) Unregister(reg fab.Registration)
Unregister removes the given registration.
type MockIdentity ¶
type MockIdentity struct {
Err error
}
MockIdentity implements identity
func (*MockIdentity) ExpiresAt ¶
func (id *MockIdentity) ExpiresAt() time.Time
ExpiresAt returns the time at which the Identity expires.
func (*MockIdentity) GetIdentifier ¶
func (id *MockIdentity) GetIdentifier() *msp.IdentityIdentifier
GetIdentifier returns the identifier (MSPID/IDID) for this instance
func (*MockIdentity) GetMSPIdentifier ¶
func (id *MockIdentity) GetMSPIdentifier() string
GetMSPIdentifier returns the MSP identifier for this instance
func (*MockIdentity) GetOrganizationalUnits ¶
func (id *MockIdentity) GetOrganizationalUnits() []*msp.OUIdentifier
GetOrganizationalUnits returns the OU for this instance
func (*MockIdentity) SatisfiesPrincipal ¶
func (id *MockIdentity) SatisfiesPrincipal(principal *msp_protos.MSPPrincipal) error
SatisfiesPrincipal returns null if this instance matches the supplied principal or an error otherwise
func (*MockIdentity) Serialize ¶
func (id *MockIdentity) Serialize() ([]byte, error)
Serialize returns a byte array representation of this identity
func (*MockIdentity) Validate ¶
func (id *MockIdentity) Validate() error
Validate returns nil if this instance is a valid identity or an error otherwise
type MockIdentityManager ¶
type MockIdentityManager struct {
// contains filtered or unexported fields
}
MockIdentityManager is a mock IdentityManager
func (*MockIdentityManager) GetSigningIdentity ¶
func (mgr *MockIdentityManager) GetSigningIdentity(id string) (msp.SigningIdentity, error)
GetSigningIdentity will return an identity that can be used to cryptographically sign an object
type MockInfraProvider ¶
type MockInfraProvider struct {
// contains filtered or unexported fields
}
MockInfraProvider represents the default implementation of Fabric objects.
func (*MockInfraProvider) CommManager ¶
func (f *MockInfraProvider) CommManager() fab.CommManager
CommManager returns comm provider
func (*MockInfraProvider) CreateChannelCfg ¶
func (f *MockInfraProvider) CreateChannelCfg(ctx fab.ClientContext, name string) (fab.ChannelCfg, error)
CreateChannelCfg creates the channel configuration
func (*MockInfraProvider) CreateChannelConfig ¶
func (f *MockInfraProvider) CreateChannelConfig(channelID string) (fab.ChannelConfig, error)
CreateChannelConfig initializes the channel config
func (*MockInfraProvider) CreateChannelMembership ¶
func (f *MockInfraProvider) CreateChannelMembership(ctx fab.ClientContext, channel string) (fab.ChannelMembership, error)
CreateChannelMembership returns a channel member identifier
func (*MockInfraProvider) CreateChannelTransactor ¶
func (f *MockInfraProvider) CreateChannelTransactor(reqCtx reqContext.Context, cfg fab.ChannelCfg) (fab.Transactor, error)
CreateChannelTransactor initializes the transactor
func (*MockInfraProvider) CreateEventService ¶
func (f *MockInfraProvider) CreateEventService(ic fab.ClientContext, channelID string) (fab.EventService, error)
CreateEventService creates the event service.
func (*MockInfraProvider) CreateOrdererFromConfig ¶
func (f *MockInfraProvider) CreateOrdererFromConfig(cfg *core.OrdererConfig) (fab.Orderer, error)
CreateOrdererFromConfig creates a default implementation of Orderer based on configuration.
func (*MockInfraProvider) CreatePeerFromConfig ¶
func (f *MockInfraProvider) CreatePeerFromConfig(peerCfg *core.NetworkPeer) (fab.Peer, error)
CreatePeerFromConfig returns a new default implementation of Peer based configuration
func (*MockInfraProvider) SetCustomOrderer ¶
func (f *MockInfraProvider) SetCustomOrderer(customOrderer fab.Orderer)
SetCustomOrderer creates a default implementation of Orderer based on configuration.
func (*MockInfraProvider) SetCustomTransactor ¶
func (f *MockInfraProvider) SetCustomTransactor(customTransactor fab.Transactor)
SetCustomTransactor sets custom transactor for unit-test purposes
type MockMSP ¶
type MockMSP struct {
Err error
}
MockMSP implements mock msp
func (*MockMSP) DeserializeIdentity ¶
DeserializeIdentity mockcore deserialize identity
func (*MockMSP) GetDefaultSigningIdentity ¶
func (m *MockMSP) GetDefaultSigningIdentity() (msp.SigningIdentity, error)
GetDefaultSigningIdentity returns the default signing identity
func (*MockMSP) GetIdentifier ¶
GetIdentifier returns the provider identifier
func (*MockMSP) GetSigningIdentity ¶
func (m *MockMSP) GetSigningIdentity(identifier *msp.IdentityIdentifier) (msp.SigningIdentity, error)
GetSigningIdentity returns a signing identity corresponding to the provided identifier
func (*MockMSP) GetTLSIntermediateCerts ¶
GetTLSIntermediateCerts returns the TLS intermediate root certificates for this MSP
func (*MockMSP) GetTLSRootCerts ¶
GetTLSRootCerts returns the TLS root certificates for this MSP
func (*MockMSP) GetType ¶
func (m *MockMSP) GetType() msp.ProviderType
GetType returns the provider type
func (*MockMSP) GetVersion ¶
func (m *MockMSP) GetVersion() msp.MSPVersion
GetVersion returns the version of this MSP
func (*MockMSP) IsWellFormed ¶
func (m *MockMSP) IsWellFormed(identity *msp_protos.SerializedIdentity) error
IsWellFormed checks if the given identity can be deserialized into its provider-specific form
func (*MockMSP) SatisfiesPrincipal ¶
func (m *MockMSP) SatisfiesPrincipal(id msp.Identity, principal *msp_protos.MSPPrincipal) error
SatisfiesPrincipal checks whether the identity matches the description supplied in MSPPrincipal.
type MockMSPManager ¶
MockMSPManager implements mock msp manager
func NewMockMSPManager ¶
func NewMockMSPManager(msps map[string]msp.MSP) *MockMSPManager
NewMockMSPManager mockcore msp manager
func NewMockMSPManagerWithError ¶
func NewMockMSPManagerWithError(msps map[string]msp.MSP, err error) *MockMSPManager
NewMockMSPManagerWithError mockcore msp manager
func (*MockMSPManager) DeserializeIdentity ¶
func (mgr *MockMSPManager) DeserializeIdentity(serializedIdentity []byte) (msp.Identity, error)
DeserializeIdentity mockcore deserialize identity
func (*MockMSPManager) GetMSPs ¶
func (mgr *MockMSPManager) GetMSPs() (map[string]msp.MSP, error)
GetMSPs Provides a list of Membership Service providers
func (*MockMSPManager) IsWellFormed ¶
func (mgr *MockMSPManager) IsWellFormed(identity *msp_protos.SerializedIdentity) error
IsWellFormed checks if the given identity can be deserialized into its provider-specific form
type MockMembership ¶
MockMembership mock member id
func NewMockMembership ¶
func NewMockMembership() *MockMembership
NewMockMembership new mock member id
func (*MockMembership) Validate ¶
func (m *MockMembership) Validate(serializedID []byte) error
Validate if the given ID was issued by the channel's members
type MockOrderer ¶
type MockOrderer struct { OrdererURL string BroadcastListener chan *fab.SignedEnvelope BroadcastErrors chan error Deliveries chan *common.Block DeliveryErrors chan error // These queues are used to detach the client, to avoid deadlocks BroadcastQueue chan *fab.SignedEnvelope DeliveryQueue chan interface{} }
MockOrderer is a mock fabricclient.Orderer Nothe that calling broadcast doesn't deliver anythng. This implies that the broadcast side and the deliver side are totally independent from the mocking point of view.
func NewMockOrderer ¶
func NewMockOrderer(url string, broadcastListener chan *fab.SignedEnvelope) *MockOrderer
NewMockOrderer ...
func (*MockOrderer) Close ¶
func (o *MockOrderer) Close()
Close cleans up the instance and ends goroutines
func (*MockOrderer) EnqueueForSendDeliver ¶
func (o *MockOrderer) EnqueueForSendDeliver(value interface{})
EnqueueForSendDeliver enqueues a mock value (block or error) for delivery
func (*MockOrderer) EnqueueSendBroadcastError ¶
func (o *MockOrderer) EnqueueSendBroadcastError(err error)
EnqueueSendBroadcastError enqueues error
func (*MockOrderer) SendBroadcast ¶
func (o *MockOrderer) SendBroadcast(ctx reqContext.Context, envelope *fab.SignedEnvelope) (*common.Status, error)
SendBroadcast accepts client broadcast calls and reports them to the listener channel Returns the first enqueued error, or nil if there are no enqueued errors
func (*MockOrderer) SendDeliver ¶
func (o *MockOrderer) SendDeliver(ctx reqContext.Context, envelope *fab.SignedEnvelope) (chan *common.Block, chan error)
SendDeliver returns the channels for delivery of prepared mock values and errors (if any)
func (*MockOrderer) URL ¶
func (o *MockOrderer) URL() string
URL returns the URL of the mock Orderer
type MockPeer ¶
type MockPeer struct { RWLock *sync.RWMutex Error error MockName string MockURL string MockRoles []string MockCert *pem.Block Payload []byte ResponseMessage string MockMSP string Status int32 ProcessProposalCalls int Endorser []byte }
MockPeer is a mock fabricsdk.Peer.
func NewMockPeer ¶
NewMockPeer creates basic mock peer
func (*MockPeer) EnrollmentCertificate ¶
EnrollmentCertificate returns the mock peer's mock enrollment certificate
func (*MockPeer) ProcessTransactionProposal ¶
func (p *MockPeer) ProcessTransactionProposal(ctx reqContext.Context, tp fab.ProcessProposalRequest) (*fab.TransactionProposalResponse, error)
ProcessTransactionProposal does not send anything anywhere but returns an empty mock ProposalResponse
func (*MockPeer) SetEnrollmentCertificate ¶
SetEnrollmentCertificate sets the mock peer's mock enrollment certificate
type MockProviderContext ¶
type MockProviderContext struct {
// contains filtered or unexported fields
}
MockProviderContext holds core providers to enable mocking.
func NewMockProviderContext ¶
func NewMockProviderContext(userOpts ...ProviderOption) *MockProviderContext
NewMockProviderContext creates a MockProviderContext consisting of defaults
func NewMockProviderContextCustom ¶
func NewMockProviderContextCustom(config config.Config, cryptoSuite core.CryptoSuite, signer core.SigningManager, userStore msp.UserStore, identityManager map[string]msp.IdentityManager) *MockProviderContext
NewMockProviderContextCustom creates a MockProviderContext consisting of the arguments
func (*MockProviderContext) ChannelProvider ¶
func (pc *MockProviderContext) ChannelProvider() fab.ChannelProvider
ChannelProvider returns channel provider
func (*MockProviderContext) Config ¶
func (pc *MockProviderContext) Config() config.Config
Config returns the mock configuration.
func (*MockProviderContext) CryptoSuite ¶
func (pc *MockProviderContext) CryptoSuite() core.CryptoSuite
CryptoSuite returns the mock crypto suite.
func (*MockProviderContext) DiscoveryProvider ¶
func (pc *MockProviderContext) DiscoveryProvider() fab.DiscoveryProvider
DiscoveryProvider returns discovery provider
func (*MockProviderContext) IdentityManager ¶
func (pc *MockProviderContext) IdentityManager(orgName string) (msp.IdentityManager, bool)
IdentityManager returns the identity manager
func (*MockProviderContext) InfraProvider ¶
func (pc *MockProviderContext) InfraProvider() fab.InfraProvider
InfraProvider returns fabric provider
func (*MockProviderContext) PrivateKey ¶
func (pc *MockProviderContext) PrivateKey() core.Key
PrivateKey returns the crypto suite representation of the private key
func (*MockProviderContext) PublicVersion ¶
func (pc *MockProviderContext) PublicVersion() msp.Identity
PublicVersion returns the public parts of this identity
func (*MockProviderContext) SelectionProvider ¶
func (pc *MockProviderContext) SelectionProvider() fab.SelectionProvider
SelectionProvider returns selection provider
func (*MockProviderContext) SetConfig ¶
func (pc *MockProviderContext) SetConfig(config config.Config)
SetConfig sets the mock configuration.
func (*MockProviderContext) SetCustomInfraProvider ¶
func (pc *MockProviderContext) SetCustomInfraProvider(customInfraProvider fab.InfraProvider)
SetCustomInfraProvider sets custom fabric provider for unit-test purposes
func (*MockProviderContext) Sign ¶
func (pc *MockProviderContext) Sign(msg []byte) ([]byte, error)
Sign the message
func (*MockProviderContext) SigningManager ¶
func (pc *MockProviderContext) SigningManager() core.SigningManager
SigningManager returns the mock signing manager.
func (*MockProviderContext) UserStore ¶
func (pc *MockProviderContext) UserStore() msp.UserStore
UserStore returns the mock usser store
type MockSelectionProvider ¶
type MockSelectionProvider struct { Error error Peers []fab.Peer // contains filtered or unexported fields }
MockSelectionProvider implements mock selection provider
func NewMockSelectionProvider ¶
func NewMockSelectionProvider(err error, peers []fab.Peer) (*MockSelectionProvider, error)
NewMockSelectionProvider returns mock selection provider
func (*MockSelectionProvider) CreateSelectionService ¶
func (dp *MockSelectionProvider) CreateSelectionService(channelID string) (fab.SelectionService, error)
CreateSelectionService returns mock selection service
func (*MockSelectionProvider) SetCustomSelectionService ¶
func (dp *MockSelectionProvider) SetCustomSelectionService(customSelectionService fab.SelectionService)
SetCustomSelectionService sets custom selection service unit-test purposes
type MockSelectionService ¶
MockSelectionService implements mock selection service
func (*MockSelectionService) GetEndorsersForChaincode ¶
func (ds *MockSelectionService) GetEndorsersForChaincode(chaincodeIDs []string, opts ...options.Opt) ([]fab.Peer, error)
GetEndorsersForChaincode mockcore retrieving endorsing peers
type MockSigningIdentity ¶
type MockSigningIdentity struct { // we embed everything from a base identity MockIdentity // signer corresponds to the object that can produce signatures from this identity Signer crypto.Signer }
MockSigningIdentity ...
func (*MockSigningIdentity) GetPublicVersion ¶
func (id *MockSigningIdentity) GetPublicVersion() msp.Identity
GetPublicVersion ...
type MockStaticDiscoveryProvider ¶
type MockStaticDiscoveryProvider struct { Error error Peers []fab.Peer // contains filtered or unexported fields }
MockStaticDiscoveryProvider implements mock discovery provider
func NewMockDiscoveryProvider ¶
func NewMockDiscoveryProvider(err error, peers []fab.Peer) (*MockStaticDiscoveryProvider, error)
NewMockDiscoveryProvider returns mock discovery provider
func (*MockStaticDiscoveryProvider) CreateDiscoveryService ¶
func (dp *MockStaticDiscoveryProvider) CreateDiscoveryService(channelID string) (fab.DiscoveryService, error)
CreateDiscoveryService return discovery service for specific channel
func (*MockStaticDiscoveryProvider) SetCustomDiscoveryService ¶
func (dp *MockStaticDiscoveryProvider) SetCustomDiscoveryService(customDiscoveryService fab.DiscoveryService)
SetCustomDiscoveryService sets custom discoveryService
type MockStaticDiscoveryService ¶
MockStaticDiscoveryService implements mock discovery service
func NewMockDiscoveryService ¶
func NewMockDiscoveryService(err error, peers []fab.Peer) *MockStaticDiscoveryService
NewMockDiscoveryService returns a new MockStaticDiscoveryService
type MockTransactionHeader ¶
type MockTransactionHeader struct { MockID fab.TransactionID MockCreator []byte MockNonce []byte MockChannelID string }
MockTransactionHeader supplies a transaction ID and metadata.
func (*MockTransactionHeader) ChannelID ¶
func (th *MockTransactionHeader) ChannelID() string
ChannelID returns the transaction's target channel identifier.
func (*MockTransactionHeader) Creator ¶
func (th *MockTransactionHeader) Creator() []byte
Creator returns the transaction creator's identity bytes.
func (*MockTransactionHeader) Nonce ¶
func (th *MockTransactionHeader) Nonce() []byte
Nonce returns the transaction's generated nonce.
func (*MockTransactionHeader) TransactionID ¶
func (th *MockTransactionHeader) TransactionID() fab.TransactionID
TransactionID returns the transaction's computed identifier.
type MockTransactor ¶
MockTransactor provides an implementation of Transactor that exposes all its context.
func (*MockTransactor) CreateTransaction ¶
func (t *MockTransactor) CreateTransaction(request fab.TransactionRequest) (*fab.Transaction, error)
CreateTransaction create a transaction with proposal response.
func (*MockTransactor) CreateTransactionHeader ¶
func (t *MockTransactor) CreateTransactionHeader() (fab.TransactionHeader, error)
CreateTransactionHeader creates a Transaction Header based on the current context.
func (*MockTransactor) SendTransaction ¶
func (t *MockTransactor) SendTransaction(tx *fab.Transaction) (*fab.TransactionResponse, error)
SendTransaction send a transaction to the chain’s orderer service (one or more orderer endpoints) for consensus and committing to the ledger.
func (*MockTransactor) SendTransactionProposal ¶
func (t *MockTransactor) SendTransactionProposal(proposal *fab.TransactionProposal, targets []fab.ProposalProcessor) ([]*fab.TransactionProposalResponse, error)
SendTransactionProposal sends a TransactionProposal to the target peers.
type ProviderOption ¶
type ProviderOption func(*ProviderUsersOptions) error
ProviderOption describes a functional parameter for the New constructor
func WithProviderUser ¶
func WithProviderUser(username string, org string) ProviderOption
WithProviderUser option
type ProviderUsersOptions ¶
type ProviderUsersOptions struct {
// contains filtered or unexported fields
}
ProviderUsersOptions ...
type UsersOption ¶
type UsersOption func(*UsersOptions) error
UsersOption describes a functional parameter for the New constructor
type UsersOptions ¶
type UsersOptions struct {
// contains filtered or unexported fields
}
UsersOptions holds optional users
Source Files ¶
- mockbroadcastserver.go
- mockcaclient.go
- mockchconfig.go
- mockchprovider.go
- mockconfig.go
- mockcontext.go
- mockcryptosuite.go
- mockdata.go
- mockdiscovery.go
- mockendorserserver.go
- mockeventserver.go
- mockeventservice.go
- mockfabricprovider.go
- mockidentity.go
- mockidentitymgr.go
- mockmembership.go
- mockmsp.go
- mockmspmanager.go
- mockorderer.go
- mockpeer.go
- mockselection.go
- mocktransactor.go