Documentation ¶
Index ¶
- Constants
- type Config
- type SmartContract
- func (this *SmartContract) CallingContext() *context.Context
- func (this *SmartContract) CheckExecStep() bool
- func (this *SmartContract) CheckUseGas(gas uint64) bool
- func (this *SmartContract) CheckWitness(address common.Address) bool
- func (this *SmartContract) CurrentContext() *context.Context
- func (this *SmartContract) EntryContext() *context.Context
- func (this *SmartContract) NewExecuteEngine(code []byte) (context.Engine, error)
- func (this *SmartContract) NewNativeService() (*native.NativeService, error)
- func (this *SmartContract) PopContext()
- func (this *SmartContract) PushContext(context *context.Context)
- func (this *SmartContract) PushNotifications(notifications []*event.NotifyEventInfo)
Constants ¶
const (
MAX_EXECUTE_ENGINE = 1024
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Time uint32 // current block timestamp Height uint32 // current block height Tx *ctypes.Transaction // current transaction }
Config describe smart contract need parameters configuration
type SmartContract ¶
type SmartContract struct { Contexts []*context.Context // all execute smart contract context CloneCache *storage.CloneCache // state cache Store store.LedgerStore // ledger store Config *Config Notifications []*event.NotifyEventInfo // all execute smart contract event notify info Gas uint64 ExecStep int }
SmartContract describe smart contract execute engine
func (*SmartContract) CallingContext ¶
func (this *SmartContract) CallingContext() *context.Context
CallingContext return smart contract caller context
func (*SmartContract) CheckExecStep ¶
func (this *SmartContract) CheckExecStep() bool
func (*SmartContract) CheckUseGas ¶
func (this *SmartContract) CheckUseGas(gas uint64) bool
func (*SmartContract) CheckWitness ¶
func (this *SmartContract) CheckWitness(address common.Address) bool
CheckWitness check whether authorization correct If address is wallet address, check whether in the signature addressed list Else check whether address is calling contract address Param address: wallet address or contract address
func (*SmartContract) CurrentContext ¶
func (this *SmartContract) CurrentContext() *context.Context
CurrentContext return smart contract current context
func (*SmartContract) EntryContext ¶
func (this *SmartContract) EntryContext() *context.Context
EntryContext return smart contract entry entrance context
func (*SmartContract) NewExecuteEngine ¶
func (this *SmartContract) NewExecuteEngine(code []byte) (context.Engine, error)
Execute is smart contract execute manager According different vm type to launch different service
func (*SmartContract) NewNativeService ¶
func (this *SmartContract) NewNativeService() (*native.NativeService, error)
func (*SmartContract) PopContext ¶
func (this *SmartContract) PopContext()
PopContext pop smart contract current context
func (*SmartContract) PushContext ¶
func (this *SmartContract) PushContext(context *context.Context)
PushContext push current context to smart contract
func (*SmartContract) PushNotifications ¶
func (this *SmartContract) PushNotifications(notifications []*event.NotifyEventInfo)
PushNotifications push smart contract event info