Documentation ¶
Index ¶
- Constants
- func CreateNativeContractAccount(roleIntf role.RoleInterface) error
- func NativeContractInitChain(ldb *db.DBService, roleIntf role.RoleInterface, ncIntf NativeContractInterface) error
- type Context
- type NativeContract
- type NativeContractInterface
- type NativeContractMethod
- type NativeContractMethodConfig
Constants ¶
View Source
const MaxDelegateDescriptionLen int = 128
View Source
const MaxDelegateLocationLen int = 32
View Source
const NativeContractExecTime uint64 = 100
Variables ¶
This section is empty.
Functions ¶
func CreateNativeContractAccount ¶
func CreateNativeContractAccount(roleIntf role.RoleInterface) error
CreateNativeContractAccount is to create native contract account
func NativeContractInitChain ¶
func NativeContractInitChain(ldb *db.DBService, roleIntf role.RoleInterface, ncIntf NativeContractInterface) error
NativeContractInitChain is to init
Types ¶
type Context ¶
type Context struct { // input params: RoleIntf role.RoleInterface Trx *types.Transaction CallContract string CallMethod string //NoticeContract string DeepLimit uint32 MaxExecTime uint64 //output prams: NoticeContractList []string }
Context for contracts
func (*Context) GetTrxParamSize ¶
GetTrxParamSize for contracts
type NativeContract ¶
type NativeContract struct { //Config map[string]NativeContractMethod Config map[string]NativeContractMethodConfig }
NativeContract is native contract handler
func (*NativeContract) ExecuteNativeContract ¶
ExecuteNativeContract is to call native contract
func (*NativeContract) IsNativeContractMethod ¶
func (nc *NativeContract) IsNativeContractMethod(contract string, method string) bool
IsNativeContractMethod is to check if the contract is native
type NativeContractInterface ¶
type NativeContractInterface interface { IsNativeContractMethod(contract string, method string) bool ExecuteNativeContract(*Context) (berr.ErrCode, uint64, uint64) }
NativeContractInterface is native contract interface
func NewNativeContract ¶
func NewNativeContract(roleIntf role.RoleInterface) (NativeContractInterface, error)
NewNativeContract is to create a new native contract
func NewNativeContractHandler ¶
func NewNativeContractHandler() (NativeContractInterface, error)
NewNativeContractHandler is native contract handler to handle different contracts
type NativeContractMethod ¶
NativeContractMethod is native contract method
type NativeContractMethodConfig ¶
type NativeContractMethodConfig struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.