mock

package
v0.6.5 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	MessageProtocolVersion = 1
)

Variables

View Source
var (
	InvokeErrorResponse = &peer.Response{Status: shim.ERROR, Message: `invoke failed`}
)

Functions

func DefaultInvoker added in v0.6.5

func DefaultInvoker(ctx context.Context, mockStub *testing.MockStub, in *service.ChaincodeExec) *peer.Response

Types

type ChaincodeInvoker added in v0.6.5

type ChaincodeInvoker func(ctx context.Context, mockStub *testing.MockStub, in *service.ChaincodeExec) *peer.Response

ChaincodeInvoker allows to imitate peer errors or unavailability

func FailChaincode added in v0.6.5

func FailChaincode(chaincodes ...string) ChaincodeInvoker

func FailInvokeChaincode added in v0.6.5

func FailInvokeChaincode(chaincodes ...string) ChaincodeInvoker

type ChaincodeService

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

	Invoker ChaincodeInvoker
	// 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

Jump to

Keyboard shortcuts

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