Documentation
¶
Index ¶
- Variables
- func BalanceKey(tokenTypeId *types.TokenTypeId) []byte
- func NewEmptyVmContextByTrie(t *trie.Trie) vmctxt_interface.VmDatabase
- func NewVmContext(chain Chain, snapshotBlockHash *types.Hash, prevAccountBlockHash *types.Hash, ...) (vmctxt_interface.VmDatabase, error)
- type Chain
- type ContractGid
- type StorageIterator
- type UnsavedCache
- func (cache *UnsavedCache) ContractGidList() []vmctxt_interface.ContractGid
- func (cache *UnsavedCache) GetStorage(key []byte) []byte
- func (cache *UnsavedCache) LogList() ledger.VmLogList
- func (cache *UnsavedCache) SetStorage(key []byte, value []byte)
- func (cache *UnsavedCache) Storage() map[string][]byte
- func (cache *UnsavedCache) Trie() *trie.Trie
- type VmAccountBlock
- type VmContext
- func (context *VmContext) AddBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
- func (context *VmContext) AddLog(log *ledger.VmLog)
- func (context *VmContext) Address() *types.Address
- func (context *VmContext) CopyAndFreeze() vmctxt_interface.VmDatabase
- func (context *VmContext) CurrentSnapshotBlock() *ledger.SnapshotBlock
- func (context *VmContext) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
- func (context *VmContext) GetBalance(addr *types.Address, tokenTypeId *types.TokenTypeId) *big.Int
- func (context *VmContext) GetContractCode(addr *types.Address) []byte
- func (context *VmContext) GetGid() *types.Gid
- func (context *VmContext) GetLogListHash() *types.Hash
- func (context *VmContext) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
- func (context *VmContext) GetSnapshotBlockByHeight(height uint64) *ledger.SnapshotBlock
- func (context *VmContext) GetSnapshotBlocks(startHeight, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock
- func (context *VmContext) GetStorage(addr *types.Address, key []byte) []byte
- func (context *VmContext) GetStorageHash() *types.Hash
- func (context *VmContext) IsAddressExisted(addr *types.Address) bool
- func (context *VmContext) NewStorageIterator(prefix []byte) vmctxt_interface.StorageIterator
- func (context *VmContext) PrevAccountBlock() *ledger.AccountBlock
- func (context *VmContext) Reset()
- func (context *VmContext) SetContractCode(code []byte)
- func (context *VmContext) SetContractGid(gid *types.Gid, addr *types.Address)
- func (context *VmContext) SetStorage(key []byte, value []byte)
- func (context *VmContext) SubBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
- func (context *VmContext) UnsavedCache() vmctxt_interface.UnsavedCache
Constants ¶
This section is empty.
Variables ¶
View Source
var ( STORAGE_KEY_BALANCE = []byte("$balance") STORAGE_KEY_CODE = []byte("$code") )
Functions ¶
func BalanceKey ¶
func BalanceKey(tokenTypeId *types.TokenTypeId) []byte
func NewEmptyVmContextByTrie ¶
func NewEmptyVmContextByTrie(t *trie.Trie) vmctxt_interface.VmDatabase
func NewVmContext ¶
func NewVmContext(chain Chain, snapshotBlockHash *types.Hash, prevAccountBlockHash *types.Hash, addr *types.Address) (vmctxt_interface.VmDatabase, error)
Types ¶
type Chain ¶
type Chain interface { GetAccount(address *types.Address) (*ledger.Account, error) GetLatestSnapshotBlock() *ledger.SnapshotBlock GetLatestAccountBlock(addr *types.Address) (*ledger.AccountBlock, error) GetSnapshotBlockByHash(hash *types.Hash) (*ledger.SnapshotBlock, error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetSnapshotBlocksByHeight(height uint64, count uint64, forward, containSnapshotContent bool) ([]*ledger.SnapshotBlock, error) GetAccountBlockByHash(blockHash *types.Hash) (*ledger.AccountBlock, error) GetStateTrie(hash *types.Hash) *trie.Trie NewStateTrie() *trie.Trie GetConfirmAccountBlock(snapshotHeight uint64, address *types.Address) (*ledger.AccountBlock, error) GetContractGid(addr *types.Address) (*types.Gid, error) }
type ContractGid ¶
type ContractGid struct {
// contains filtered or unexported fields
}
func (*ContractGid) Addr ¶
func (contractGid *ContractGid) Addr() *types.Address
func (*ContractGid) Gid ¶
func (contractGid *ContractGid) Gid() *types.Gid
type StorageIterator ¶
type StorageIterator struct {
// contains filtered or unexported fields
}
func NewStorageIterator ¶
func NewStorageIterator(trie *trie.Trie, prefix []byte) *StorageIterator
func (*StorageIterator) Next ¶
func (si *StorageIterator) Next() (key, value []byte, ok bool)
type UnsavedCache ¶
type UnsavedCache struct {
// contains filtered or unexported fields
}
func NewUnsavedCache ¶
func NewUnsavedCache(trie *trie.Trie) *UnsavedCache
func (*UnsavedCache) ContractGidList ¶
func (cache *UnsavedCache) ContractGidList() []vmctxt_interface.ContractGid
func (*UnsavedCache) GetStorage ¶
func (cache *UnsavedCache) GetStorage(key []byte) []byte
func (*UnsavedCache) LogList ¶
func (cache *UnsavedCache) LogList() ledger.VmLogList
func (*UnsavedCache) SetStorage ¶
func (cache *UnsavedCache) SetStorage(key []byte, value []byte)
func (*UnsavedCache) Storage ¶
func (cache *UnsavedCache) Storage() map[string][]byte
func (*UnsavedCache) Trie ¶
func (cache *UnsavedCache) Trie() *trie.Trie
type VmAccountBlock ¶
type VmAccountBlock struct { AccountBlock *ledger.AccountBlock VmContext vmctxt_interface.VmDatabase }
type VmContext ¶
type VmContext struct {
// contains filtered or unexported fields
}
func (*VmContext) AddBalance ¶
func (context *VmContext) AddBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
func (*VmContext) CopyAndFreeze ¶
func (context *VmContext) CopyAndFreeze() vmctxt_interface.VmDatabase
func (*VmContext) CurrentSnapshotBlock ¶
func (context *VmContext) CurrentSnapshotBlock() *ledger.SnapshotBlock
func (*VmContext) GetAccountBlockByHash ¶
func (context *VmContext) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
func (*VmContext) GetBalance ¶
func (*VmContext) GetContractCode ¶
func (*VmContext) GetLogListHash ¶
func (*VmContext) GetSnapshotBlockByHash ¶
func (context *VmContext) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
func (*VmContext) GetSnapshotBlockByHeight ¶
func (context *VmContext) GetSnapshotBlockByHeight(height uint64) *ledger.SnapshotBlock
func (*VmContext) GetSnapshotBlocks ¶
func (context *VmContext) GetSnapshotBlocks(startHeight, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock
func (*VmContext) GetStorage ¶
func (*VmContext) GetStorageHash ¶
func (*VmContext) IsAddressExisted ¶
func (*VmContext) NewStorageIterator ¶
func (context *VmContext) NewStorageIterator(prefix []byte) vmctxt_interface.StorageIterator
func (*VmContext) PrevAccountBlock ¶
func (context *VmContext) PrevAccountBlock() *ledger.AccountBlock
func (*VmContext) SetContractCode ¶
func (*VmContext) SetContractGid ¶
func (*VmContext) SetStorage ¶
func (*VmContext) SubBalance ¶
func (context *VmContext) SubBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
func (*VmContext) UnsavedCache ¶
func (context *VmContext) UnsavedCache() vmctxt_interface.UnsavedCache
Source Files
¶
Click to show internal directories.
Click to hide internal directories.