Documentation ¶
Index ¶
- type CacheDB
- func (self *CacheDB) Commit()
- func (self *CacheDB) Delete(key []byte)
- func (self *CacheDB) DeleteContract(address comm.Address)
- func (self *CacheDB) Get(key []byte) ([]byte, error)
- func (self *CacheDB) GetContract(addr comm.Address) (*payload.DeployCode, error)
- func (self *CacheDB) NewIterator(key []byte) common.StoreIterator
- func (self *CacheDB) Put(key []byte, value []byte)
- func (self *CacheDB) PutContract(contract *payload.DeployCode) error
- type CloneCache
- func (this *CloneCache) Add(prefix common.DataEntryPrefix, key []byte, value states.StateValue)
- func (this *CloneCache) Commit()
- func (this *CloneCache) Delete(prefix common.DataEntryPrefix, key []byte)
- func (this *CloneCache) Get(prefix common.DataEntryPrefix, key []byte) (states.StateValue, error)
- func (this *CloneCache) GetOrAdd(prefix common.DataEntryPrefix, key []byte, value states.StateValue) (states.StateValue, error)
- type Iter
- type Memory
- type StateItem
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheDB ¶
type CacheDB struct {
// contains filtered or unexported fields
}
CacheDB is smart contract execute cache, it contain transaction cache and block cache When smart contract execute finish, need to commit transaction cache to block cache
func NewCacheDB ¶
NewCacheDB return a new contract cache
func (*CacheDB) Commit ¶
func (self *CacheDB) Commit()
Commit current transaction cache to block cache
func (*CacheDB) DeleteContract ¶
func (*CacheDB) GetContract ¶
func (*CacheDB) NewIterator ¶
func (self *CacheDB) NewIterator(key []byte) common.StoreIterator
func (*CacheDB) PutContract ¶
func (self *CacheDB) PutContract(contract *payload.DeployCode) error
type CloneCache ¶
type CloneCache struct { Memory Memory Store common.StateStore }
CacheDB is smart contract execute cache, it contain transaction cache and block cache When smart contract execute finish, need to commit transaction cache to block cache
func NewCloneCache ¶
func NewCloneCache(store common.StateStore) *CloneCache
NewCloneCache return a new contract cache
func (*CloneCache) Add ¶
func (this *CloneCache) Add(prefix common.DataEntryPrefix, key []byte, value states.StateValue)
Add item to cache
func (*CloneCache) Commit ¶
func (this *CloneCache) Commit()
Commit current transaction cache to block cache
func (*CloneCache) Delete ¶
func (this *CloneCache) Delete(prefix common.DataEntryPrefix, key []byte)
Delete item from cache
func (*CloneCache) Get ¶
func (this *CloneCache) Get(prefix common.DataEntryPrefix, key []byte) (states.StateValue, error)
Get item by key
func (*CloneCache) GetOrAdd ¶
func (this *CloneCache) GetOrAdd(prefix common.DataEntryPrefix, key []byte, value states.StateValue) (states.StateValue, error)
GetOrAdd item If item has existed, return it Else add it to cache
type StateItem ¶
type StateItem struct { Prefix common.DataEntryPrefix Key string Value states.StateValue State common.ItemState }
StateItem describe smart contract cache item element