Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { Address types.Hash `json:"address"` LastTx types.Hash `json:"ltx"` PublicKey types.PublicKey `json:"publicKey"` Balance types.Coin `json:"balance"` }
Account is account information storage structure.
func NewAccount ¶
NewAccount creates a blank account with address. If you want to receive valid information about the status of your account, go to the AccountManager.
type AccountManager ¶
type AccountManager struct {
// contains filtered or unexported fields
}
AccountManager searches and writes account information.
func NewAccountManager ¶
func NewAccountManager(db *leveldb.Db) *AccountManager
NewAccountManager creates a new AccountManager instance. The manager works with the database, the connection of which you will give him.
func (*AccountManager) Commit ¶
func (am *AccountManager) Commit() error
Commit commiting all changes from batch.
func (*AccountManager) Get ¶
func (am *AccountManager) Get(address types.Hash) *Account
Get finds an account in the database or returns a base account if it was not found.
func (*AccountManager) GetByPublicKey ¶
func (am *AccountManager) GetByPublicKey(pub types.PublicKey) *Account
GetByPublicKey converts a public key to an address and delegates authority to the Get method.
func (*AccountManager) Save ¶
func (am *AccountManager) Save(a *Account) error
Save overwrites an account in the database