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) DebugGetStorage() map[string][]byte
- func (context *VmContext) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
- func (context *VmContext) GetBalance(addr *types.Address, tokenTypeId *types.TokenTypeId) *big.Int
- func (context *VmContext) GetBalanceList(snapshotHash types.Hash, tokenTypeId types.TokenTypeId, ...) (map[types.Address]*big.Int, error)
- func (context *VmContext) GetConsensusGroupList(snapshotHash types.Hash) ([]*types.ConsensusGroupInfo, error)
- func (context *VmContext) GetContractCode(addr *types.Address) []byte
- func (context *VmContext) GetGenesisSnapshotBlock() *ledger.SnapshotBlock
- func (context *VmContext) GetGid() *types.Gid
- func (context *VmContext) GetLogListHash() *types.Hash
- func (context *VmContext) GetOneHourQuota() (uint64, error)
- func (context *VmContext) GetReceiveBlockHeights(hash *types.Hash) ([]uint64, error)
- func (context *VmContext) GetRegisterList(snapshotHash types.Hash, gid types.Gid) ([]*types.Registration, error)
- func (context *VmContext) GetSnapshotBlockBeforeTime(timestamp *time.Time) (*ledger.SnapshotBlock, error)
- func (context *VmContext) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
- func (context *VmContext) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
- 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) GetStorageBySnapshotHash(addr *types.Address, key []byte, snapshotHash *types.Hash) []byte
- func (context *VmContext) GetStorageHash() *types.Hash
- func (context *VmContext) GetVoteMap(snapshotHash types.Hash, gid types.Gid) ([]*types.VoteInfo, error)
- func (context *VmContext) IsAddressExisted(addr *types.Address) bool
- func (context *VmContext) NewStorageIterator(addr *types.Address, prefix []byte) vmctxt_interface.StorageIterator
- func (context *VmContext) NewStorageIteratorBySnapshotHash(addr *types.Address, prefix []byte, snapshotHash *types.Hash) 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) GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetLatestSnapshotBlock() *ledger.SnapshotBlock GetLatestAccountBlock(addr *types.Address) (*ledger.AccountBlock, error) GetSnapshotBlockBeforeTime(blockCreatedTime *time.Time) (*ledger.SnapshotBlock, 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) SaList() *chain_cache.AdditionList GetReceiveBlockHeights(hash *types.Hash) ([]uint64, 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) DebugGetStorage ¶ added in v1.1.2
No Balance and Code
func (*VmContext) GetAccountBlockByHash ¶
func (context *VmContext) GetAccountBlockByHash(hash *types.Hash) *ledger.AccountBlock
func (*VmContext) GetBalance ¶
func (*VmContext) GetBalanceList ¶
func (*VmContext) GetConsensusGroupList ¶
func (*VmContext) GetContractCode ¶
func (*VmContext) GetGenesisSnapshotBlock ¶
func (context *VmContext) GetGenesisSnapshotBlock() *ledger.SnapshotBlock
func (*VmContext) GetLogListHash ¶
func (*VmContext) GetOneHourQuota ¶ added in v1.2.0
func (*VmContext) GetReceiveBlockHeights ¶ added in v1.2.0
get current account receive heights of a send block hash
func (*VmContext) GetRegisterList ¶
func (*VmContext) GetSnapshotBlockBeforeTime ¶
func (*VmContext) GetSnapshotBlockByHash ¶
func (context *VmContext) GetSnapshotBlockByHash(hash *types.Hash) *ledger.SnapshotBlock
func (*VmContext) GetSnapshotBlockByHeight ¶
func (context *VmContext) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error)
func (*VmContext) GetSnapshotBlocks ¶
func (context *VmContext) GetSnapshotBlocks(startHeight, count uint64, forward, containSnapshotContent bool) []*ledger.SnapshotBlock
func (*VmContext) GetStorage ¶
func (*VmContext) GetStorageBySnapshotHash ¶
func (*VmContext) GetStorageHash ¶
func (*VmContext) GetVoteMap ¶
func (*VmContext) IsAddressExisted ¶
func (*VmContext) NewStorageIterator ¶
func (context *VmContext) NewStorageIterator(addr *types.Address, prefix []byte) vmctxt_interface.StorageIterator
func (*VmContext) NewStorageIteratorBySnapshotHash ¶
func (context *VmContext) NewStorageIteratorBySnapshotHash(addr *types.Address, prefix []byte, snapshotHash *types.Hash) 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.