mocks

package
v0.4.33 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MspID string

MspID peers mspid

Functions

This section is empty.

Types

type MockStub

type MockStub struct {
	shim.MockStub

	// registered list of other MockStub chaincodes that can be called from this MockStub
	Invokables map[string]*MockStub
	// contains filtered or unexported fields
}

MockStub is an implementation of ChaincodeStubInterface for unit testing chaincode. Use this instead of ChaincodeStub in your chaincode's unit test calls to Init or Invoke.

func NewMockStub

func NewMockStub(name string, cc shim.Chaincode) *MockStub

NewMockStub Constructor to initialise the internal State map

func (*MockStub) GetArgs

func (stub *MockStub) GetArgs() [][]byte

GetArgs returns args

func (*MockStub) GetCreator

func (stub *MockStub) GetCreator() ([]byte, error)

GetCreator to get creator bytes

func (*MockStub) MockInit

func (stub *MockStub) MockInit(uuid string, args [][]byte) pb.Response

MockInit Initialise this chaincode, also starts and ends a transaction.

func (*MockStub) MockInvoke

func (stub *MockStub) MockInvoke(uuid string, args [][]byte) pb.Response

MockInvoke invokes this chaincode, also starts and ends a transaction.

func (*MockStub) SetMspID

func (stub *MockStub) SetMspID(mspid string)

SetMspID to set mspid

Jump to

Keyboard shortcuts

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