Documentation
¶
Overview ¶
Package accountdb
@author: xwc1125
Package accountdb ¶
@author: xwc1125
Package accountdb ¶
@author: xwc1125
Package accountdb ¶
@author: xwc1125
Package accountdb ¶
@author: xwc1125
Index ¶
- type AccountDB
- func (a *AccountDB) AddBalance(account string, amount *big.Int)
- func (a *AccountDB) CommitObject(account string, deleteEmptyObjects bool)
- func (a *AccountDB) CommitTree() (types.Hash, error)
- func (a *AccountDB) CreateAccount(account *accounts.AccountStore)
- func (a *AccountDB) Database() basedb.Database
- func (a *AccountDB) Empty(account string) bool
- func (a *AccountDB) Exist(account string) bool
- func (a *AccountDB) FinaliseObject(account string, deleteEmptyObjects bool)
- func (a *AccountDB) ForEachStorage(account string, cb func(key, value types.Hash) bool) error
- func (a *AccountDB) FrozenAccount(account string)
- func (a *AccountDB) GetAccount(account string) *accounts.AccountStore
- func (a *AccountDB) GetBalance(account string) *big.Int
- func (a *AccountDB) GetCode(account string) []byte
- func (a *AccountDB) GetCodeSize(account string) int
- func (a *AccountDB) GetCommittedState(account string, hash types.Hash) types.Hash
- func (a *AccountDB) GetNonce(account string) uint64
- func (a *AccountDB) GetState(account string, hash types.Hash) types.Hash
- func (a *AccountDB) HasSuicided(account string) bool
- func (a *AccountDB) IntermediateRoot() types.Hash
- func (a *AccountDB) Reset(root types.Hash) error
- func (a *AccountDB) SetAddress(account string, address types.Address)
- func (a *AccountDB) SetBalance(account string, amount *big.Int)
- func (a *AccountDB) SetCode(account string, code []byte)
- func (a *AccountDB) SetLost(account string, data *accounts.LostStore)
- func (a *AccountDB) SetNonce(account string, nonce uint64)
- func (a *AccountDB) SetPartner(account string, data accounts.PartnerData)
- func (a *AccountDB) SetState(account string, key, value types.Hash)
- func (a *AccountDB) SubBalance(account string, amount *big.Int)
- func (a *AccountDB) Suicide(account string) bool
- func (a *AccountDB) UnFrozenAccount(account string)
- func (a *AccountDB) UpdatePermission(account string, permission *accounts.Permissions)
- type AccountKVS
- func (a *AccountKVS) AddKV(account string, namespace string, key string, val interface{})
- func (a *AccountKVS) CommitObject(account string, deleteEmptyObjects bool)
- func (a *AccountKVS) CommitTree() (types.Hash, error)
- func (a *AccountKVS) Database() basedb.Database
- func (a *AccountKVS) FinaliseObject(account string, deleteEmptyObjects bool)
- func (a *AccountKVS) IntermediateRoot() types.Hash
- func (a *AccountKVS) KV(account string, namespace string, key string) (interface{}, error)
- func (a *AccountKVS) KVNP(account string, namespace string) (*linkedHashMap.LinkedHashMap, error)
- func (a *AccountKVS) KVS(account string) *linkedHashMap.LinkedHashMap
- func (a *AccountKVS) KeyExist(account string, namespace string, key string) bool
- func (a *AccountKVS) NamespaceExist(account string, namespace string) bool
- type AccountMap
- func (a *AccountMap) AddressExist(addr types.Address) bool
- func (a *AccountMap) CommitObject(account string, deleteEmptyObjects bool)
- func (a *AccountMap) CommitTree() (types.Hash, error)
- func (a *AccountMap) CreateMap(addr types.Address, name string)
- func (a *AccountMap) Database() basedb.Database
- func (a *AccountMap) FinaliseObject(account string, deleteEmptyObjects bool)
- func (a *AccountMap) GetOwner(addr types.Address) string
- func (a *AccountMap) IntermediateRoot() types.Hash
- type Code
- type Storage
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountDB ¶
type AccountDB struct {
// contains filtered or unexported fields
}
func NewAccountDB ¶
NewAccountDB Create a new state from a given trie.
func (*AccountDB) AddBalance ¶
AddBalance adds amount to the account associated with addr.
func (*AccountDB) CommitObject ¶
func (*AccountDB) CreateAccount ¶
func (a *AccountDB) CreateAccount(account *accounts.AccountStore)
func (*AccountDB) Database ¶
Database retrieves the low level database supporting the lower level trie ops.
func (*AccountDB) Empty ¶
Empty returns whether the state object is either non-existent or empty according to the EIP161 specification (balance = nonce = 0)
func (*AccountDB) Exist ¶
Exist reports whether the given account address exists in the state. Notably this also returns true for suicided accounts.
func (*AccountDB) FinaliseObject ¶
Finalise finalises the state by removing the self destructed objects and clears the journal as well as the refunds.
func (*AccountDB) ForEachStorage ¶
func (*AccountDB) FrozenAccount ¶
func (*AccountDB) GetAccount ¶
func (a *AccountDB) GetAccount(account string) *accounts.AccountStore
func (*AccountDB) GetBalance ¶
GetBalance Retrieve the balance from the given address or 0 if object not found
func (*AccountDB) GetCodeSize ¶
func (*AccountDB) GetCommittedState ¶
func (*AccountDB) HasSuicided ¶
func (*AccountDB) IntermediateRoot ¶
func (*AccountDB) Reset ¶
Reset clears out all ephemeral state objects from the state db, but keeps the underlying state trie to avoid reloading data for the next operations.
func (*AccountDB) SetAddress ¶
func (*AccountDB) SetPartner ¶
func (a *AccountDB) SetPartner(account string, data accounts.PartnerData)
func (*AccountDB) SubBalance ¶
SubBalance subtracts amount from the account associated with addr.
func (*AccountDB) UnFrozenAccount ¶
func (*AccountDB) UpdatePermission ¶
func (a *AccountDB) UpdatePermission(account string, permission *accounts.Permissions)
type AccountKVS ¶
type AccountKVS struct {
// contains filtered or unexported fields
}
AccountKVS 账户kvs
func NewAccountKVS ¶
func (*AccountKVS) AddKV ¶
func (a *AccountKVS) AddKV(account string, namespace string, key string, val interface{})
func (*AccountKVS) CommitObject ¶
func (a *AccountKVS) CommitObject(account string, deleteEmptyObjects bool)
func (*AccountKVS) CommitTree ¶
func (a *AccountKVS) CommitTree() (types.Hash, error)
func (*AccountKVS) Database ¶
func (a *AccountKVS) Database() basedb.Database
func (*AccountKVS) FinaliseObject ¶
func (a *AccountKVS) FinaliseObject(account string, deleteEmptyObjects bool)
and clears the journal as well as the refunds.
func (*AccountKVS) IntermediateRoot ¶
func (a *AccountKVS) IntermediateRoot() types.Hash
func (*AccountKVS) KV ¶
func (a *AccountKVS) KV(account string, namespace string, key string) (interface{}, error)
func (*AccountKVS) KVNP ¶
func (a *AccountKVS) KVNP(account string, namespace string) (*linkedHashMap.LinkedHashMap, error)
func (*AccountKVS) KVS ¶
func (a *AccountKVS) KVS(account string) *linkedHashMap.LinkedHashMap
func (*AccountKVS) KeyExist ¶
func (a *AccountKVS) KeyExist(account string, namespace string, key string) bool
func (*AccountKVS) NamespaceExist ¶
func (a *AccountKVS) NamespaceExist(account string, namespace string) bool
type AccountMap ¶
type AccountMap struct {
// contains filtered or unexported fields
}
AccountMap 地址到账户名称的映射
func NewAccountMap ¶
func (*AccountMap) AddressExist ¶
func (a *AccountMap) AddressExist(addr types.Address) bool
func (*AccountMap) CommitObject ¶
func (a *AccountMap) CommitObject(account string, deleteEmptyObjects bool)
func (*AccountMap) CommitTree ¶
func (a *AccountMap) CommitTree() (types.Hash, error)
func (*AccountMap) Database ¶
func (a *AccountMap) Database() basedb.Database
Database retrieves the low level database supporting the lower level trie ops.
func (*AccountMap) FinaliseObject ¶
func (a *AccountMap) FinaliseObject(account string, deleteEmptyObjects bool)
FinaliseObject and clears the journal as well as the refunds.
func (*AccountMap) IntermediateRoot ¶
func (a *AccountMap) IntermediateRoot() types.Hash