fabric-sdk-go: github.com/hyperledger/fabric-sdk-go/pkg/client/common/mocks Index | Files

package mocks

import "github.com/hyperledger/fabric-sdk-go/pkg/client/common/mocks"


Package Files

mockdiscovery.go mockdiscoveryclient.go mockselection.go mocktransactor.go

type MockDiscoverEndpointResponse Uses

type MockDiscoverEndpointResponse struct {
    Target        string
    PeerEndpoints []*discmocks.MockDiscoveryPeerEndpoint
    Error         error

MockDiscoverEndpointResponse contains a mock response for the discover client

func (*MockDiscoverEndpointResponse) Build Uses

func (b *MockDiscoverEndpointResponse) Build() fabdiscovery.Response

Build builds a mock discovery response

type MockDiscoveryClient Uses

type MockDiscoveryClient struct {
    // contains filtered or unexported fields

MockDiscoveryClient implements a mock Discover service

func NewMockDiscoveryClient Uses

func NewMockDiscoveryClient() *MockDiscoveryClient

NewMockDiscoveryClient returns a new mock Discover service

func (*MockDiscoveryClient) Send Uses

func (m *MockDiscoveryClient) Send(ctx reqcontext.Context, req *fabdiscovery.Request, targets ...fab.PeerConfig) ([]fabdiscovery.Response, error)

Send sends a Discovery request

func (*MockDiscoveryClient) SetResponses Uses

func (m *MockDiscoveryClient) SetResponses(responses ...MockResponseBuilder)

SetResponses sets the responses that the mock client should return from the Send function

type MockResponseBuilder Uses

type MockResponseBuilder interface {
    Build() fabdiscovery.Response

MockResponseBuilder builds a mock discovery response

type MockSelectionService Uses

type MockSelectionService struct {
    Error          error
    Peers          []fab.Peer
    ChannelContext context.Channel

MockSelectionService implements mock selection service

func NewMockSelectionService Uses

func NewMockSelectionService(err error, peers ...fab.Peer) *MockSelectionService

NewMockSelectionService returns mock selection service

func (*MockSelectionService) GetEndorsersForChaincode Uses

func (ds *MockSelectionService) GetEndorsersForChaincode(chaincodes []*fab.ChaincodeCall, opts ...options.Opt) ([]fab.Peer, error)

GetEndorsersForChaincode mockcore retrieving endorsing peers

type MockStaticDiscoveryProvider Uses

type MockStaticDiscoveryProvider struct {
    Error error
    Peers []fab.Peer

MockStaticDiscoveryProvider implements mock discovery provider

func NewMockDiscoveryProvider Uses

func NewMockDiscoveryProvider(err error, peers []fab.Peer) (*MockStaticDiscoveryProvider, error)

NewMockDiscoveryProvider returns mock discovery provider

func (*MockStaticDiscoveryProvider) CreateLocalDiscoveryService Uses

func (dp *MockStaticDiscoveryProvider) CreateLocalDiscoveryService(mspID string) (fab.DiscoveryService, error)

CreateLocalDiscoveryService return discovery service for specific channel

type MockStaticDiscoveryService Uses

type MockStaticDiscoveryService struct {
    Error error
    Peers []fab.Peer

MockStaticDiscoveryService implements mock discovery service

func NewMockDiscoveryService Uses

func NewMockDiscoveryService(err error, peers ...fab.Peer) *MockStaticDiscoveryService

NewMockDiscoveryService returns mock discovery service

func (*MockStaticDiscoveryService) GetPeers Uses

func (ds *MockStaticDiscoveryService) GetPeers() ([]fab.Peer, error)

GetPeers is used to discover eligible peers for chaincode

type MockTransactor Uses

type MockTransactor struct {
    Ctx       context.Client
    ChannelID string
    Orderers  []fab.Orderer

MockTransactor provides an implementation of Transactor that exposes all its context.

func (*MockTransactor) CreateTransaction Uses

func (t *MockTransactor) CreateTransaction(request fab.TransactionRequest) (*fab.Transaction, error)

CreateTransaction create a transaction with proposal response.

func (*MockTransactor) CreateTransactionHeader Uses

func (t *MockTransactor) CreateTransactionHeader(opts ...fab.TxnHeaderOpt) (fab.TransactionHeader, error)

CreateTransactionHeader creates a Transaction Header based on the current context.

func (*MockTransactor) SendTransaction Uses

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 Uses

func (t *MockTransactor) SendTransactionProposal(proposal *fab.TransactionProposal, targets []fab.ProposalProcessor) ([]*fab.TransactionProposalResponse, error)

SendTransactionProposal sends a TransactionProposal to the target peers.

Package mocks imports 17 packages (graph). Updated 2019-08-26. Refresh now. Tools for package owners.