model

package
v0.6.11 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AccountInfoSubstore   = []byte{0x00}
	AccountBankSubstore   = []byte{0x01}
	AccountMetaSubstore   = []byte{0x02}
	AccountPoolSubstore   = []byte{0x04}
	AccountSupplySubstore = []byte{0x05}
)

Functions

func GetAccountBankKey

func GetAccountBankKey(addr sdk.Address) []byte

GetAccountBankKey - "account bank substore" + "username"

func GetAccountInfoKey

func GetAccountInfoKey(accKey linotypes.AccountKey) []byte

GetAccountInfoKey - "account info substore" + "username"

func GetAccountInfoPrefix added in v0.1.1

func GetAccountInfoPrefix() []byte

GetAccountInfoPrefix - "account info substore"

func GetAccountMetaKey

func GetAccountMetaKey(accKey linotypes.AccountKey) []byte

GetAccountMetaKey - "account meta substore" + "username"

func GetAccountPoolKey added in v0.6.0

func GetAccountPoolKey(poolname linotypes.PoolName) []byte

GetAccountPoolKey - "AccountPoolSubstore" + "pool name"

func GetAccountSupplyKey added in v0.6.0

func GetAccountSupplyKey() []byte

GetAccountSupplyKey - AccountSupplySubstore

func NewAccountDumper added in v0.6.0

func NewAccountDumper(store AccountStorage) *testutils.Dumper

Types

type AccountBank

type AccountBank struct {
	Saving          types.Coin       `json:"saving"`
	FrozenMoneyList []FrozenMoney    `json:"frozen_money_list"`
	PubKey          crypto.PubKey    `json:"public_key"`
	Sequence        uint64           `json:"sequence"`
	Username        types.AccountKey `json:"username"`
}

AccountBank - user balance

type AccountBankIR added in v0.4.0

type AccountBankIR struct {
	Address         []byte           `json:"address"` // pk
	Saving          types.Coin       `json:"saving"`
	FrozenMoneyList []FrozenMoneyIR  `json:"frozen_money_list"`
	PubKey          crypto.PubKey    `json:"public_key"`
	Sequence        uint64           `json:"sequence"`
	Username        types.AccountKey `json:"username"`
}

AccountBankIR - user balance

type AccountIR added in v0.4.0

type AccountIR struct {
	Username       types.AccountKey `json:"username"`
	CreatedAt      int64            `json:"created_at"`
	SigningKey     crypto.PubKey    `json:"signing_key"`
	TransactionKey crypto.PubKey    `json:"transaction_key"`
	Address        sdk.AccAddress   `json:"address"`
}

AccountIR account related information when migrate, pk: Username

type AccountInfo

type AccountInfo struct {
	Username       types.AccountKey `json:"username"`
	CreatedAt      int64            `json:"created_at"`
	SigningKey     crypto.PubKey    `json:"signing_key"`
	TransactionKey crypto.PubKey    `json:"transaction_key"`
	Address        sdk.AccAddress   `json:"address"`
}

AccountInfo - user information

type AccountMeta

type AccountMeta struct {
	JSONMeta string `json:"json_meta"`
}

AccountMeta - stores optional fields.

type AccountMetaIR added in v0.4.0

type AccountMetaIR struct {
	Username types.AccountKey `json:"username"`
	JSONMeta string           `json:"json_meta"`
}

AccountMetaIR - stores optional fields.

type AccountStorage

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

AccountStorage - account storage

func NewAccountStorage

func NewAccountStorage(key sdk.StoreKey) AccountStorage

NewLinoAccountStorage - creates and returns a account manager

func (AccountStorage) DoesAccountExist

func (as AccountStorage) DoesAccountExist(ctx sdk.Context, accKey linotypes.AccountKey) bool

DoesAccountExist - returns true when a specific account exist in the KVStore.

func (AccountStorage) GetBank added in v0.3.0

func (as AccountStorage) GetBank(ctx sdk.Context, addr sdk.Address) (*AccountBank, sdk.Error)

GetBank - returns bank info of a specific address, returns error if any.

func (AccountStorage) GetInfo

func (as AccountStorage) GetInfo(ctx sdk.Context, accKey linotypes.AccountKey) (*AccountInfo, sdk.Error)

