Documentation ¶
Index ¶
- Variables
- type ContractStore
- type VMCache
- type VMContext
- func (v *VMContext) CalculateAmount(block *types.StateBlock) (types.Balance, error)
- func (v *VMContext) GetAccountMeta(address types.Address) (*types.AccountMeta, error)
- func (v *VMContext) GetLatestPovBlock() (*types.PovBlock, error)
- func (v *VMContext) GetLogger() *zap.SugaredLogger
- func (v *VMContext) GetPovBlockByHeight(height uint64) (*types.PovBlock, error)
- func (v *VMContext) GetPovHeaderByHeight(height uint64) (*types.PovHeader, error)
- func (v *VMContext) GetPovMinerStat(dayIndex uint32) (*types.PovMinerDayStat, error)
- func (v *VMContext) GetRepresentation(address types.Address) (*types.Benefit, error)
- func (v *VMContext) GetStateBlock(hash types.Hash) (*types.StateBlock, error)
- func (v *VMContext) GetStorage(prefix, key []byte) ([]byte, error)
- func (v *VMContext) GetTokenMeta(address types.Address, token types.Hash) (*types.TokenMeta, error)
- func (v *VMContext) HasTokenMeta(address types.Address, token 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) SaveStorage(txns ...db.StoreTxn) error
- func (v *VMContext) SaveTrie(txns ...db.StoreTxn) error
- func (v *VMContext) SetStorage(prefix, key []byte, value []byte) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrStorageExists = errors.New("storage already exists") ErrStorageNotFound = errors.New("storage not found") )
Functions ¶
This section is empty.
Types ¶
type ContractStore ¶
type ContractStore interface { GetStorage(prefix, key []byte) ([]byte, error) SetStorage(prefix, key []byte, value []byte) error Iterator(prefix []byte, fn func(key []byte, value []byte) error) error CalculateAmount(block *types.StateBlock) (types.Balance, error) IsUserAccount(address types.Address) (bool, error) GetAccountMeta(address types.Address) (*types.AccountMeta, error) GetTokenMeta(address types.Address, tokenType types.Hash) (*types.TokenMeta, error) GetStateBlock(hash types.Hash) (*types.StateBlock, error) HasTokenMeta(address types.Address, token types.Hash) (bool, error) SaveStorage(txns ...db.StoreTxn) error }
type VMCache ¶
type VMCache struct {
// contains filtered or unexported fields
}
func NewVMCache ¶
func (*VMCache) GetStorage ¶
func (*VMCache) SetStorage ¶
type VMContext ¶
type VMContext struct { Cache *VMCache // contains filtered or unexported fields }
func NewVMContext ¶
func (*VMContext) CalculateAmount ¶
func (*VMContext) GetAccountMeta ¶
func (*VMContext) GetLatestPovBlock ¶ added in v1.2.3
func (*VMContext) GetLogger ¶ added in v1.2.3
func (v *VMContext) GetLogger() *zap.SugaredLogger
func (*VMContext) GetPovBlockByHeight ¶ added in v1.2.3
func (*VMContext) GetPovHeaderByHeight ¶ added in v1.2.3
func (*VMContext) GetPovMinerStat ¶ added in v1.2.3
func (v *VMContext) GetPovMinerStat(dayIndex uint32) (*types.PovMinerDayStat, error)
func (*VMContext) GetRepresentation ¶ added in v1.2.3
func (*VMContext) GetStateBlock ¶ added in v1.2.3
func (*VMContext) GetTokenMeta ¶ added in v1.2.0
func (*VMContext) HasTokenMeta ¶ added in v1.2.0
func (*VMContext) IsUserAccount ¶
Click to show internal directories.
Click to hide internal directories.