accountdb

package
v0.0.0-...-5fb9e85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package accountdb

@author: xwc1125

Package accountdb

@author: xwc1125

Package accountdb

@author: xwc1125

Package accountdb

@author: xwc1125

Package accountdb

@author: xwc1125

Index

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

func NewAccountDB(root types.Hash, db basedb.Database, journal *basedb.Journal) (*AccountDB, error)

NewAccountDB Create a new state from a given trie.

func (*AccountDB) AddBalance

func (a *AccountDB) AddBalance(account string, amount *big.Int)

AddBalance adds amount to the account associated with addr.

func (*AccountDB) CommitObject

func (a *AccountDB) CommitObject(account string, deleteEmptyObjects bool)

func (*AccountDB) CommitTree

func (a *AccountDB) CommitTree() (types.Hash, error)

func (*AccountDB) CreateAccount

func (a *AccountDB) CreateAccount(account *accounts.AccountStore)

func (*AccountDB) Database

func (a *AccountDB) Database() basedb.Database

Database retrieves the low level database supporting the lower level trie ops.

func (*AccountDB) Empty

func (a *AccountDB) Empty(account string) bool

Empty returns whether the state object is either non-existent or empty according to the EIP161 specification (balance = nonce = 0)

func (*AccountDB) Exist

func (a *AccountDB) Exist(account string) bool

Exist reports whether the given account address exists in the state. Notably this also returns true for suicided accounts.

func (*AccountDB) FinaliseObject

func (a *AccountDB) FinaliseObject(account string, deleteEmptyObjects bool)

Finalise finalises the state by removing the self destructed objects and clears the journal as well as the refunds.

func (*AccountDB) ForEachStorage

func (a *AccountDB) ForEachStorage(account string, cb func(key, value types.Hash) bool) error

func (*AccountDB) FrozenAccount

func (a *AccountDB) FrozenAccount(account string)

func (*AccountDB) GetAccount

func (a *AccountDB) GetAccount(account string) *accounts.AccountStore

func (*AccountDB) GetBalance

func (a *AccountDB) GetBalance(account string) *big.Int

GetBalance Retrieve the balance from the given address or 0 if object not found

func (*AccountDB) GetCode

func (a *AccountDB) GetCode(account string) []byte

func (*AccountDB) GetCodeSize

func (a *AccountDB) GetCodeSize(account string) int

func (*AccountDB) GetCommittedState

func (a *AccountDB) GetCommittedState(account string, hash types.Hash) types.Hash

func (*AccountDB) GetNonce

func (a *AccountDB) GetNonce(account string) uint64

func (*AccountDB) GetState

func (a *AccountDB) GetState(account string, hash types.Hash) types.Hash

func (*AccountDB) HasSuicided

func (a *AccountDB) HasSuicided(account string) bool

func (*AccountDB) IntermediateRoot

func (a *AccountDB) IntermediateRoot() types.Hash

func (*AccountDB) Reset

func (a *AccountDB) Reset(root types.Hash) error

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 (a *AccountDB) SetAddress(account string, address types.Address)

func (*AccountDB) SetBalance

func (a *AccountDB) SetBalance(account string, amount *big.Int)

func (*AccountDB) SetCode

func (a *AccountDB) SetCode(account string, code []byte)

func (*AccountDB) SetLost

func (a *AccountDB) SetLost(account string, data *accounts.LostStore)

func (*AccountDB) SetNonce

func (a *AccountDB) SetNonce(account string, nonce uint64)

func (*AccountDB) SetPartner

func (a *AccountDB) SetPartner(account string, data accounts.PartnerData)

func (*AccountDB) SetState

func (a *AccountDB) SetState(account string, key, value types.Hash)

func (*AccountDB) SubBalance

func (a *AccountDB) SubBalance(account string, amount *big.Int)

SubBalance subtracts amount from the account associated with addr.

func (*AccountDB) Suicide

func (a *AccountDB) Suicide(account string) bool

func (*AccountDB) UnFrozenAccount

func (a *AccountDB) UnFrozenAccount(account string)

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 NewAccountKVS(root types.Hash, db basedb.Database, journal *basedb.Journal) (*AccountKVS, error)

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 NewAccountMap(root types.Hash, db basedb.Database, journal *basedb.Journal) (*AccountMap, error)

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) CreateMap

func (a *AccountMap) CreateMap(addr types.Address, name string)

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) GetOwner

func (a *AccountMap) GetOwner(addr types.Address) string

func (*AccountMap) IntermediateRoot

func (a *AccountMap) IntermediateRoot() types.Hash

type Code

type Code []byte

func (Code) String

func (c Code) String() string

type Storage

type Storage map[types.Hash]types.Hash

func (Storage) Copy

func (s Storage) Copy() Storage

func (Storage) String

func (s Storage) String() (str string)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL