accounts

package
v1.0.0-rc9 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const NIL_ROOT_KEY = "NIL$ROOT$KEY-"
View Source
const ROOT_OUT_KEY = "ROOT$OUT$KEY-"
View Source
const TKROOT_ROOT_KEY = "TKROOT$ROOT$KEY-"
View Source
const TK_LASTNUM_KEY = "TK$LASTNUM$KEY-"

Variables

This section is empty.

Functions

func Bytes2Key

func Bytes2Key(prefix string, bytes []byte) (ret []byte)

Types

type Account

type Account struct {
	Tk      keys.Uint512
	NextNum uint64
	Token   map[keys.Uint256]*utils.U256
	Ticket  map[keys.Uint256][]keys.Uint256
	// contains filtered or unexported fields
}

func NewAccount

func NewAccount(tk *keys.Uint512, next_num uint64) (ret Account)

func (*Account) AddTicket

func (self *Account) AddTicket(a *assets.Ticket)

func (*Account) AddToken

func (self *Account) AddToken(a *assets.Token)

func (*Account) DelTicket

func (self *Account) DelTicket(a *assets.Ticket)

func (*Account) DelToken

func (self *Account) DelToken(a *assets.Token)

func (*Account) Next

func (self *Account) Next()

type DB

type DB struct {
	// contains filtered or unexported fields
}

func NewDB

func NewDB(dir string) (ret DB)

func (*DB) AddAccount

func (self *DB) AddAccount(tk *keys.Uint512, next_num uint64) (ret bool)

func (*DB) AddNil

func (self *DB) AddNil(batch *leveldb.Batch, del *keys.Uint256) (tkroot TkRoot, out lstate_types.OutState, e error)

func (*DB) AddOut

func (self *DB) AddOut(batch *leveldb.Batch, a *Account, num uint64, root *keys.Uint256, os *localdb.OutState) (ret bool)

func (*DB) AddPkg

func (self *DB) AddPkg(a *Account, pg *localdb.ZPkg) (ret bool)

func (*DB) DB

func (self *DB) DB() (ret *leveldb.DB)

func (*DB) GetAccount

func (self *DB) GetAccount(k *keys.Uint512) (ret Account)

func (*DB) GetOut

func (self *DB) GetOut(root *keys.Uint256) (out lstate_types.OutState, e error)

func (*DB) GetOuts

func (self *DB) GetOuts(tk *keys.Uint512) (outs []*lstate_types.OutState, e error)

func (*DB) SetAccount

func (self *DB) SetAccount(batch *leveldb.Batch, a *Account)

type Out

type Out struct {
	OS localdb.OutState
}

type TkRoot

type TkRoot struct {
	Tk   keys.Uint512
	Root keys.Uint256
}

func NewTkRoot

func NewTkRoot(bytes []byte) (ret TkRoot)

func (*TkRoot) Bytes

func (self *TkRoot) Bytes() (ret []byte)

Jump to

Keyboard shortcuts

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