Documentation ¶
Index ¶
- Variables
- func NewTxSimContext(vmManager protocol.VmManager, snapshot protocol.Snapshot, ...) protocol.TxSimContext
- func NewVmManager(instanceManagers map[commonPb.RuntimeType]protocol.VmInstancesManager, ...) protocol.VmManager
- func PrintTxReadSet(txSimContext protocol.TxSimContext)
- func PrintTxWriteSet(txSimContext protocol.TxSimContext)
- type Bool
- type SimContextIterator
- type SimContextKeyHistoryIterator
- type VmManagerImpl
- func (m *VmManagerImpl) GetAccessControl() protocol.AccessControlProvider
- func (m *VmManagerImpl) GetChainNodesInfoProvider() protocol.ChainNodesInfoProvider
- func (m *VmManagerImpl) RunContract(contract *commonPb.Contract, method string, byteCode []byte, ...) (*commonPb.ContractResult, protocol.ExecOrderTxType, commonPb.TxStatusCode)
- func (m *VmManagerImpl) Start() error
- func (m *VmManagerImpl) Stop() error
- type WSetKeyHistoryIterator
- type Wacsi
- type WacsiImpl
- func (*WacsiImpl) BulletProofsOperation(requestBody []byte, memory []byte, data []byte, isLen bool) ([]byte, error)
- func (w *WacsiImpl) CallContract(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, ...) (*common.ContractResult, uint64, protocol.ExecOrderTxType, error)
- func (w *WacsiImpl) DeleteState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext) error
- func (w *WacsiImpl) EmitEvent(requestBody []byte, txSimContext protocol.TxSimContext, ...) (*common.ContractEvent, error)
- func (w *WacsiImpl) ErrorResult(contractResult *common.ContractResult, data []byte) int32
- func (w *WacsiImpl) ExecuteDDL(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) error
- func (w *WacsiImpl) ExecuteQuery(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) error
- func (w *WacsiImpl) ExecuteQueryOne(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) ([]byte, error)
- func (w *WacsiImpl) ExecuteUpdate(requestBody []byte, contractName string, method string, ...) error
- func (w *WacsiImpl) GetState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) ([]byte, error)
- func (w *WacsiImpl) KvIterator(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) error
- func (w *WacsiImpl) KvIteratorClose(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) error
- func (w *WacsiImpl) KvIteratorHasNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error
- func (*WacsiImpl) KvIteratorNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, ...) ([]byte, error)
- func (w *WacsiImpl) KvPreIterator(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, ...) error
- func (*WacsiImpl) PaillierOperation(requestBody []byte, memory []byte, data []byte, isLen bool) ([]byte, error)
- func (w *WacsiImpl) PutState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext) error
- func (w *WacsiImpl) RSClose(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error
- func (w *WacsiImpl) RSHasNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error
- func (w *WacsiImpl) RSNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, ...) ([]byte, error)
- func (w *WacsiImpl) SuccessResult(contractResult *common.ContractResult, data []byte) int32
- type WsetIterator
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorNotManageContract = fmt.Errorf("method is not init_contract or upgrade")
Functions ¶
func NewTxSimContext ¶
func NewVmManager ¶
func NewVmManager(instanceManagers map[commonPb.RuntimeType]protocol.VmInstancesManager, wxvmCodePathPrefix string, accessControl protocol.AccessControlProvider, chainNodesInfoProvider protocol.ChainNodesInfoProvider, chainConf protocol.ChainConf) protocol.VmManager
NewVmManager get vm runtime manager
func PrintTxReadSet ¶
func PrintTxReadSet(txSimContext protocol.TxSimContext)
func PrintTxWriteSet ¶
func PrintTxWriteSet(txSimContext protocol.TxSimContext)
Types ¶
type SimContextIterator ¶
type SimContextIterator struct {
// contains filtered or unexported fields
}
func NewSimContextIterator ¶
func NewSimContextIterator(simContext protocol.TxSimContext, wsetIter, dbIter protocol.StateIterator) *SimContextIterator
func (*SimContextIterator) Next ¶
func (sci *SimContextIterator) Next() bool
Next move the iter to next and return is there value in next iter
func (*SimContextIterator) Release ¶
func (sci *SimContextIterator) Release()
Release release the iterator
type SimContextKeyHistoryIterator ¶
type SimContextKeyHistoryIterator struct {
// contains filtered or unexported fields
}
func NewSimContextKeyHistoryIterator ¶
func NewSimContextKeyHistoryIterator(simContext protocol.TxSimContext, wSetIter, dbIter protocol.KeyHistoryIterator, key []byte) *SimContextKeyHistoryIterator
func (*SimContextKeyHistoryIterator) Next ¶
func (iter *SimContextKeyHistoryIterator) Next() bool
Next move the iter to next and return is there value in next iter
func (*SimContextKeyHistoryIterator) Release ¶
func (iter *SimContextKeyHistoryIterator) Release()
Release release the iterator
func (*SimContextKeyHistoryIterator) Value ¶
func (iter *SimContextKeyHistoryIterator) Value() (*store.KeyModification, error)
Value return the value of current iter
type VmManagerImpl ¶
type VmManagerImpl struct { InstanceManagers map[commonPb.RuntimeType]protocol.VmInstancesManager WxvmCodePath string SnapshotManager protocol.SnapshotManager AccessControl protocol.AccessControlProvider ChainNodesInfoProvider protocol.ChainNodesInfoProvider ChainId string Log *logger.CMLogger ChainConf protocol.ChainConf // chain config // contains filtered or unexported fields }
func (*VmManagerImpl) GetAccessControl ¶
func (m *VmManagerImpl) GetAccessControl() protocol.AccessControlProvider
func (*VmManagerImpl) GetChainNodesInfoProvider ¶
func (m *VmManagerImpl) GetChainNodesInfoProvider() protocol.ChainNodesInfoProvider
func (*VmManagerImpl) RunContract ¶
func (m *VmManagerImpl) RunContract(contract *commonPb.Contract, method string, byteCode []byte, parameters map[string][]byte, txContext protocol.TxSimContext, gasUsed uint64, refTxType commonPb.TxType) ( *commonPb.ContractResult, protocol.ExecOrderTxType, commonPb.TxStatusCode)
func (*VmManagerImpl) Start ¶
func (m *VmManagerImpl) Start() error
func (*VmManagerImpl) Stop ¶
func (m *VmManagerImpl) Stop() error
type WSetKeyHistoryIterator ¶
type WSetKeyHistoryIterator struct {
// contains filtered or unexported fields
}
func NewWSetKeyHistoryIterator ¶
func NewWSetKeyHistoryIterator(wSets map[string]interface{}) *WSetKeyHistoryIterator
func (*WSetKeyHistoryIterator) Next ¶
func (iter *WSetKeyHistoryIterator) Next() bool
func (*WSetKeyHistoryIterator) Release ¶
func (iter *WSetKeyHistoryIterator) Release()
func (*WSetKeyHistoryIterator) Value ¶
func (iter *WSetKeyHistoryIterator) Value() (*store.KeyModification, error)
type Wacsi ¶
type Wacsi interface { // state operation PutState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext) error GetState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte, data []byte, isLen bool) ([]byte, error) DeleteState(requestBody []byte, contractName string, txSimContext protocol.TxSimContext) error // call other contract CallContract(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, data []byte, gasUsed uint64, isLen bool) (*common.ContractResult, uint64, protocol.ExecOrderTxType, error) // result record SuccessResult(contractResult *common.ContractResult, data []byte) int32 ErrorResult(contractResult *common.ContractResult, data []byte) int32 // emit event EmitEvent(requestBody []byte, txSimContext protocol.TxSimContext, contractId *common.Contract, log protocol.Logger) (*common.ContractEvent, error) // paillier PaillierOperation(requestBody []byte, memory []byte, data []byte, isLen bool) ([]byte, error) // bulletproofs BulletProofsOperation(requestBody []byte, memory []byte, data []byte, isLen bool) ([]byte, error) // kv iterator KvIterator(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte) error KvPreIterator(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte) error KvIteratorHasNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error KvIteratorNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, data []byte, contractName string, isLen bool) ([]byte, error) KvIteratorClose(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte) error // sql operation ExecuteQuery(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte, chainId string) error ExecuteQueryOne(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte, data []byte, chainId string, isLen bool) ([]byte, error) ExecuteUpdate(requestBody []byte, contractName string, method string, txSimContext protocol.TxSimContext, memory []byte, chainId string) error ExecuteDDL(requestBody []byte, contractName string, txSimContext protocol.TxSimContext, memory []byte, method string) error RSHasNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error RSNext(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, data []byte, isLen bool) ([]byte, error) RSClose(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte) error }
Wacsi WebAssembly perseus system interface
type WacsiImpl ¶
type WacsiImpl struct {
// contains filtered or unexported fields
}
func (*WacsiImpl) BulletProofsOperation ¶
func (*WacsiImpl) CallContract ¶
func (w *WacsiImpl) CallContract(requestBody []byte, txSimContext protocol.TxSimContext, memory []byte, data []byte, gasUsed uint64, isLen bool) (*common.ContractResult, uint64, protocol.ExecOrderTxType, error)
CallContract implement syscall for call contract, it is for gasm and wasmer
func (*WacsiImpl) DeleteState ¶
func (*WacsiImpl) EmitEvent ¶
func (w *WacsiImpl) EmitEvent(requestBody []byte, txSimContext protocol.TxSimContext, contractId *common.Contract, log protocol.Logger) (*common.ContractEvent, error)
EmitEvent emit event to chain
func (*WacsiImpl) ErrorResult ¶
func (w *WacsiImpl) ErrorResult(contractResult *common.ContractResult, data []byte) int32
func (*WacsiImpl) ExecuteDDL ¶
func (*WacsiImpl) ExecuteQuery ¶
func (*WacsiImpl) ExecuteQueryOne ¶
func (*WacsiImpl) ExecuteUpdate ¶
func (*WacsiImpl) KvIterator ¶
func (*WacsiImpl) KvIteratorClose ¶
func (*WacsiImpl) KvIteratorHasNext ¶
func (*WacsiImpl) KvIteratorNext ¶
func (*WacsiImpl) KvPreIterator ¶
func (*WacsiImpl) PaillierOperation ¶
func (*WacsiImpl) SuccessResult ¶
func (w *WacsiImpl) SuccessResult(contractResult *common.ContractResult, data []byte) int32
type WsetIterator ¶
type WsetIterator struct {
// contains filtered or unexported fields
}
func NewWsetIterator ¶
func NewWsetIterator(wsets map[string]interface{}) *WsetIterator
func (*WsetIterator) Next ¶
func (wi *WsetIterator) Next() bool
func (*WsetIterator) Release ¶
func (wi *WsetIterator) Release()
Click to show internal directories.
Click to hide internal directories.