util

package
v1.1.1-0...-b6d616f Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2020 License: GPL-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MockInitTransaction

func MockInitTransaction(t *testing.T, stub *MockStubExtend, args [][]byte) string

MockIInit creates a mock invoke transaction using MockStubExtend

func MockInvokeTransaction

func MockInvokeTransaction(t *testing.T, stub *MockStubExtend, args [][]byte) string

MockInvokeTransaction creates a mock invoke transaction using MockStubExtend

func MockQueryTransaction

func MockQueryTransaction(t *testing.T, stub *MockStubExtend, args [][]byte) string

MockQueryTransaction creates a mock query transaction using MockStubExtend

Types

type MockStubExtend

type MockStubExtend struct {
	CouchDB   bool            // if we use couchDB
	DbHandler *CouchDBHandler // if we use couchDB
	*MockStub
	// contains filtered or unexported fields
}

MockStubExtend provides composition class for MockStub as some of the mockstub methods are not implemented

func NewMockStubExtend

func NewMockStubExtend(stub *MockStub, c Chaincode) *MockStubExtend

NewMockStubExtend constructor

func (*MockStubExtend) GetFunctionAndParameters

func (stub *MockStubExtend) GetFunctionAndParameters() (function string, params []string)

GetFunctionAndParameters Override this function from MockStub

func (*MockStubExtend) GetQueryResult

func (stub *MockStubExtend) GetQueryResult(query string) (StateQueryIteratorInterface, error)

GetQueryResult overrides the same function in MockStub that did not implement anything.

func (*MockStubExtend) GetQueryResultWithPagination

func (stub *MockStubExtend) GetQueryResultWithPagination(query string, pageSize int32,
	bookmark string) (StateQueryIteratorInterface, *pb.QueryResponseMetadata, error)

GetQueryResultWithPagination overrides the same function in MockStub that did not implement anything.

func (*MockStubExtend) GetState

func (stub *MockStubExtend) GetState(key string) ([]byte, error)

GetState retrieves the value for a given key from the ledger

func (*MockStubExtend) GetStateByPartialCompositeKey

func (stub *MockStubExtend) GetStateByPartialCompositeKey(objectType string, attributes []string) (StateQueryIteratorInterface, error)

GetStateByPartialCompositeKey queries couchdb by range

func (*MockStubExtend) GetStateOriginal

func (stub *MockStubExtend) GetStateOriginal(key string) ([]byte, error)

GetStateOriginal is copied from mockstub as we still need to carry on normal GetState operation with the mock ledger map

func (*MockStubExtend) GetStringArgs

func (stub *MockStubExtend) GetStringArgs() []string

GetStringArgs override this function from MockStub

func (*MockStubExtend) MockInit

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

MockInit Override this function from MockStub

func (*MockStubExtend) MockInvoke

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

MockInvoke Override this function from MockStub

func (*MockStubExtend) PutState

func (stub *MockStubExtend) PutState(key string, value []byte) error

PutState writes the specified `value` and `key` into the ledger.

func (*MockStubExtend) SetCouchDBConfiguration

func (stub *MockStubExtend) SetCouchDBConfiguration(handler *CouchDBHandler)

SetCouchDBConfiguration sets the couchdb configuration with appropriate database handler

Jump to

Keyboard shortcuts

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