mock

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 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

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

Types

type ChaincodeInvoker

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

ChaincodeInvoker allows to imitate peer errors or unavailability

func FailChaincode

func FailChaincode(chaincodes ...string) ChaincodeInvoker

func FailInvokeChaincode

func FailInvokeChaincode(chaincodes ...string) ChaincodeInvoker

type ChaincodeService

type ChaincodeService struct {
	gateway.ChaincodeService
	// 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 *gateway.ChaincodeInput) (proposalResponse *peer.Response, err error)

func (*ChaincodeService) Query

Jump to

Keyboard shortcuts

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