Documentation
¶
Index ¶
- Constants
- Variables
- func DefaultInvoker(ctx context.Context, mockStub *testing.MockStub, in *gateway.ChaincodeExec) *peer.Response
- type ChaincodeInvoker
- type ChaincodeService
- func (cs *ChaincodeService) Events(in *gateway.ChaincodeEventsRequest, ...) (err error)
- func (cs *ChaincodeService) Exec(ctx context.Context, in *gateway.ChaincodeExec) (*peer.Response, error)
- func (cs *ChaincodeService) Invoke(ctx context.Context, in *gateway.ChaincodeInput) (proposalResponse *peer.Response, err error)
- func (cs *ChaincodeService) Query(ctx context.Context, in *gateway.ChaincodeInput) (*peer.Response, error)
Constants ¶
View Source
const (
MessageProtocolVersion = 1
)
Variables ¶
View Source
var (
InvokeErrorResponse = &peer.Response{Status: shim.ERROR, Message: `invoke failed`}
)
Functions ¶
func DefaultInvoker ¶
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 (cs *ChaincodeService) Events(in *gateway.ChaincodeEventsRequest, stream gateway.ChaincodeService_EventsServer) (err error)
func (*ChaincodeService) Exec ¶
func (cs *ChaincodeService) Exec(ctx context.Context, in *gateway.ChaincodeExec) (*peer.Response, error)
func (*ChaincodeService) Invoke ¶
func (cs *ChaincodeService) Invoke(ctx context.Context, in *gateway.ChaincodeInput) (proposalResponse *peer.Response, err error)
func (*ChaincodeService) Query ¶
func (cs *ChaincodeService) Query(ctx context.Context, in *gateway.ChaincodeInput) (*peer.Response, error)
Click to show internal directories.
Click to hide internal directories.