mock

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MessageProtocolVersion = 1
)

Variables

This section is empty.

Functions

func ResponseError

func ResponseError(in *service.ChaincodeExec, r peer.Response) (peer.Response, error)

func ResponseInvokeError

func ResponseInvokeError(in *service.ChaincodeExec, r peer.Response) (peer.Response, error)

Types

type ChaincodeService

type ChaincodeService struct {
	// channel name -> chaincode name
	ChannelCC Channels

	ResponseMutator ResponseMutator
	// contains filtered or unexported fields
}

func New

func New() *ChaincodeService

func (*ChaincodeService) Chaincode

func (cs *ChaincodeService) Chaincode(channel string, chaincode string) (*testing.MockStub, error)

func (*ChaincodeService) Events

func (*ChaincodeService) Exec

func (*ChaincodeService) Invoke

func (cs *ChaincodeService) Invoke(ctx context.Context, in *service.ChaincodeInput) (proposalResponse *peer.ProposalResponse, err error)

func (*ChaincodeService) Query

func (*ChaincodeService) WithChannel

func (cs *ChaincodeService) WithChannel(channel string, mockStubs ...*testing.MockStub) *ChaincodeService

type Channel

type Channel map[string]*testing.MockStub

type Channels

type Channels map[string]Channel

type ResponseMutator

type ResponseMutator func(in *service.ChaincodeExec, r peer.Response) (peer.Response, error)

ResponseMutator allows to imitate peer errors or unavailability

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL