Documentation
¶
Index ¶
- Constants
- Variables
- func IsValuable(log *types.ChangeLog) bool
- func MergeChangeLogs(logs types.ChangeLogSlice) types.ChangeLogSlice
- func NewAddEventLog(address common.Address, processor types.ChangeLogProcessor, ...) *types.ChangeLog
- func NewAssetCodeLog(address common.Address, processor types.ChangeLogProcessor, code common.Hash, ...) (*types.ChangeLog, error)
- func NewAssetCodeRootLog(address common.Address, processor types.ChangeLogProcessor, oldVal common.Hash, ...) (*types.ChangeLog, error)
- func NewAssetCodeStateLog(address common.Address, processor types.ChangeLogProcessor, id common.Hash, ...) (*types.ChangeLog, error)
- func NewAssetCodeTotalSupplyLog(address common.Address, processor types.ChangeLogProcessor, code common.Hash, ...) (*types.ChangeLog, error)
- func NewAssetIdLog(address common.Address, processor types.ChangeLogProcessor, id common.Hash, ...) (*types.ChangeLog, error)
- func NewAssetIdRootLog(address common.Address, processor types.ChangeLogProcessor, oldVal common.Hash, ...) (*types.ChangeLog, error)
- func NewBalanceLog(address common.Address, processor types.ChangeLogProcessor, ...) *types.ChangeLog
- func NewCandidateLog(address common.Address, processor types.ChangeLogProcessor, ...) *types.ChangeLog
- func NewCandidateStateLog(address common.Address, processor types.ChangeLogProcessor, key string, ...) *types.ChangeLog
- func NewCodeLog(address common.Address, processor types.ChangeLogProcessor, code types.Code) *types.ChangeLog
- func NewEquityLog(address common.Address, processor types.ChangeLogProcessor, id common.Hash, ...) (*types.ChangeLog, error)
- func NewEquityRootLog(address common.Address, processor types.ChangeLogProcessor, oldVal common.Hash, ...) (*types.ChangeLog, error)
- func NewSignerLog(address common.Address, processor types.ChangeLogProcessor, ...) (*types.ChangeLog, error)
- func NewStorageLog(address common.Address, processor types.ChangeLogProcessor, key common.Hash, ...) (*types.ChangeLog, error)
- func NewStorageRootLog(address common.Address, processor types.ChangeLogProcessor, oldVal common.Hash, ...) *types.ChangeLog
- func NewSuicideLog(address common.Address, processor types.ChangeLogProcessor) *types.ChangeLog
- func NewVoteForLog(address common.Address, processor types.ChangeLogProcessor, ...) *types.ChangeLog
- func NewVotesLog(address common.Address, processor types.ChangeLogProcessor, newVotes *big.Int) *types.ChangeLog
- type Account
- func (a *Account) Finalise() error
- func (a *Account) GetAddress() common.Address
- func (a *Account) GetAssetCode(code common.Hash) (*types.Asset, error)
- func (a *Account) GetAssetCodeRoot() common.Hash
- func (a *Account) GetAssetCodeState(code common.Hash, key string) (string, error)
- func (a *Account) GetAssetCodeTotalSupply(code common.Hash) (*big.Int, error)
- func (a *Account) GetAssetIdRoot() common.Hash
- func (a *Account) GetAssetIdState(id common.Hash) (string, error)
- func (a *Account) GetBalance() *big.Int
- func (a *Account) GetCandidate() types.Profile
- func (a *Account) GetCandidateState(key string) string
- func (a *Account) GetCode() (types.Code, error)
- func (a *Account) GetCodeHash() common.Hash
- func (a *Account) GetEquityRoot() common.Hash
- func (a *Account) GetEquityState(id common.Hash) (*types.AssetEquity, error)
- func (a *Account) GetEvents() []*types.Event
- func (a *Account) GetNextVersion(logType types.ChangeLogType) uint32
- func (a *Account) GetSigners() types.Signers
- func (a *Account) GetStorageRoot() common.Hash
- func (a *Account) GetStorageState(key common.Hash) ([]byte, error)
- func (a *Account) GetSuicide() bool
- func (a *Account) GetVersion(logType types.ChangeLogType) uint32
- func (a *Account) GetVoteFor() common.Address
- func (a *Account) GetVotes() *big.Int
- func (a *Account) IsEmpty() bool
- func (a *Account) MarshalJSON() ([]byte, error)
- func (a *Account) PopEvent() error
- func (a *Account) PushEvent(event *types.Event)
- func (a *Account) Save() error
- func (a *Account) SetAssetCode(code common.Hash, asset *types.Asset) error
- func (a *Account) SetAssetCodeRoot(root common.Hash)
- func (a *Account) SetAssetCodeState(code common.Hash, key string, val string) error
- func (a *Account) SetAssetCodeTotalSupply(code common.Hash, val *big.Int) error
- func (a *Account) SetAssetIdRoot(root common.Hash)
- func (a *Account) SetAssetIdState(id common.Hash, data string) error
- func (a *Account) SetBalance(balance *big.Int)
- func (a *Account) SetCandidate(profile types.Profile)
- func (a *Account) SetCandidateState(key string, val string)
- func (a *Account) SetCode(code types.Code)
- func (a *Account) SetCodeHash(codeHash common.Hash)
- func (a *Account) SetEquityRoot(root common.Hash)
- func (a *Account) SetEquityState(id common.Hash, equity *types.AssetEquity) error
- func (a *Account) SetSingers(signers types.Signers) error
- func (a *Account) SetStorageRoot(root common.Hash)
- func (a *Account) SetStorageState(key common.Hash, value []byte) error
- func (a *Account) SetSuicide(suicided bool)
- func (a *Account) SetVersion(logType types.ChangeLogType, version, blockHeight uint32)
- func (a *Account) SetVoteFor(addr common.Address)
- func (a *Account) SetVotes(votes *big.Int)
- func (a *Account) String() string
- func (a *Account) UnmarshalJSON(input []byte) error
- type LogProcessor
- func (h *LogProcessor) Clear()
- func (h *LogProcessor) GetAccount(addr common.Address) types.AccountAccessor
- func (h *LogProcessor) GetChangeLogs() []*types.ChangeLog
- func (h *LogProcessor) GetLogsByAddress(address common.Address) []*types.ChangeLog
- func (h *LogProcessor) MergeChangeLogs()
- func (h *LogProcessor) PushChangeLog(log *types.ChangeLog)
- func (h *LogProcessor) Rebuild(address common.Address, logs types.ChangeLogSlice) (*Account, error)
- func (h *LogProcessor) RevertToSnapshot(revid int)
- func (h *LogProcessor) Snapshot() int
- type Manager
- func (am *Manager) AddEvent(event *types.Event)
- func (am *Manager) Finalise() error
- func (am *Manager) GetAccount(address common.Address) types.AccountAccessor
- func (am *Manager) GetCanonicalAccount(address common.Address) types.AccountAccessor
- func (am *Manager) GetChangeLogs() types.ChangeLogSlice
- func (am *Manager) GetEvents() []*types.Event
- func (am *Manager) GetTxsProduct(txs types.Transactions, gasUsed uint64) *TxsProduct
- func (am *Manager) GetVersionRoot() common.Hash
- func (am *Manager) MergeChangeLogs()
- func (am *Manager) Rebuild(address common.Address, logs types.ChangeLogSlice) error
- func (am *Manager) RebuildAll(b *types.Block) error
- func (am *Manager) Reset(blockHash common.Hash)
- func (am *Manager) RevertToSnapshot(revid int)
- func (am *Manager) Save(newBlockHash common.Hash) error
- func (am *Manager) Snapshot() int
- func (am *Manager) Stop(graceful bool) error
- type ProfileChangeLogExtra
- type RawAccountLoader
- type ReadOnlyAccount
- type ReadOnlyManager
- type SafeAccount
- func (a *SafeAccount) GetAddress() common.Address
- func (a *SafeAccount) GetAssetCode(code common.Hash) (*types.Asset, error)
- func (a *SafeAccount) GetAssetCodeRoot() common.Hash
- func (a *SafeAccount) GetAssetCodeState(code common.Hash, key string) (string, error)
- func (a *SafeAccount) GetAssetCodeTotalSupply(code common.Hash) (*big.Int, error)
- func (a *SafeAccount) GetAssetIdRoot() common.Hash
- func (a *SafeAccount) GetAssetIdState(id common.Hash) (string, error)
- func (a *SafeAccount) GetBalance() *big.Int
- func (a *SafeAccount) GetCandidate() types.Profile
- func (a *SafeAccount) GetCandidateState(key string) string
- func (a *SafeAccount) GetCode() (types.Code, error)
- func (a *SafeAccount) GetCodeHash() common.Hash
- func (a *SafeAccount) GetEquityRoot() common.Hash
- func (a *SafeAccount) GetEquityState(id common.Hash) (*types.AssetEquity, error)
- func (a *SafeAccount) GetEvents() []*types.Event
- func (a *SafeAccount) GetNextVersion(logType types.ChangeLogType) uint32
- func (a *SafeAccount) GetSigners() types.Signers
- func (a *SafeAccount) GetStorageRoot() common.Hash
- func (a *SafeAccount) GetStorageState(key common.Hash) ([]byte, error)
- func (a *SafeAccount) GetSuicide() bool
- func (a *SafeAccount) GetVersion(logType types.ChangeLogType) uint32
- func (a *SafeAccount) GetVoteFor() common.Address
- func (a *SafeAccount) GetVotes() *big.Int
- func (a *SafeAccount) IsEmpty() bool
- func (a *SafeAccount) MarshalJSON() ([]byte, error)
- func (a *SafeAccount) PopEvent() error
- func (a *SafeAccount) PushEvent(event *types.Event)
- func (a *SafeAccount) SetAssetCode(code common.Hash, asset *types.Asset) error
- func (a *SafeAccount) SetAssetCodeRoot(root common.Hash)
- func (a *SafeAccount) SetAssetCodeState(code common.Hash, key string, val string) error
- func (a *SafeAccount) SetAssetCodeTotalSupply(code common.Hash, val *big.Int) error
- func (a *SafeAccount) SetAssetIdRoot(root common.Hash)
- func (a *SafeAccount) SetAssetIdState(id common.Hash, val string) error
- func (a *SafeAccount) SetBalance(balance *big.Int)
- func (a *SafeAccount) SetCandidate(profile types.Profile)
- func (a *SafeAccount) SetCandidateState(key string, val string)
- func (a *SafeAccount) SetCode(code types.Code)
- func (a *SafeAccount) SetCodeHash(codeHash common.Hash)
- func (a *SafeAccount) SetEquityRoot(root common.Hash)
- func (a *SafeAccount) SetEquityState(id common.Hash, equity *types.AssetEquity) error
- func (a *SafeAccount) SetSingers(signers types.Signers) error
- func (a *SafeAccount) SetStorageRoot(root common.Hash)
- func (a *SafeAccount) SetStorageState(key common.Hash, value []byte) error
- func (a *SafeAccount) SetSuicide(suicided bool)
- func (a *SafeAccount) SetVoteFor(addr common.Address)
- func (a *SafeAccount) SetVotes(votes *big.Int)
- func (a *SafeAccount) String() string
- func (a *SafeAccount) UnmarshalJSON(input []byte) error
- type Storage
- type StorageCache
- func (cache *StorageCache) DelState(key common.Hash) error
- func (cache *StorageCache) GetState(root common.Hash, key common.Hash) ([]byte, error)
- func (cache *StorageCache) GetTrie(root common.Hash) (*trie.SecureTrie, error)
- func (cache *StorageCache) Reset()
- func (cache *StorageCache) Save(root common.Hash) error
- func (cache *StorageCache) SetState(key common.Hash, value []byte) error
- func (cache *StorageCache) Update(root common.Hash) (common.Hash, error)
- type TxsProduct
Constants ¶
const ( BalanceLog types.ChangeLogType = iota + 1 StorageLog StorageRootLog AssetCodeLog AssetCodeStateLog AssetCodeRootLog AssetCodeTotalSupplyLog AssetIdLog AssetIdRootLog EquityLog EquityRootLog CandidateLog CandidateStateLog CodeLog AddEventLog SuicideLog VoteForLog VotesLog SignerLog LOG_TYPE_STOP )
const MaxTrieCacheGen = uint16(120)
Trie cache generation limit after which to evict trie nodes from memory.
Variables ¶
var ( ErrNegativeBalance = errors.New("balance can't be negative") ErrLoadCodeFail = errors.New("can't load contract code") ErrTrieFail = errors.New("can't load contract storage trie") ErrTrieChanged = errors.New("the trie has changed after Finalise") )
var ( ErrRevisionNotExist = errors.New("revision cannot be reverted") ErrNoEvents = errors.New("the times of pop event is more than push") ErrSnapshotIsBroken = errors.New("the snapshot is broken") )
var (
ErrSaveReadOnly = errors.New("can not save a read only account")
)
Functions ¶
func IsValuable ¶
IsValuable returns true if the change log contains some data change
func MergeChangeLogs ¶
func MergeChangeLogs(logs types.ChangeLogSlice) types.ChangeLogSlice
MergeChangeLogs merges the change logs for same account in block. Then return the merged change logs.
func NewAddEventLog ¶
func NewAddEventLog(address common.Address, processor types.ChangeLogProcessor, newEvent *types.Event) *types.ChangeLog
NewAddEventLog records contract code change
func NewAssetCodeLog ¶ added in v1.2.0
func NewAssetCodeRootLog ¶ added in v1.2.0
func NewAssetCodeStateLog ¶ added in v1.2.0
func NewAssetCodeTotalSupplyLog ¶ added in v1.2.0
func NewAssetIdLog ¶ added in v1.2.0
func NewAssetIdRootLog ¶ added in v1.2.0
func NewBalanceLog ¶
func NewBalanceLog(address common.Address, processor types.ChangeLogProcessor, newBalance *big.Int) *types.ChangeLog
NewBalanceLog records balance change
func NewCandidateLog ¶ added in v1.2.0
func NewCandidateStateLog ¶ added in v1.2.0
func NewCodeLog ¶
func NewCodeLog(address common.Address, processor types.ChangeLogProcessor, code types.Code) *types.ChangeLog
NewCodeLog records contract code setting
func NewEquityLog ¶ added in v1.2.0
func NewEquityRootLog ¶ added in v1.2.0
func NewSignerLog ¶ added in v1.3.0
func NewStorageLog ¶
func NewStorageLog(address common.Address, processor types.ChangeLogProcessor, key common.Hash, newVal []byte) (*types.ChangeLog, error)
NewStorageLog records contract storage value change
func NewStorageRootLog ¶ added in v1.2.0
func NewSuicideLog ¶
NewSuicideLog records balance change
func NewVoteForLog ¶ added in v1.1.0
func NewVotesLog ¶ added in v1.1.0
func NewVotesLog(address common.Address, processor types.ChangeLogProcessor, newVotes *big.Int) *types.ChangeLog
ChangeLog definitions
Types ¶
type Account ¶
type Account struct {
// contains filtered or unexported fields
}
Account is used to read and write account data. the code and dirty storage K/V would be cached till they are flushing to db
func NewAccount ¶
NewAccount wrap an AccountData object, or creates a new one if it's nil.
func (*Account) GetAddress ¶
Implement AccountAccessor. Access Account without changelog
func (*Account) GetAssetCode ¶ added in v1.2.0
func (*Account) GetAssetCodeRoot ¶ added in v1.2.0
func (*Account) GetAssetCodeState ¶ added in v1.2.0
func (*Account) GetAssetCodeTotalSupply ¶ added in v1.2.0
func (*Account) GetAssetIdRoot ¶ added in v1.2.0
func (*Account) GetAssetIdState ¶ added in v1.2.0
func (*Account) GetBalance ¶
func (*Account) GetCandidate ¶ added in v1.2.0
func (*Account) GetCandidateState ¶ added in v1.2.0
func (*Account) GetCodeHash ¶
func (*Account) GetEquityRoot ¶ added in v1.2.0
func (*Account) GetEquityState ¶ added in v1.2.0
func (*Account) GetNextVersion ¶ added in v1.2.0
func (a *Account) GetNextVersion(logType types.ChangeLogType) uint32
GetBaseVersion returns the version of specific change log from the base block. It is not changed by tx processing until the finalised
func (*Account) GetSigners ¶ added in v1.3.0
func (*Account) GetStorageRoot ¶
StorageRoot wouldn't change until Account.updateTrie() is called
func (*Account) GetStorageState ¶
GetState returns a value in account storage.
func (*Account) GetSuicide ¶
func (*Account) GetVersion ¶
func (a *Account) GetVersion(logType types.ChangeLogType) uint32
GetBaseVersion returns the version of specific change log from the base block. It is not changed by tx processing until the finalised
func (*Account) GetVoteFor ¶ added in v1.1.0
func (*Account) IsEmpty ¶
IsEmpty returns whether the state object is either non-existent or empty (version = 0)
func (*Account) MarshalJSON ¶
MarshalJSON encodes the lemoClient RPC account format.
func (*Account) SetAssetCode ¶ added in v1.2.0
func (*Account) SetAssetCodeRoot ¶ added in v1.2.0
func (*Account) SetAssetCodeState ¶ added in v1.2.0
func (*Account) SetAssetCodeTotalSupply ¶ added in v1.2.0
func (*Account) SetAssetIdRoot ¶ added in v1.2.0
func (*Account) SetAssetIdState ¶ added in v1.2.0
func (*Account) SetBalance ¶
func (*Account) SetCandidate ¶ added in v1.2.0
func (*Account) SetCandidateState ¶ added in v1.2.0
func (*Account) SetCodeHash ¶
func (*Account) SetEquityRoot ¶ added in v1.2.0
func (*Account) SetEquityState ¶ added in v1.2.0
func (*Account) SetSingers ¶ added in v1.3.0
func (*Account) SetStorageRoot ¶
func (*Account) SetStorageState ¶
SetState updates a value in account storage.
func (*Account) SetSuicide ¶
func (*Account) SetVersion ¶
func (a *Account) SetVersion(logType types.ChangeLogType, version, blockHeight uint32)
func (*Account) SetVoteFor ¶ added in v1.1.0
func (*Account) UnmarshalJSON ¶
UnmarshalJSON decodes the lemoClient RPC account format.
type LogProcessor ¶ added in v1.0.2
type LogProcessor struct {
// contains filtered or unexported fields
}
LogProcessor records change logs and contract events during block's transaction execution. It can access raw account data for undo/redo
func NewLogProcessor ¶ added in v1.0.2
func NewLogProcessor(accountLoader RawAccountLoader) *LogProcessor
NewLogProcessor creates a new LogProcessor. It is used to maintain change logs queue
func (*LogProcessor) Clear ¶ added in v1.0.2
func (h *LogProcessor) Clear()
func (*LogProcessor) GetAccount ¶ added in v1.0.2
func (h *LogProcessor) GetAccount(addr common.Address) types.AccountAccessor
func (*LogProcessor) GetChangeLogs ¶ added in v1.0.2
func (h *LogProcessor) GetChangeLogs() []*types.ChangeLog
func (*LogProcessor) GetLogsByAddress ¶ added in v1.0.2
func (h *LogProcessor) GetLogsByAddress(address common.Address) []*types.ChangeLog
func (*LogProcessor) MergeChangeLogs ¶ added in v1.0.2
func (h *LogProcessor) MergeChangeLogs()
MergeChangeLogs merges the change logs for same account in block
func (*LogProcessor) PushChangeLog ¶ added in v1.0.2
func (h *LogProcessor) PushChangeLog(log *types.ChangeLog)
func (*LogProcessor) Rebuild ¶ added in v1.0.2
func (h *LogProcessor) Rebuild(address common.Address, logs types.ChangeLogSlice) (*Account, error)
Rebuild loads and redo all change logs to update account to the newest state.
func (*LogProcessor) RevertToSnapshot ¶ added in v1.0.2
func (h *LogProcessor) RevertToSnapshot(revid int)
RevertToSnapshot reverts all changes made since the given revision.
func (*LogProcessor) Snapshot ¶ added in v1.0.2
func (h *LogProcessor) Snapshot() int
Snapshot returns an identifier for the current revision of the change log.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager is used to maintain the newest and not confirmed account data. It will save all data to the db when finished a block's transactions processing.
func NewManager ¶
NewManager creates a new Manager. It is used to maintain account changes based on the block environment which specified by blockHash
func (*Manager) GetAccount ¶
func (am *Manager) GetAccount(address common.Address) types.AccountAccessor
GetAccount loads account from cache or db, or creates a new one if it's not exist.
func (*Manager) GetCanonicalAccount ¶
func (am *Manager) GetCanonicalAccount(address common.Address) types.AccountAccessor
GetCanonicalAccount loads an readonly account object from confirmed block in db, or creates a new one if it's not exist. The Modification of the account will not be recorded to store.
func (*Manager) GetChangeLogs ¶
func (am *Manager) GetChangeLogs() types.ChangeLogSlice
GetChangeLogs returns all change logs since last reset
func (*Manager) GetTxsProduct ¶ added in v1.2.0
func (am *Manager) GetTxsProduct(txs types.Transactions, gasUsed uint64) *TxsProduct
GetTxProduct get the product of transaction execution
func (*Manager) GetVersionRoot ¶
func (*Manager) MergeChangeLogs ¶
func (am *Manager) MergeChangeLogs()
MergeChangeLogs merges the change logs for same account in block. Then update the version of change logs and account.
func (*Manager) Rebuild ¶
Rebuild loads and redo all change logs to update account to the newest state.
func (*Manager) RevertToSnapshot ¶
RevertToSnapshot reverts all state changes made since the given revision.
type ProfileChangeLogExtra ¶ added in v1.2.0
func (*ProfileChangeLogExtra) String ¶ added in v1.2.0
func (extra *ProfileChangeLogExtra) String() string
type RawAccountLoader ¶ added in v1.0.2
type RawAccountLoader interface {
// contains filtered or unexported methods
}
type ReadOnlyAccount ¶ added in v1.3.0
type ReadOnlyAccount struct {
Account
}
ReadOnlyAccount is used to block any save action on Account
func NewReadOnlyAccount ¶ added in v1.3.0
func NewReadOnlyAccount(db protocol.ChainDB, address common.Address, data *types.AccountData) *ReadOnlyAccount
func (*ReadOnlyAccount) Finalise ¶ added in v1.3.0
func (a *ReadOnlyAccount) Finalise() error
func (*ReadOnlyAccount) Save ¶ added in v1.3.0
func (a *ReadOnlyAccount) Save() error
type ReadOnlyManager ¶ added in v1.1.0
type ReadOnlyManager struct {
// contains filtered or unexported fields
}
ReadOnlyManager is used to access the newest readonly account data
func NewReadOnlyManager ¶ added in v1.3.0
func NewReadOnlyManager(db protocol.ChainDB, stableOnly bool) *ReadOnlyManager
NewManager creates a new Manager. It is used to maintain account changes based on the block environment which specified by blockHash
func (*ReadOnlyManager) AddEvent ¶ added in v1.3.0
func (am *ReadOnlyManager) AddEvent(*types.Event)
func (*ReadOnlyManager) GetAccount ¶ added in v1.3.0
func (am *ReadOnlyManager) GetAccount(address common.Address) types.AccountAccessor
GetAccount
func (*ReadOnlyManager) Reset ¶ added in v1.3.0
func (am *ReadOnlyManager) Reset(blockHash common.Hash)
Reset clears out all data and switch state to the new block environment. It is not necessary to reset if only use stable accounts data
func (*ReadOnlyManager) RevertToSnapshot ¶ added in v1.3.0
func (am *ReadOnlyManager) RevertToSnapshot(int)
func (*ReadOnlyManager) Snapshot ¶ added in v1.3.0
func (am *ReadOnlyManager) Snapshot() int
type SafeAccount ¶
type SafeAccount struct {
// contains filtered or unexported fields
}
SafeAccount is used to record modifications with changelog. So that the modifications can be reverted
func NewSafeAccount ¶
func NewSafeAccount(processor *LogProcessor, account *Account) *SafeAccount
NewSafeAccount creates an account object.
func (*SafeAccount) GetAddress ¶
func (a *SafeAccount) GetAddress() common.Address
func (*SafeAccount) GetAssetCode ¶ added in v1.2.0
func (*SafeAccount) GetAssetCodeRoot ¶ added in v1.2.0
func (a *SafeAccount) GetAssetCodeRoot() common.Hash
func (*SafeAccount) GetAssetCodeState ¶ added in v1.2.0
func (*SafeAccount) GetAssetCodeTotalSupply ¶ added in v1.2.0
func (*SafeAccount) GetAssetIdRoot ¶ added in v1.2.0
func (a *SafeAccount) GetAssetIdRoot() common.Hash
func (*SafeAccount) GetAssetIdState ¶ added in v1.2.0
func (a *SafeAccount) GetAssetIdState(id common.Hash) (string, error)
func (*SafeAccount) GetBalance ¶
func (a *SafeAccount) GetBalance() *big.Int
func (*SafeAccount) GetCandidate ¶ added in v1.2.0
func (a *SafeAccount) GetCandidate() types.Profile
func (*SafeAccount) GetCandidateState ¶ added in v1.2.0
func (a *SafeAccount) GetCandidateState(key string) string
func (*SafeAccount) GetCodeHash ¶
func (a *SafeAccount) GetCodeHash() common.Hash
func (*SafeAccount) GetEquityRoot ¶ added in v1.2.0
func (a *SafeAccount) GetEquityRoot() common.Hash
func (*SafeAccount) GetEquityState ¶ added in v1.2.0
func (a *SafeAccount) GetEquityState(id common.Hash) (*types.AssetEquity, error)
func (*SafeAccount) GetEvents ¶ added in v1.2.0
func (a *SafeAccount) GetEvents() []*types.Event
func (*SafeAccount) GetNextVersion ¶ added in v1.2.0
func (a *SafeAccount) GetNextVersion(logType types.ChangeLogType) uint32
func (*SafeAccount) GetSigners ¶ added in v1.3.0
func (a *SafeAccount) GetSigners() types.Signers
func (*SafeAccount) GetStorageRoot ¶
func (a *SafeAccount) GetStorageRoot() common.Hash
func (*SafeAccount) GetStorageState ¶
func (a *SafeAccount) GetStorageState(key common.Hash) ([]byte, error)
func (*SafeAccount) GetSuicide ¶
func (a *SafeAccount) GetSuicide() bool
func (*SafeAccount) GetVersion ¶
func (a *SafeAccount) GetVersion(logType types.ChangeLogType) uint32
GetBaseVersion returns the version of specific change log from the base block. It is not changed by tx processing until the finalised
func (*SafeAccount) GetVoteFor ¶ added in v1.1.0
func (a *SafeAccount) GetVoteFor() common.Address
func (*SafeAccount) GetVotes ¶ added in v1.1.0
func (a *SafeAccount) GetVotes() *big.Int
func (*SafeAccount) IsEmpty ¶
func (a *SafeAccount) IsEmpty() bool
func (*SafeAccount) MarshalJSON ¶
func (a *SafeAccount) MarshalJSON() ([]byte, error)
MarshalJSON encodes the lemoClient RPC safeAccount format.
func (*SafeAccount) PopEvent ¶ added in v1.2.0
func (a *SafeAccount) PopEvent() error
func (*SafeAccount) PushEvent ¶ added in v1.2.0
func (a *SafeAccount) PushEvent(event *types.Event)
func (*SafeAccount) SetAssetCode ¶ added in v1.2.0
func (*SafeAccount) SetAssetCodeRoot ¶ added in v1.2.0
func (a *SafeAccount) SetAssetCodeRoot(root common.Hash)
func (*SafeAccount) SetAssetCodeState ¶ added in v1.2.0
func (*SafeAccount) SetAssetCodeTotalSupply ¶ added in v1.2.0
func (*SafeAccount) SetAssetIdRoot ¶ added in v1.2.0
func (a *SafeAccount) SetAssetIdRoot(root common.Hash)
func (*SafeAccount) SetAssetIdState ¶ added in v1.2.0
func (a *SafeAccount) SetAssetIdState(id common.Hash, val string) error
func (*SafeAccount) SetBalance ¶
func (a *SafeAccount) SetBalance(balance *big.Int)
overwrite Account.SetXXX. Access Account with changelog
func (*SafeAccount) SetCandidate ¶ added in v1.2.0
func (a *SafeAccount) SetCandidate(profile types.Profile)
func (*SafeAccount) SetCandidateState ¶ added in v1.2.0
func (a *SafeAccount) SetCandidateState(key string, val string)
func (*SafeAccount) SetCode ¶
func (a *SafeAccount) SetCode(code types.Code)
func (*SafeAccount) SetCodeHash ¶
func (a *SafeAccount) SetCodeHash(codeHash common.Hash)
func (*SafeAccount) SetEquityRoot ¶ added in v1.2.0
func (a *SafeAccount) SetEquityRoot(root common.Hash)
func (*SafeAccount) SetEquityState ¶ added in v1.2.0
func (a *SafeAccount) SetEquityState(id common.Hash, equity *types.AssetEquity) error
func (*SafeAccount) SetSingers ¶ added in v1.3.0
func (a *SafeAccount) SetSingers(signers types.Signers) error
func (*SafeAccount) SetStorageRoot ¶
func (a *SafeAccount) SetStorageRoot(root common.Hash)
func (*SafeAccount) SetStorageState ¶
func (a *SafeAccount) SetStorageState(key common.Hash, value []byte) error
func (*SafeAccount) SetSuicide ¶
func (a *SafeAccount) SetSuicide(suicided bool)
func (*SafeAccount) SetVoteFor ¶ added in v1.1.0
func (a *SafeAccount) SetVoteFor(addr common.Address)
func (*SafeAccount) SetVotes ¶ added in v1.1.0
func (a *SafeAccount) SetVotes(votes *big.Int)
func (*SafeAccount) String ¶
func (a *SafeAccount) String() string
func (*SafeAccount) UnmarshalJSON ¶
func (a *SafeAccount) UnmarshalJSON(input []byte) error
UnmarshalJSON decodes the lemoClient RPC safeAccount format.
type StorageCache ¶ added in v1.2.0
type StorageCache struct {
// contains filtered or unexported fields
}
func NewStorageCache ¶ added in v1.2.0
func NewStorageCache(db protocol.ChainDB) *StorageCache
func (*StorageCache) DelState ¶ added in v1.3.0
func (cache *StorageCache) DelState(key common.Hash) error
func (*StorageCache) GetTrie ¶ added in v1.2.0
func (cache *StorageCache) GetTrie(root common.Hash) (*trie.SecureTrie, error)
func (*StorageCache) Reset ¶ added in v1.2.0
func (cache *StorageCache) Reset()
type TxsProduct ¶ added in v1.2.0
type TxsProduct struct { Txs types.Transactions // The transactions executed indeed. These transactions will be packaged in a block GasUsed uint64 // gas used by all transactions ChangeLogs types.ChangeLogSlice VersionRoot common.Hash }
TxsProduct is the product of transaction execution