auth

package
v0.17.3 Latest Latest
Warning

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

Go to latest
Published: May 29, 2018 License: Apache-2.0 Imports: 8 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BurnFeeHandler added in v0.15.0

func BurnFeeHandler(ctx sdk.Context, tx sdk.Tx, fee sdk.Coins)

BurnFeeHandler burns all fees (decreasing total supply)

func GetSigners

func GetSigners(ctx types.Context) []types.Account

get the signers from the context

func NewAccountMapper

func NewAccountMapper(cdc *wire.Codec, key sdk.StoreKey, proto sdk.Account) accountMapper

NewAccountMapper returns a new sdk.AccountMapper that uses go-amino to (binary) encode and decode concrete sdk.Accounts. nolint

func NewAnteHandler

func NewAnteHandler(accountMapper sdk.AccountMapper, feeHandler sdk.FeeHandler) sdk.AnteHandler

NewAnteHandler returns an AnteHandler that checks and increments sequence numbers, checks signatures, and deducts fees from the first signer.

func RegisterBaseAccount added in v0.15.0

func RegisterBaseAccount(cdc *wire.Codec)

Most users shouldn't use this, but this comes handy for tests.

func RegisterWire added in v0.16.0

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec for default AppAccount

func WithSigners

func WithSigners(ctx types.Context, accounts []types.Account) types.Context

add the signers to the context

Types

type BaseAccount

type BaseAccount struct {
	Address  sdk.Address   `json:"address"`
	Coins    sdk.Coins     `json:"coins"`
	PubKey   crypto.PubKey `json:"public_key"`
	Sequence int64         `json:"sequence"`
}

BaseAccount - base account structure. Extend this by embedding this in your AppAccount. See the examples/basecoin/types/account.go for an example.

func NewBaseAccountWithAddress

func NewBaseAccountWithAddress(addr sdk.Address) BaseAccount

func (BaseAccount) GetAddress

func (acc BaseAccount) GetAddress() sdk.Address

Implements sdk.Account.

func (*BaseAccount) GetCoins

func (acc *BaseAccount) GetCoins() sdk.Coins

Implements sdk.Account.

func (BaseAccount) GetPubKey

func (acc BaseAccount) GetPubKey() crypto.PubKey

Implements sdk.Account.

func (*BaseAccount) GetSequence

func (acc *BaseAccount) GetSequence() int64

Implements sdk.Account.

func (*BaseAccount) SetAddress

func (acc *BaseAccount) SetAddress(addr sdk.Address) error

Implements sdk.Account.

func (*BaseAccount) SetCoins

func (acc *BaseAccount) SetCoins(coins sdk.Coins) error

Implements sdk.Account.

func (*BaseAccount) SetPubKey

func (acc *BaseAccount) SetPubKey(pubKey crypto.PubKey) error

Implements sdk.Account.

func (*BaseAccount) SetSequence

func (acc *BaseAccount) SetSequence(seq int64) error

Implements sdk.Account.

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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