GetInfo - returns general account info of a specific account, returns error otherwise.

func (AccountStorage) GetMeta

func (as AccountStorage) GetMeta(ctx sdk.Context, accKey linotypes.AccountKey) *AccountMeta

GetMeta - returns meta of a given account that are tiny and frequently updated fields.

func (AccountStorage) GetPool added in v0.6.0

func (as AccountStorage) GetPool(ctx sdk.Context, name linotypes.PoolName) (*Pool, sdk.Error)

func (AccountStorage) GetSupply added in v0.6.0

func (as AccountStorage) GetSupply(ctx sdk.Context) *Supply

func (AccountStorage) PartialStoreMap added in v0.6.0

func (as AccountStorage) PartialStoreMap(ctx sdk.Context) utils.StoreMap

func (AccountStorage) SetBank added in v0.3.0

func (as AccountStorage) SetBank(ctx sdk.Context, addr sdk.Address, accBank *AccountBank)

SetBank - sets bank info for a given address, returns error if any.

func (AccountStorage) SetInfo

func (as AccountStorage) SetInfo(ctx sdk.Context, accInfo *AccountInfo)

SetInfo - sets general account info to a specific account, returns error if any.

func (AccountStorage) SetMeta

func (as AccountStorage) SetMeta(ctx sdk.Context, accKey linotypes.AccountKey, accMeta *AccountMeta)

SetMeta - sets meta for a given account, returns error if any.

func (AccountStorage) SetPool added in v0.6.0

func (as AccountStorage) SetPool(ctx sdk.Context, pool *Pool)

func (AccountStorage) SetSupply added in v0.6.0

func (as AccountStorage) SetSupply(ctx sdk.Context, supply *Supply)

type AccountTablesIR added in v0.2.0

type AccountTablesIR struct {
	Version  int             `json:"version"`
	Accounts []AccountIR     `json:"accounts"`
	Banks    []AccountBankIR `json:"banks"`
	Metas    []AccountMetaIR `json:"metas"`
	Pools    []PoolIR        `json:"pools"`
	Supply   SupplyIR        `json:"supply"`
}

AccountTablesIR -

type FrozenMoney

type FrozenMoney struct {
	Amount   types.Coin `json:"amount"`
	StartAt  int64      `json:"start_at"`
	Times    int64      `json:"times"`
	Interval int64      `json:"interval"`
}

FrozenMoney - frozen money

type FrozenMoneyIR added in v0.4.0

type FrozenMoneyIR struct {
	Amount   types.Coin `json:"amount"`
	StartAt  int64      `json:"start_at"`
	Times    int64      `json:"times"`
	Interval int64      `json:"interval"`
}

FrozenMoneyIR - frozen money

type Pool added in v0.6.0

type Pool struct {
	Name    types.PoolName `json:"name"`
	Balance types.Coin     `json:"balance"`
}

Pool - the pool for modules

type PoolIR added in v0.6.0

type PoolIR struct {
	Name    types.PoolName `json:"name"`
	Balance types.Coin     `json:"balance"`
}

PoolIR - the module account.

type Supply added in v0.6.0

type Supply struct {
	LastYearTotal     types.Coin `json:"last_year_total"`
	Total             types.Coin `json:"total"`
	ChainStartTime    int64      `json:"chain_start_time"`
	LastInflationTime int64      `json:"last_inflation_time"`
}

Supply - stats of lino supply.

type SupplyIR added in v0.6.0

type SupplyIR struct {
	LastYearTotal     types.Coin `json:"last_year_total"`
	Total             types.Coin `json:"total"`
	ChainStartTime    int64      `json:"chain_start_time"`
	LastInflationTime int64      `json:"last_inflation_time"`
}

SupplyIR - stats of lino supply.

type Transaction added in v0.2.8

type Transaction struct {
	Hash   string    `json:"hash"`
	Height int64     `json:"height"`
	Tx     ttypes.Tx `json:"tx"`
	Code   uint32    `json:"code"`
	Log    string    `json:"log"`
}

type TxAndSequenceNumber added in v0.2.8

type TxAndSequenceNumber struct {
	Username string       `json:"username"`
	Sequence uint64       `json:"sequence"`
	Tx       *Transaction `json:"tx"`
}

Jump to

Keyboard shortcuts

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