test

package
v0.0.0-...-d4bb699 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ChainIdTest = "chain01"
)

contract and chain info

Variables

View Source
var ByteCodeFile = "./test/contract01/token.bin"

ByteCodeFile byte code file path

View Source
var CertFilePath = "./config/admin1.sing.crt"

CertFilePath cert file path

View Source
var ContractName = "contract01"
View Source
var ContractVersion = "v1.0.0"

Functions

func BaseParam

func BaseParam(parameters map[string][]byte)

Types

type TxContextMockTest

type TxContextMockTest struct {
	// contains filtered or unexported fields
}

func InitContextTest

func InitContextTest(runtimeType commonPb.RuntimeType) (*commonPb.Contract, *TxContextMockTest, []byte)

InitContextTest 初始化上下文和wasm字节码

func (*TxContextMockTest) CallContract

func (s *TxContextMockTest) CallContract(contract *commonPb.Contract, method string, byteCode []byte,
	parameter map[string][]byte, gasUsed uint64, refTxType commonPb.TxType) (*commonPb.ContractResult,
	protocol.ExecOrderTxType, commonPb.TxStatusCode)

func (*TxContextMockTest) Del

func (s *TxContextMockTest) Del(name string, key []byte) error

func (*TxContextMockTest) Get

func (s *TxContextMockTest) Get(name string, key []byte) ([]byte, error)

func (*TxContextMockTest) GetAccessControl

func (*TxContextMockTest) GetAccessControl() (protocol.AccessControlProvider, error)

func (*TxContextMockTest) GetBlockHeight

func (*TxContextMockTest) GetBlockHeight() uint64

func (*TxContextMockTest) GetBlockProposer

func (s *TxContextMockTest) GetBlockProposer() *acPb.Member

func (*TxContextMockTest) GetBlockTimestamp

func (s *TxContextMockTest) GetBlockTimestamp() int64

func (*TxContextMockTest) GetBlockVersion

func (s *TxContextMockTest) GetBlockVersion() uint32

func (*TxContextMockTest) GetBlockchainStore

func (*TxContextMockTest) GetBlockchainStore() protocol.BlockchainStore

func (*TxContextMockTest) GetChainNodesInfoProvider

func (s *TxContextMockTest) GetChainNodesInfoProvider() (protocol.ChainNodesInfoProvider, error)

func (*TxContextMockTest) GetContractByName

func (s *TxContextMockTest) GetContractByName(name string) (*commonPb.Contract, error)

func (*TxContextMockTest) GetContractBytecode

func (s *TxContextMockTest) GetContractBytecode(name string) ([]byte, error)

func (*TxContextMockTest) GetCreator

func (s *TxContextMockTest) GetCreator(namespace string) *acPb.Member

func (*TxContextMockTest) GetCurrentResult

func (s *TxContextMockTest) GetCurrentResult() []byte

func (*TxContextMockTest) GetDepth

func (s *TxContextMockTest) GetDepth() int

func (*TxContextMockTest) GetHistoryIterForKey

func (s *TxContextMockTest) GetHistoryIterForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)

func (*TxContextMockTest) GetIterHandle

func (s *TxContextMockTest) GetIterHandle(index int32) (interface{}, bool)

func (*TxContextMockTest) GetNoRecord

func (s *TxContextMockTest) GetNoRecord(contractName string, key []byte) ([]byte, error)

func (*TxContextMockTest) GetSender

func (s *TxContextMockTest) GetSender() *acPb.Member

func (*TxContextMockTest) GetStateKvHandle

func (s *TxContextMockTest) GetStateKvHandle(i int32) (protocol.StateIterator, bool)

func (*TxContextMockTest) GetStateSqlHandle

func (s *TxContextMockTest) GetStateSqlHandle(i int32) (protocol.SqlRows, bool)

func (*TxContextMockTest) GetTx

func (*TxContextMockTest) GetTxExecSeq

func (*TxContextMockTest) GetTxExecSeq() int

func (TxContextMockTest) GetTxRWSet

func (TxContextMockTest) GetTxRWSet(runVmSuccess bool) *commonPb.TxRWSet

func (*TxContextMockTest) GetTxResult

func (s *TxContextMockTest) GetTxResult() *commonPb.Result

func (*TxContextMockTest) Put

func (s *TxContextMockTest) Put(name string, key []byte, value []byte) error

func (*TxContextMockTest) PutIntoReadSet

func (s *TxContextMockTest) PutIntoReadSet(contractName string, key []byte, value []byte)

func (*TxContextMockTest) PutRecord

func (s *TxContextMockTest) PutRecord(contractName string, value []byte, sqlType protocol.SqlType)

func (*TxContextMockTest) Select

func (s *TxContextMockTest) Select(name string, startKey []byte, limit []byte) (protocol.StateIterator, error)

func (*TxContextMockTest) SetIterHandle

func (s *TxContextMockTest) SetIterHandle(index int32, iter interface{})

func (*TxContextMockTest) SetStateKvHandle

func (s *TxContextMockTest) SetStateKvHandle(i int32, iterator protocol.StateIterator)

func (*TxContextMockTest) SetStateSqlHandle

func (s *TxContextMockTest) SetStateSqlHandle(i int32, rows protocol.SqlRows)

func (*TxContextMockTest) SetTxExecSeq

func (*TxContextMockTest) SetTxExecSeq(i int)

func (*TxContextMockTest) SetTxResult

func (s *TxContextMockTest) SetTxResult(txResult *commonPb.Result)

Jump to

Keyboard shortcuts

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