Documentation ¶
Overview ¶
Package common privides functions for http handler call
- Copyright (C) 2018 The ZeepinChain Authors
- This file is part of The ZeepinChain library. *
- The ZeepinChain is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version. *
- The ZeepinChain is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU Lesser General Public License for more details. *
- You should have received a copy of the GNU Lesser General Public License
- along with The ZeepinChain. If not, see <http://www.gnu.org/licenses/>.
Index ¶
- Constants
- func BuildEmbeddedInvokeCode(smartContractAddress common.Address, params []interface{}) ([]byte, error)
- func BuildEmbeddedParam(builder *simulator.ParamsBuilder, smartContractParams []interface{}) error
- func BuildNativeInvokeCode(contractAddress common.Address, version byte, method string, ...) ([]byte, error)
- func BuildWasmVMInvokeCode(smartcodeAddress common.Address, methodName string, paramType wasmvm.ParamType, ...) ([]byte, error)
- func GetAllowance(asset string, from, to common.Address) (string, error)
- func GetBlockTransactions(block *types.Block) interface{}
- func GetContractAllowance(cVersion byte, contractAddr, fromAddr, toAddr common.Address) (uint64, error)
- func GetContractBalance(cVersion byte, contractAddr, accAddr common.Address) (uint64, error)
- func GetGasPrice() (map[string]interface{}, error)
- func NewEmbeddedInvokeTransaction(gasPrice, gasLimit uint64, contractAddress common.Address, ...) (*types.MutableTransaction, error)
- func NewNativeInvokeTransaction(gasPirce, gasLimit uint64, contractAddress common.Address, version byte, ...) (*types.MutableTransaction, error)
- func NewSmartContractTransaction(gasPrice, gasLimit uint64, invokeCode []byte, attr byte) (*types.MutableTransaction, error)
- func NewWASMVMInvokeTransaction(gasPrice, gasLimit uint64, contractAddress common.Address, methodName string, ...) (*types.MutableTransaction, error)
- func SendTxToPool(txn *types.Transaction) (ontErrors.ErrCode, string)
- type AmountMap
- type BalanceOfRsp
- type BlockHead
- type BlockInfo
- type BookKeepingInfo
- type BookkeeperInfo
- type ConsensusInfo
- type DataFileInfo
- type DeployCodeInfo
- type ExecuteNotify
- type Fee
- type InvokeCodeInfo
- type LogEventArgs
- type MerkleProof
- type NodeInfo
- type NotifyEventInfo
- type PayloadInfo
- type PrivacyPayloadInfo
- type RecordInfo
- type Sig
- type TXNAttrInfo
- type TXNEntryInfo
- type Transactions
- type TxAttributeInfo
- type VoteInfo
Constants ¶
View Source
const MAX_SEARCH_HEIGHT uint32 = 100
Variables ¶
This section is empty.
Functions ¶
func BuildEmbeddedInvokeCode ¶
func BuildEmbeddedInvokeCode(smartContractAddress common.Address, params []interface{}) ([]byte, error)
BuildEmbeddedInvokeCode build Embed Invoke code for params
func BuildEmbeddedParam ¶
func BuildEmbeddedParam(builder *simulator.ParamsBuilder, smartContractParams []interface{}) error
buildEmbeddedParamInter build embed invoke param code
func BuildNativeInvokeCode ¶
func BuildWasmVMInvokeCode ¶
func BuildWasmVMInvokeCode(smartcodeAddress common.Address, methodName string, paramType wasmvm.ParamType, version byte, params []interface{}) ([]byte, error)
BuildWasmVMInvokeCode return wasn vm invoke code
func GetBlockTransactions ¶
func GetContractAllowance ¶
func GetContractBalance ¶
func GetGasPrice ¶
func NewNativeInvokeTransaction ¶
func NewNativeInvokeTransaction(gasPirce, gasLimit uint64, contractAddress common.Address, version byte, method string, params []interface{}) (*types.MutableTransaction, error)
NewNativeInvokeTransaction return native contract invoke transaction
func SendTxToPool ¶
func SendTxToPool(txn *types.Transaction) (ontErrors.ErrCode, string)
Types ¶
type BalanceOfRsp ¶
func GetBalance ¶
func GetBalance(address common.Address) (*BalanceOfRsp, error)
type BlockInfo ¶
type BlockInfo struct { Hash string Size int Header *BlockHead Transactions []*Transactions }
func GetBlockInfo ¶
type BookKeepingInfo ¶
type BookKeepingInfo struct {
Nonce uint64
}
implement PayloadInfo define BookKeepingInfo
type BookkeeperInfo ¶
type ConsensusInfo ¶
type ConsensusInfo struct { }
type DataFileInfo ¶
type DeployCodeInfo ¶
type ExecuteNotify ¶
type ExecuteNotify struct { TxHash string State byte GasConsumed uint64 Notify []NotifyEventInfo }
func GetExecuteNotify ¶
func GetExecuteNotify(obj *event.ExecuteNotify) (map[string]bool, ExecuteNotify)
type InvokeCodeInfo ¶
type LogEventArgs ¶
func GetLogEvent ¶
func GetLogEvent(obj *event.LogEventArgs) (map[string]bool, LogEventArgs)
type MerkleProof ¶
type NodeInfo ¶
type NodeInfo struct { NodeState uint // node status NodePort uint16 // The nodes's port ID uint64 // The nodes's id NodeTime int64 NodeVersion uint32 // The network protocol the node used NodeType uint64 // The services the node supplied Relay bool // The relay capability of the node (merge into capbility flag) Height uint32 // The node latest block height TxnCnt []uint32 // The transactions in pool }
type NotifyEventInfo ¶
type NotifyEventInfo struct { ContractAddress string States interface{} }
type PayloadInfo ¶
type PayloadInfo interface{}
func TransPayloadToHex ¶
func TransPayloadToHex(p types.Payload) PayloadInfo
get tranasction payload data
type PrivacyPayloadInfo ¶
type RecordInfo ¶
type TXNAttrInfo ¶
type TXNEntryInfo ¶
type TXNEntryInfo struct {
State []TXNAttrInfo // the result from each validator
}
type Transactions ¶
type Transactions struct { Version byte Nonce uint32 GasPrice uint64 GasLimit uint64 Payer string TxType types.TransactionType Payload PayloadInfo Attributes []TxAttributeInfo Sigs []Sig Hash string Height uint32 }
func TransArryByteToHexString ¶
func TransArryByteToHexString(ptx *types.Transaction) *Transactions
type TxAttributeInfo ¶
type TxAttributeInfo struct { Usage types.TransactionAttributeUsage Data string }
Click to show internal directories.
Click to hide internal directories.