internal

package
v0.0.0-...-c1c5777 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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