Versions in this module Expand all Collapse all v1 v1.1.0 Apr 12, 2019 Changes in this version + var TestBlock = &po.DeliverResponse + 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 NewMockChannelCfg(name string) fab.ChannelCfg + func NewMockConfig() config.Config + func NewMockConfigCustomized(tlsEnabled, mutualTLSEnabled, errorCase bool) config.Config + func NewMockCredentialManager(orgName string, config apiconfig.Config, ...) (apifabclient.CredentialManager, error) + func NewMockIdentity(err error) (msp.Identity, error) + func NewMockOrderer(url string, broadcastListener chan *fab.SignedEnvelope) fab.Orderer + func NewMockSigningIdentity() (msp.SigningIdentity, error) + func NewMockSigningManager() apifabclient.SigningManager + func NewMockTxnID() (fab.TransactionID, error) + func NewMockUser(name string) ca.User + func NewMockUserWithMSPID(name string, mspid string) ca.User + func NewSimpleMockBlock() *common.Block + func NewSimpleMockError() error + type MockBroadcastServer struct + BroadcastError error + BroadcastInternalServerError bool + DeliverError error + DeliverResponse *po.DeliverResponse + func StartMockBroadcastServer(broadcastTestURL string) *MockBroadcastServer + func (m *MockBroadcastServer) Broadcast(server po.AtomicBroadcast_BroadcastServer) error + func (m *MockBroadcastServer) Deliver(server po.AtomicBroadcast_DeliverServer) error + type MockChannelCfg struct + MockAnchorPeers []*fab.OrgAnchorPeer + MockMsps []*msp.MSPConfig + MockName string + MockOrderers []string + MockVersions *fab.Versions + func (cfg *MockChannelCfg) AnchorPeers() []*fab.OrgAnchorPeer + func (cfg *MockChannelCfg) Msps() []*msp.MSPConfig + func (cfg *MockChannelCfg) Name() string + func (cfg *MockChannelCfg) Orderers() []string + func (cfg *MockChannelCfg) Versions() *fab.Versions + type MockChannelConfig struct + func NewMockChannelConfig(ctx fab.Context, channelID string) (*MockChannelConfig, error) + func (c *MockChannelConfig) Query() (fab.ChannelCfg, error) + type MockChannelProvider struct + func NewMockChannelProvider(ctx fab.Context) (*MockChannelProvider, error) + func (cp *MockChannelProvider) NewChannelService(ic fab.IdentityContext, channelID string) (fab.ChannelService, error) + func (cp *MockChannelProvider) SetChannel(id string, channel fab.Channel) + type MockChannelService struct + func (cs *MockChannelService) Channel() (fab.Channel, error) + func (cs *MockChannelService) Config() (fab.ChannelConfig, error) + func (cs *MockChannelService) EventHub() (fab.EventHub, error) + func (cs *MockChannelService) Ledger() (fab.ChannelLedger, error) + type MockConfig struct + 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) CryptoConfigPath() string + func (c *MockConfig) Ephemeral() bool + 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) 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) SetTLSCACertPool(pool *sm2.CertPool) + func (c *MockConfig) SoftVerify() bool + func (c *MockConfig) TLSCACertPool(cert ...*sm2.Certificate) (*sm2.CertPool, error) + func (c *MockConfig) TLSClientCerts() ([]tls.Certificate, error) + func (c *MockConfig) TcertBatchSize() int + func (c *MockConfig) TimeoutOrDefault(arg config.TimeoutType) time.Duration + type MockConfigBlockBuilder struct + Index uint64 + LastConfigIndex uint64 + func (b *MockConfigBlockBuilder) Build() *common.Block + type MockConfigGroupBuilder struct + Groups map[string]*common.ConfigGroup + MSPNames []string + ModPolicy string + OrdererAddress string + RootCA string + Version uint64 + type MockConfigUpdateEnvelopeBuilder struct + ChannelID string + func (b *MockConfigUpdateEnvelopeBuilder) Build() *common.Envelope + func (b *MockConfigUpdateEnvelopeBuilder) BuildBytes() []byte + func (b *MockConfigUpdateEnvelopeBuilder) BuildConfigUpdateBytes() []byte + type MockContext struct + func NewMockContext(ic fab.IdentityContext) *MockContext + type MockCredentialManager struct + func (mgr *MockCredentialManager) GetSigningIdentity(userName string) (*apifabclient.SigningIdentity, error) + type MockCryptoSuite struct + func (m *MockCryptoSuite) GetHash(opts apicryptosuite.HashOpts) (h hash.Hash, err error) + func (m *MockCryptoSuite) GetKey(ski []byte) (k apicryptosuite.Key, err error) + func (m *MockCryptoSuite) Hash(msg []byte, opts apicryptosuite.HashOpts) (hash []byte, err error) + func (m *MockCryptoSuite) KeyGen(opts apicryptosuite.KeyGenOpts) (k apicryptosuite.Key, err error) + func (m *MockCryptoSuite) KeyImport(raw interface{}, opts apicryptosuite.KeyImportOpts) (k apicryptosuite.Key, err error) + func (m *MockCryptoSuite) Sign(k apicryptosuite.Key, digest []byte, opts apicryptosuite.SignerOpts) (signature []byte, err error) + func (m *MockCryptoSuite) Verify(k apicryptosuite.Key, signature, digest []byte, opts apicryptosuite.SignerOpts) (valid bool, err error) + type MockEndorserServer struct + AddkvWrite bool + ProposalError error + func StartEndorserServer(endorserTestURL string) *MockEndorserServer + func (m *MockEndorserServer) ProcessProposal(context context.Context, proposal *pb.SignedProposal) (*pb.ProposalResponse, error) + type MockEventHub struct + RegisteredTxCallbacks chan func(string, pb.TxValidationCode, error) + func NewMockEventHub() *MockEventHub + func (m *MockEventHub) Connect() error + func (m *MockEventHub) Disconnect() error + func (m *MockEventHub) IsConnected() bool + func (m *MockEventHub) RegisterBlockEvent(callback func(*common.Block)) + func (m *MockEventHub) RegisterChaincodeEvent(ccid string, eventname string, callback func(*apifabclient.ChaincodeEvent)) *apifabclient.ChainCodeCBE + func (m *MockEventHub) RegisterTxEvent(txnID apifabclient.TransactionID, ...) + func (m *MockEventHub) SetPeerAddr(peerURL string, certificate *sm2.Certificate, serverHostOverride string) + func (m *MockEventHub) UnregisterBlockEvent(callback func(*common.Block)) + func (m *MockEventHub) UnregisterChaincodeEvent(cbe *apifabclient.ChainCodeCBE) + func (m *MockEventHub) UnregisterTxEvent(txnID apifabclient.TransactionID) + type MockEventServer struct + func StartMockEventServer(testAddress string) (*MockEventServer, error) + func (m *MockEventServer) Chat(srv pb.Events_ChatServer) error + func (m *MockEventServer) SendMockEvent(event *pb.Event) + func (m *MockEventServer) Stop() + type MockIdentity struct + Err error + 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 MockMSP struct + Err error + func NewMockMSP(err error) *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 struct + Err error + MSPs map[string]msp.MSP + func NewMockMSPManager(msps map[string]msp.MSP) *MockMSPManager + func NewMockMSPManagerWithError(msps map[string]msp.MSP, err error) *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 MockOrderer interface + EnqueueForSendDeliver func(value interface{}) + EnqueueSendBroadcastError func(err error) + type MockPeer struct + Endorser []byte + Error error + MockCert *pem.Block + MockMSP string + MockName string + MockRoles []string + MockURL string + Payload []byte + ProcessProposalCalls int + RWLock *sync.RWMutex + ResponseMessage string + Status int32 + func NewMockPeer(name string, url string) *MockPeer + func (p *MockPeer) EnrollmentCertificate() *pem.Block + func (p *MockPeer) MSPID() string + func (p *MockPeer) ProcessTransactionProposal(tp apifabclient.TransactionProposal) (apifabclient.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 + func (p MockPeer) Name() string + type MockProviderContext struct + func NewMockProviderContext() *MockProviderContext + func NewMockProviderContextCustom(config config.Config, cryptoSuite apicryptosuite.CryptoSuite, ...) *MockProviderContext + func (pc *MockProviderContext) Config() config.Config + func (pc *MockProviderContext) CryptoSuite() apicryptosuite.CryptoSuite + func (pc *MockProviderContext) SetConfig(config config.Config) + func (pc *MockProviderContext) SigningManager() fab.SigningManager + type MockResource struct + func NewMockInvalidResource() *MockResource + func NewMockResource() *MockResource + func (c *MockResource) CreateChannel(request fab.CreateChannelRequest) (fab.TransactionID, error) + func (c *MockResource) ExtractChannelConfig(configEnvelope []byte) ([]byte, error) + func (c *MockResource) GenesisBlockFromOrderer(channelName string, orderer fab.Orderer) (*common.Block, error) + func (c *MockResource) InstallChaincode(req fab.InstallChaincodeRequest) ([]*fab.TransactionProposalResponse, string, error) + func (c *MockResource) JoinChannel(request fab.JoinChannelRequest) error + func (c *MockResource) QueryChannels(peer fab.ProposalProcessor) (*pb.ChannelQueryResponse, error) + func (c *MockResource) QueryInstalledChaincodes(peer fab.ProposalProcessor) (*pb.ChaincodeQueryResponse, error) + func (c *MockResource) SignChannelConfig(config []byte, signer fab.IdentityContext) (*common.ConfigSignature, error) + type MockSigningIdentity struct + Signer crypto.Signer + func (id *MockSigningIdentity) GetPublicVersion() msp.Identity + func (id *MockSigningIdentity) Sign(msg []byte) ([]byte, error) + type MockSigningManager struct + func (mgr *MockSigningManager) Sign(object []byte, key apicryptosuite.Key) ([]byte, error) + type MockUser struct + func (u *MockUser) EnrollmentCertificate() []byte + func (u *MockUser) GenerateTcerts(count int, attributes []string) + func (u *MockUser) Identity() ([]byte, error) + func (u *MockUser) MspID() string + func (u *MockUser) Name() string + func (u *MockUser) PrivateKey() apicryptosuite.Key + func (u *MockUser) Roles() []string + func (u *MockUser) SetEnrollmentCertificate(cert []byte) + func (u *MockUser) SetMspID(mspID string) + func (u *MockUser) SetPrivateKey(privateKey apicryptosuite.Key) + func (u *MockUser) SetRoles(roles []string)