Documentation
¶
Index ¶
Constants ¶
View Source
const ( // CallTypeNA contract function isn't callable by invoke/query CallTypeNA = iota // CallTypeSubmit contract function should be called by invoke CallTypeSubmit // CallTypeEvaluate contract function should be called by query CallTypeEvaluate )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CallType ¶
type CallType int
CallType enum for type of call that should be used for method submit vs evaluate
type ContractFunction ¶
type ContractFunction struct {
// contains filtered or unexported fields
}
ContractFunction contains a description of a function so that it can be called by a contract
func NewContractFunctionFromFunc ¶
func NewContractFunctionFromFunc(fn interface{}, callType CallType, contextHandlerType reflect.Type) (*ContractFunction, error)
NewContractFunctionFromFunc creates a new contract function from a given function
func NewContractFunctionFromReflect ¶
func NewContractFunctionFromReflect(typeMethod reflect.Method, valueMethod reflect.Value, callType CallType, contextHandlerType reflect.Type) (*ContractFunction, error)
NewContractFunctionFromReflect creates a new contract function from a reflected method
func (ContractFunction) Call ¶
func (cf ContractFunction) Call(ctx reflect.Value, supplementaryMetadata *metadata.TransactionMetadata, components *metadata.ComponentMetadata, serializer serializer.TransactionSerializer, params ...string) (string, interface{}, error)
Call calls function in a contract using string args and handles formatting the response into useful types
func (ContractFunction) ReflectMetadata ¶
func (cf ContractFunction) ReflectMetadata(name string, existingComponents *metadata.ComponentMetadata) metadata.TransactionMetadata
ReflectMetadata returns the metadata for contract function
Click to show internal directories.
Click to hide internal directories.