Documentation ¶
Index ¶
- Constants
- Variables
- func DefaultInvoker(ctx context.Context, mockStub *testing.MockStub, in *service.ChaincodeExec) *peer.Response
- type ChaincodeInvoker
- type ChaincodeService
- func (cs *ChaincodeService) Chaincode(channel string, chaincode string) (*testing.MockStub, error)
- func (cs *ChaincodeService) Events(in *service.ChaincodeLocator, stream service.Chaincode_EventsServer) (err error)
- func (cs *ChaincodeService) Exec(ctx context.Context, in *service.ChaincodeExec) (*peer.ProposalResponse, error)
- func (cs *ChaincodeService) Invoke(ctx context.Context, in *service.ChaincodeInput) (proposalResponse *peer.ProposalResponse, err error)
- func (cs *ChaincodeService) Query(ctx context.Context, in *service.ChaincodeInput) (*peer.ProposalResponse, error)
- func (cs *ChaincodeService) WithChannel(channel string, mockStubs ...*testing.MockStub) *ChaincodeService
- type Channel
- type Channels
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
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) Events ¶
func (cs *ChaincodeService) Events(in *service.ChaincodeLocator, stream service.Chaincode_EventsServer) (err error)
func (*ChaincodeService) Exec ¶
func (cs *ChaincodeService) Exec(ctx context.Context, in *service.ChaincodeExec) (*peer.ProposalResponse, error)
func (*ChaincodeService) Invoke ¶
func (cs *ChaincodeService) Invoke(ctx context.Context, in *service.ChaincodeInput) (proposalResponse *peer.ProposalResponse, err error)
func (*ChaincodeService) Query ¶
func (cs *ChaincodeService) Query(ctx context.Context, in *service.ChaincodeInput) (*peer.ProposalResponse, error)
func (*ChaincodeService) WithChannel ¶
func (cs *ChaincodeService) WithChannel(channel string, mockStubs ...*testing.MockStub) *ChaincodeService
Click to show internal directories.
Click to hide internal directories.