account

package
v0.0.0-...-4502c18 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2018 License: GPL-3.0 Imports: 3 Imported by: 3

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

func NewAccount(address types.Hash) *Account

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

Jump to

Keyboard shortcuts

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