types

package
v0.29.1-rc0 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAccountDecoder

func GetAccountDecoder(cdc *codec.Codec) auth.AccountDecoder

GetAccountDecoder returns the AccountDecoder function for the custom AppAccount.

Types

type AppAccount

type AppAccount struct {
	auth.BaseAccount

	Name string `json:"name"`
}

AppAccount is a custom extension for this application. It is an example of extending auth.BaseAccount with custom fields. It is compatible with the stock auth.AccountKeeper, since auth.AccountKeeper uses the flexible go-amino library.

func NewAppAccount

func NewAppAccount(name string, baseAcct auth.BaseAccount) *AppAccount

NewAppAccount returns a reference to a new AppAccount given a name and an auth.BaseAccount.

func (AppAccount) GetName

func (acc AppAccount) GetName() string

nolint

func (*AppAccount) SetName

func (acc *AppAccount) SetName(name string)

type GenesisAccount

type GenesisAccount struct {
	Name    string         `json:"name"`
	Address sdk.AccAddress `json:"address"`
	Coins   sdk.Coins      `json:"coins"`
}

GenesisAccount reflects a genesis account the application expects in it's genesis state.

func NewGenesisAccount

func NewGenesisAccount(aa *AppAccount) *GenesisAccount

NewGenesisAccount returns a reference to a new GenesisAccount given an AppAccount.

func (*GenesisAccount) ToAppAccount

func (ga *GenesisAccount) ToAppAccount() (acc *AppAccount, err error)

ToAppAccount converts a GenesisAccount to an AppAccount.

type GenesisState

type GenesisState struct {
	Accounts []*GenesisAccount `json:"accounts"`
}

GenesisState reflects the genesis state of the application.

Jump to

Keyboard shortcuts

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