Documentation ¶
Index ¶
- type Chain
- type Unsaved
- func (unsaved *Unsaved) AddLog(log *ledger.VmLog)
- func (unsaved *Unsaved) GetBalance(tokenTypeId *types.TokenTypeId) (*big.Int, bool)
- func (unsaved *Unsaved) GetBalanceMap() map[types.TokenTypeId]*big.Int
- func (unsaved *Unsaved) GetCode() []byte
- func (unsaved *Unsaved) GetContractMeta(addr types.Address) *ledger.ContractMeta
- func (unsaved *Unsaved) GetLogList() ledger.VmLogList
- func (unsaved *Unsaved) GetLogListHash(snapshotBlockHeight uint64, address types.Address, prevHash types.Hash) *types.Hash
- func (unsaved *Unsaved) GetStorage() [][2][]byte
- func (unsaved *Unsaved) GetValue(key []byte) ([]byte, bool)
- func (unsaved *Unsaved) IsDelete(key []byte) bool
- func (unsaved *Unsaved) NewStorageIterator(prefix []byte) interfaces.StorageIterator
- func (unsaved *Unsaved) ReleaseRuntime()
- func (unsaved *Unsaved) Reset()
- func (unsaved *Unsaved) SetBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
- func (unsaved *Unsaved) SetCode(code []byte)
- func (unsaved *Unsaved) SetContractMeta(addr types.Address, contractMeta *ledger.ContractMeta)
- func (unsaved *Unsaved) SetValue(key []byte, value []byte)
- type VmAccountBlock
- type VmDb
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain interface { IsContractAccount(address types.Address) (bool, error) GetQuotaUsedList(address types.Address) []types.QuotaInfo GetGlobalQuota() types.QuotaInfo GetBalance(addr types.Address, tokenId types.TokenTypeId) (*big.Int, error) GetContractCode(contractAddr types.Address) ([]byte, error) GetContractMeta(contractAddress types.Address) (meta *ledger.ContractMeta, err error) GetConfirmSnapshotHeaderByAbHash(abHash types.Hash) (*ledger.SnapshotBlock, error) GetConfirmedTimes(blockHash types.Hash) (uint64, error) GetContractMetaInSnapshot(contractAddress types.Address, snapshotHeight uint64) (meta *ledger.ContractMeta, err error) GetSnapshotHeaderByHash(hash types.Hash) (*ledger.SnapshotBlock, error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) GetAccountBlockByHash(blockHash types.Hash) (*ledger.AccountBlock, error) GetLatestAccountBlock(addr types.Address) (*ledger.AccountBlock, error) GetVmLogList(logHash *types.Hash) (ledger.VmLogList, error) GetUnconfirmedBlocks(addr types.Address) []*ledger.AccountBlock GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetStakeBeneficialAmount(addr types.Address) (*big.Int, error) GetStorageIterator(address types.Address, prefix []byte) (interfaces.StorageIterator, error) GetValue(addr types.Address, key []byte) ([]byte, error) GetCallDepth(sendBlockHash types.Hash) (uint16, error) GetSnapshotBlockByContractMeta(addr types.Address, fromHash types.Hash) (*ledger.SnapshotBlock, error) GetSeedConfirmedSnapshotBlock(addr types.Address, fromHash types.Hash) (*ledger.SnapshotBlock, error) GetSeed(limitSb *ledger.SnapshotBlock, fromHash types.Hash) (uint64, error) }
type Unsaved ¶
type Unsaved struct {
// contains filtered or unexported fields
}
func NewUnsaved ¶
func NewUnsaved() *Unsaved
func (*Unsaved) GetBalance ¶
func (*Unsaved) GetBalanceMap ¶
func (unsaved *Unsaved) GetBalanceMap() map[types.TokenTypeId]*big.Int
func (*Unsaved) GetContractMeta ¶
func (unsaved *Unsaved) GetContractMeta(addr types.Address) *ledger.ContractMeta
func (*Unsaved) GetLogList ¶
func (*Unsaved) GetLogListHash ¶
func (*Unsaved) GetStorage ¶
func (*Unsaved) NewStorageIterator ¶
func (unsaved *Unsaved) NewStorageIterator(prefix []byte) interfaces.StorageIterator
func (*Unsaved) ReleaseRuntime ¶
func (unsaved *Unsaved) ReleaseRuntime()
func (*Unsaved) SetBalance ¶
func (unsaved *Unsaved) SetBalance(tokenTypeId *types.TokenTypeId, amount *big.Int)
func (*Unsaved) SetContractMeta ¶
func (unsaved *Unsaved) SetContractMeta(addr types.Address, contractMeta *ledger.ContractMeta)
type VmAccountBlock ¶
type VmAccountBlock struct { AccountBlock *ledger.AccountBlock VmDb VmDb }
type VmDb ¶
type VmDb interface { // ====== Context ====== CanWrite() bool Address() *types.Address LatestSnapshotBlock() (*ledger.SnapshotBlock, error) PrevAccountBlock() (*ledger.AccountBlock, error) GetLatestAccountBlock(addr types.Address) (*ledger.AccountBlock, error) IsContractAccount() (bool, error) GetCallDepth(sendBlockHash *types.Hash) (uint16, error) GetQuotaUsedList(addr types.Address) []types.QuotaInfo GetGlobalQuota() types.QuotaInfo // ====== State ====== GetReceiptHash() *types.Hash Reset() // Release memory used in runtime. Finish() // ====== Storage ====== GetValue(key []byte) ([]byte, error) GetOriginalValue(key []byte) ([]byte, error) SetValue(key []byte, value []byte) error NewStorageIterator(prefix []byte) (interfaces.StorageIterator, error) GetUnsavedStorage() [][2][]byte // ====== Balance ====== GetBalance(tokenTypeId *types.TokenTypeId) (*big.Int, error) SetBalance(tokenTypeId *types.TokenTypeId, amount *big.Int) GetUnsavedBalanceMap() map[types.TokenTypeId]*big.Int // ====== VMLog ====== AddLog(log *ledger.VmLog) GetLogList() ledger.VmLogList GetHistoryLogList(logHash *types.Hash) (ledger.VmLogList, error) GetLogListHash() *types.Hash // ====== AccountBlock ====== GetUnconfirmedBlocks(address types.Address) []*ledger.AccountBlock // ====== SnapshotBlock ====== GetGenesisSnapshotBlock() *ledger.SnapshotBlock GetConfirmSnapshotHeader(blockHash types.Hash) (*ledger.SnapshotBlock, error) GetConfirmedTimes(blockHash types.Hash) (uint64, error) GetSnapshotBlockByHeight(height uint64) (*ledger.SnapshotBlock, error) // ====== Meta & Code ====== SetContractMeta(toAddr types.Address, meta *ledger.ContractMeta) GetContractMeta() (*ledger.ContractMeta, error) GetContractMetaInSnapshot(contractAddress types.Address, snapshotBlock *ledger.SnapshotBlock) (meta *ledger.ContractMeta, err error) SetContractCode(code []byte) GetContractCode() ([]byte, error) GetContractCodeBySnapshotBlock(addr *types.Address, snapshotBlock *ledger.SnapshotBlock) ([]byte, error) // TODO GetUnsavedContractMeta() map[types.Address]*ledger.ContractMeta GetUnsavedContractCode() []byte // ====== built-in contract ====== GetStakeBeneficialAmount(addr *types.Address) (*big.Int, error) // ====== debug ====== DebugGetStorage() (map[string][]byte, error) }
func NewGenesisVmDB ¶
func NewNoContextVmDb ¶
Click to show internal directories.
Click to hide internal directories.