Documentation ¶
Index ¶
- Variables
- func ToCache(ctx *VMContext) map[string]interface{}
- func Trie(ctx *VMContext) *trie.Trie
- func TrieHash(ctx *VMContext) *types.Hash
- type ContractStore
- type VMCache
- func (cache *VMCache) AppendLog(log *types.VmLog)
- func (cache *VMCache) Clear()
- func (cache *VMCache) GetStorage(key []byte) (interface{}, bool)
- func (cache *VMCache) LogList() types.VmLogs
- func (cache *VMCache) SetStorage(key []byte, value interface{})
- func (cache *VMCache) Trie(fn func([]byte) []byte) *trie.Trie
- type VMContext
- func (v *VMContext) CalculateAmount(block *types.StateBlock) (types.Balance, error)
- func (v *VMContext) EventBus() event.EventBus
- func (v *VMContext) GetAccountMeta(address types.Address) (*types.AccountMeta, error)
- func (v *VMContext) GetAccountMetaByPovHeight(address types.Address) (*types.AccountMeta, error)
- func (v *VMContext) GetBlockChild(hash types.Hash) (types.Hash, error)
- func (v *VMContext) GetLatestPovBlock() (*types.PovBlock, error)
- func (v *VMContext) GetLatestPovHeader() (*types.PovHeader, error)
- func (v *VMContext) GetPovMinerStat(dayIndex uint32) (*types.PovMinerDayStat, error)
- func (v *VMContext) GetRelation(dest interface{}, query string) error
- func (v *VMContext) GetStateBlock(hash types.Hash) (*types.StateBlock, error)
- func (v *VMContext) GetStateBlockConfirmed(hash types.Hash) (*types.StateBlock, error)
- func (v *VMContext) GetStorage(prefix, key []byte) ([]byte, error)
- func (v *VMContext) GetStorageByRaw(i []byte) ([]byte, error)
- func (v *VMContext) GetTokenById(tokenId types.Hash) (*types.TokenInfo, error)
- func (v *VMContext) GetTokenByName(tokenName string) (*types.TokenInfo, error)
- func (v *VMContext) GetTokenMeta(address types.Address, tokenType types.Hash) (*types.TokenMeta, error)
- func (v *VMContext) GetTokenMetaByBlockHash(hash types.Hash) (*types.TokenMeta, error)
- func (v *VMContext) GetTokenMetaByPovHeight(address types.Address, token types.Hash) (*types.TokenMeta, error)
- func (v *VMContext) HasAccountMetaConfirmed(address types.Address) (bool, error)
- func (v *VMContext) HasStateBlockConfirmed(hash types.Hash) (bool, error)
- func (v *VMContext) IsUserAccount(address types.Address) (bool, error)
- func (v *VMContext) Iterator(prefix []byte, fn func(key []byte, value []byte) error) error
- func (v *VMContext) ListTokens() ([]*types.TokenInfo, error)
- func (v *VMContext) PoVContractState() (*statedb.PovContractStateDB, error)
- func (v *VMContext) PoVContractStateByHeight(h uint64) (*statedb.PovContractStateDB, error)
- func (v *VMContext) PovGlobalState() *statedb.PovGlobalStateDB
- func (v *VMContext) PovGlobalStateByHeight(h uint64) *statedb.PovGlobalStateDB
- func (v *VMContext) SelectRelation(dest interface{}, query string) error
- func (v *VMContext) SetObjectStorage(prefix, key []byte, value interface{}) error
- func (v *VMContext) SetStorage(prefix, key []byte, value []byte) error
- func (v *VMContext) WithCache(c storage.Cache) *VMContext
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //ErrStorageExists = errors.New("storage already exists") ErrStorageNotFound = errors.New("storage not found") )
Functions ¶
Types ¶
type ContractStore ¶
type ContractStore interface { GetStorage(prefix, key []byte) ([]byte, error) SetStorage(prefix, key []byte, value []byte) error SetObjectStorage(prefix, key []byte, value interface{}) error GetStorageByRaw([]byte) ([]byte, error) Iterator(prefix []byte, fn func(key []byte, value []byte) error) error PovGlobalState() *statedb.PovGlobalStateDB PoVContractState() (*statedb.PovContractStateDB, error) PovGlobalStateByHeight(h uint64) *statedb.PovGlobalStateDB PoVContractStateByHeight(h uint64) (*statedb.PovContractStateDB, error) GetLatestPovBlock() (*types.PovBlock, error) GetLatestPovHeader() (*types.PovHeader, error) GetPovMinerStat(dayIndex uint32) (*types.PovMinerDayStat, error) ListTokens() ([]*types.TokenInfo, error) GetTokenById(tokenId types.Hash) (*types.TokenInfo, error) GetTokenByName(tokenName string) (*types.TokenInfo, error) EventBus() event.EventBus GetBlockChild(hash types.Hash) (types.Hash, error) GetStateBlock(hash types.Hash) (*types.StateBlock, error) GetStateBlockConfirmed(hash types.Hash) (*types.StateBlock, error) HasStateBlockConfirmed(hash types.Hash) (bool, error) GetAccountMeta(address types.Address) (*types.AccountMeta, error) GetTokenMeta(address types.Address, tokenType types.Hash) (*types.TokenMeta, error) HasAccountMetaConfirmed(address types.Address) (bool, error) GetAccountMetaByPovHeight(address types.Address) (*types.AccountMeta, error) GetTokenMetaByPovHeight(address types.Address, token types.Hash) (*types.TokenMeta, error) GetTokenMetaByBlockHash(hash types.Hash) (*types.TokenMeta, error) IsUserAccount(address types.Address) (bool, error) CalculateAmount(block *types.StateBlock) (types.Balance, error) GetRelation(dest interface{}, query string) error SelectRelation(dest interface{}, query string) error }
type VMCache ¶
type VMCache struct {
// contains filtered or unexported fields
}
func NewVMCache ¶
func NewVMCache() *VMCache
func (*VMCache) GetStorage ¶
func (*VMCache) SetStorage ¶
type VMContext ¶
type VMContext struct {
// contains filtered or unexported fields
}
func NewVMContextWithBlock ¶ added in v1.4.0
func NewVMContextWithBlock(l ledger.Store, block *types.StateBlock) *VMContext
WithBlock Load storage trie from the specified user address and block hash
func (*VMContext) CalculateAmount ¶
func (*VMContext) GetAccountMeta ¶
func (*VMContext) GetAccountMetaByPovHeight ¶ added in v1.4.0
func (*VMContext) GetBlockChild ¶ added in v1.4.0
func (*VMContext) GetLatestPovBlock ¶ added in v1.2.3
func (*VMContext) GetLatestPovHeader ¶ added in v1.4.0
func (*VMContext) GetPovMinerStat ¶ added in v1.2.3
func (v *VMContext) GetPovMinerStat(dayIndex uint32) (*types.PovMinerDayStat, error)
FIXME: pov height
func (*VMContext) GetRelation ¶ added in v1.4.0
func (*VMContext) GetStateBlock ¶ added in v1.2.3
func (*VMContext) GetStateBlockConfirmed ¶ added in v1.4.0
func (*VMContext) GetStorageByRaw ¶ added in v1.4.0
func (*VMContext) GetTokenById ¶ added in v1.4.0
func (*VMContext) GetTokenByName ¶ added in v1.4.0
func (*VMContext) GetTokenMeta ¶ added in v1.2.0
func (*VMContext) GetTokenMetaByBlockHash ¶ added in v1.4.0
func (*VMContext) GetTokenMetaByPovHeight ¶ added in v1.4.0
func (*VMContext) HasAccountMetaConfirmed ¶ added in v1.4.0
func (*VMContext) HasStateBlockConfirmed ¶ added in v1.4.0
func (*VMContext) IsUserAccount ¶
func (*VMContext) ListTokens ¶ added in v1.4.0
func (*VMContext) PoVContractState ¶ added in v1.4.0
func (v *VMContext) PoVContractState() (*statedb.PovContractStateDB, error)
func (*VMContext) PoVContractStateByHeight ¶ added in v1.4.0
func (v *VMContext) PoVContractStateByHeight(h uint64) (*statedb.PovContractStateDB, error)
func (*VMContext) PovGlobalState ¶ added in v1.4.0
func (v *VMContext) PovGlobalState() *statedb.PovGlobalStateDB
func (*VMContext) PovGlobalStateByHeight ¶ added in v1.4.0
func (v *VMContext) PovGlobalStateByHeight(h uint64) *statedb.PovGlobalStateDB
func (*VMContext) SelectRelation ¶ added in v1.4.0
func (*VMContext) SetObjectStorage ¶ added in v1.4.0
func (*VMContext) SetStorage ¶
Click to show internal directories.
Click to hide internal directories.