mock

package
v0.7.7 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2021 License: MIT Imports: 8 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 {
	service.UnimplementedChaincodeServer
	// channel name -> chaincode name
	Peer *testing.MockedPeer

	Invoker ChaincodeInvoker
	// contains filtered or unexported fields
}

func New

func New(peers ...*testing.MockedPeer) *ChaincodeService

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

Jump to

Keyboard shortcuts

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