Documentation ¶
Index ¶
- Constants
- Variables
- func BaseParam(parameters map[string][]byte)
- type TxContextMockTest
- func (s *TxContextMockTest) CallContract(contract *commonPb.Contract, method string, byteCode []byte, ...) (*commonPb.ContractResult, protocol.ExecOrderTxType, commonPb.TxStatusCode)
- func (s *TxContextMockTest) Del(name string, key []byte) error
- func (s *TxContextMockTest) Get(name string, key []byte) ([]byte, error)
- func (*TxContextMockTest) GetAccessControl() (protocol.AccessControlProvider, error)
- func (*TxContextMockTest) GetBlockHeight() uint64
- func (s *TxContextMockTest) GetBlockProposer() *acPb.Member
- func (s *TxContextMockTest) GetBlockTimestamp() int64
- func (s *TxContextMockTest) GetBlockVersion() uint32
- func (*TxContextMockTest) GetBlockchainStore() protocol.BlockchainStore
- func (s *TxContextMockTest) GetChainNodesInfoProvider() (protocol.ChainNodesInfoProvider, error)
- func (s *TxContextMockTest) GetContractByName(name string) (*commonPb.Contract, error)
- func (s *TxContextMockTest) GetContractBytecode(name string) ([]byte, error)
- func (s *TxContextMockTest) GetCreator(namespace string) *acPb.Member
- func (s *TxContextMockTest) GetCurrentResult() []byte
- func (s *TxContextMockTest) GetDepth() int
- func (s *TxContextMockTest) GetHistoryIterForKey(contractName string, key []byte) (protocol.KeyHistoryIterator, error)
- func (s *TxContextMockTest) GetIterHandle(index int32) (interface{}, bool)
- func (s *TxContextMockTest) GetNoRecord(contractName string, key []byte) ([]byte, error)
- func (s *TxContextMockTest) GetSender() *acPb.Member
- func (s *TxContextMockTest) GetStateKvHandle(i int32) (protocol.StateIterator, bool)
- func (s *TxContextMockTest) GetStateSqlHandle(i int32) (protocol.SqlRows, bool)
- func (s *TxContextMockTest) GetTx() *commonPb.Transaction
- func (*TxContextMockTest) GetTxExecSeq() int
- func (TxContextMockTest) GetTxRWSet(runVmSuccess bool) *commonPb.TxRWSet
- func (s *TxContextMockTest) GetTxResult() *commonPb.Result
- func (s *TxContextMockTest) Put(name string, key []byte, value []byte) error
- func (s *TxContextMockTest) PutIntoReadSet(contractName string, key []byte, value []byte)
- func (s *TxContextMockTest) PutRecord(contractName string, value []byte, sqlType protocol.SqlType)
- func (s *TxContextMockTest) Select(name string, startKey []byte, limit []byte) (protocol.StateIterator, error)
- func (s *TxContextMockTest) SetIterHandle(index int32, iter interface{})
- func (s *TxContextMockTest) SetStateKvHandle(i int32, iterator protocol.StateIterator)
- func (s *TxContextMockTest) SetStateSqlHandle(i int32, rows protocol.SqlRows)
- func (*TxContextMockTest) SetTxExecSeq(i int)
- func (s *TxContextMockTest) SetTxResult(txResult *commonPb.Result)
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 ¶
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) 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 (s *TxContextMockTest) GetTx() *commonPb.Transaction
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)
Click to show internal directories.
Click to hide internal directories.