Documentation
¶
Index ¶
- type ContractContext
- type IPluginContract
- type PluginContract
- func (cont *PluginContract) Address() common.Address
- func (cont *PluginContract) ContractInvoke(cc *types.ContractContext, method string, params []interface{}) ([]interface{}, error)
- func (cont *PluginContract) Front() interface{}
- func (cont *PluginContract) Init(addr common.Address, master common.Address)
- func (cont *PluginContract) Master() common.Address
- func (cont *PluginContract) Name() string
- func (cont *PluginContract) OnCreate(cc *types.ContractContext, Args []byte) error
- func (cont *PluginContract) OnReward(cc *types.ContractContext, b *types.Block, CountMap map[common.Address]uint32) (map[common.Address]*amount.Amount, error)
- type PluginContractConstruction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContractContext ¶
type ContractContext interface {
// ChainID returns the id of the chain
ContractAddress() string
// ChainID returns the id of the chain
Master() string
// ChainID returns the id of the chain
ChainID() *big.Int
// Version returns the version of the chain
Version() uint16
// Hash returns the hash value of it
Hash() string
// TargetHeight returns the recorded target height when ContractContext generation
TargetHeight() uint32
// PrevHash returns the recorded prev hash when ContractContext generation
PrevHash() string
// LastTimestamp returns the recorded prev timestamp when ContractContext generation
LastTimestamp() uint64
// From returns current signer address
From() string
// IsGenerator returns the account is generator or not
IsGenerator(addr string) bool
// MainToken returns the MainToken
MainToken() string
// ContractData returns the contract data from the top snapshot
ContractData(name []byte) []byte
// SetContractData inserts the contract data to the top snapshot
SetContractData(name []byte, value []byte)
// AccountData returns the account data from the top snapshot
AccountData(addr string, name []byte) []byte
// SetAccountData inserts the account data to the top snapshot
SetAccountData(addr string, name []byte, value []byte)
// Seq returns the sequence of the target account
AddrSeq(addr string) uint64
// NextSeq returns the next squence number
NextSeq() uint32
// IsContract returns is the contract
IsContract(addr string) bool
Exec(Addr string, MethodName string, Args []interface{}) ([]interface{}, error)
}
type IPluginContract ¶
type PluginContract ¶
type PluginContract struct {
// contains filtered or unexported fields
}
func (*PluginContract) Address ¶
func (cont *PluginContract) Address() common.Address
func (*PluginContract) ContractInvoke ¶
func (cont *PluginContract) ContractInvoke(cc *types.ContractContext, method string, params []interface{}) ([]interface{}, error)
func (*PluginContract) Front ¶
func (cont *PluginContract) Front() interface{}
func (*PluginContract) Init ¶
func (cont *PluginContract) Init(addr common.Address, master common.Address)
func (*PluginContract) Master ¶
func (cont *PluginContract) Master() common.Address
func (*PluginContract) Name ¶
func (cont *PluginContract) Name() string
func (*PluginContract) OnCreate ¶
func (cont *PluginContract) OnCreate(cc *types.ContractContext, Args []byte) error
type PluginContractConstruction ¶
type PluginContractConstruction struct {
Bin []byte
}
Click to show internal directories.
Click to hide internal directories.