mock

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2021 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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