auth

package
v0.37.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2019 License: Apache-2.0 Imports: 24 Imported by: 3,544

Documentation

Overview

nolint autogenerated code using github.com/rigelrozanski/multitool aliases generated for the following subdirectories: ALIASGEN: github.com/cosmos/cosmos-sdk/x/auth/types

nolint

Index

Constants

View Source
const (
	ModuleName                    = types.ModuleName
	StoreKey                      = types.StoreKey
	FeeCollectorName              = types.FeeCollectorName
	QuerierRoute                  = types.QuerierRoute
	DefaultParamspace             = types.DefaultParamspace
	DefaultMaxMemoCharacters      = types.DefaultMaxMemoCharacters
	DefaultTxSigLimit             = types.DefaultTxSigLimit
	DefaultTxSizeCostPerByte      = types.DefaultTxSizeCostPerByte
	DefaultSigVerifyCostED25519   = types.DefaultSigVerifyCostED25519
	DefaultSigVerifyCostSecp256k1 = types.DefaultSigVerifyCostSecp256k1
	QueryAccount                  = types.QueryAccount
)

Variables

View Source
var (
	// functions aliases
	NewBaseAccount                 = types.NewBaseAccount
	ProtoBaseAccount               = types.ProtoBaseAccount
	NewBaseAccountWithAddress      = types.NewBaseAccountWithAddress
	NewBaseVestingAccount          = types.NewBaseVestingAccount
	NewContinuousVestingAccountRaw = types.NewContinuousVestingAccountRaw
	NewContinuousVestingAccount    = types.NewContinuousVestingAccount
	NewDelayedVestingAccountRaw    = types.NewDelayedVestingAccountRaw
	NewDelayedVestingAccount       = types.NewDelayedVestingAccount
	RegisterCodec                  = types.RegisterCodec
	NewGenesisState                = types.NewGenesisState
	DefaultGenesisState            = types.DefaultGenesisState
	ValidateGenesis                = types.ValidateGenesis
	AddressStoreKey                = types.AddressStoreKey
	NewParams                      = types.NewParams
	ParamKeyTable                  = types.ParamKeyTable
	DefaultParams                  = types.DefaultParams
	NewQueryAccountParams          = types.NewQueryAccountParams
	NewStdTx                       = types.NewStdTx
	CountSubKeys                   = types.CountSubKeys
	NewStdFee                      = types.NewStdFee
	StdSignBytes                   = types.StdSignBytes
	DefaultTxDecoder               = types.DefaultTxDecoder
	DefaultTxEncoder               = types.DefaultTxEncoder
	NewTxBuilder                   = types.NewTxBuilder
	NewTxBuilderFromCLI            = types.NewTxBuilderFromCLI
	MakeSignature                  = types.MakeSignature
	NewAccountRetriever            = types.NewAccountRetriever

	// variable aliases
	ModuleCdc                 = types.ModuleCdc
	AddressStoreKeyPrefix     = types.AddressStoreKeyPrefix
	GlobalAccountNumberKey    = types.GlobalAccountNumberKey
	KeyMaxMemoCharacters      = types.KeyMaxMemoCharacters
	KeyTxSigLimit             = types.KeyTxSigLimit
	KeyTxSizeCostPerByte      = types.KeyTxSizeCostPerByte
	KeySigVerifyCostED25519   = types.KeySigVerifyCostED25519
	KeySigVerifyCostSecp256k1 = types.KeySigVerifyCostSecp256k1
)

Functions

func DeductFees

func DeductFees(supplyKeeper types.SupplyKeeper, ctx sdk.Context, acc Account, fees sdk.Coins) sdk.Result

DeductFees deducts fees from the given account.

NOTE: We could use the CoinKeeper (in addition to the AccountKeeper, because the CoinKeeper doesn't give us accounts), but it seems easier to do this.

func DefaultSigVerificationGasConsumer

func DefaultSigVerificationGasConsumer(
	meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params Params,
) sdk.Result

DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas for signature verification based upon the public key type. The cost is fetched from the given params and is matched by the concrete type.

func EnsureSufficientMempoolFees added in v0.30.0

func EnsureSufficientMempoolFees(ctx sdk.Context, stdFee StdFee) sdk.Result

EnsureSufficientMempoolFees verifies that the given transaction has supplied enough fees to cover a proposer's minimum fees. A result object is returned indicating success or failure.

Contract: This should only be called during CheckTx as it cannot be part of consensus.

func GetSignBytes added in v0.30.0

func GetSignBytes(chainID string, stdTx StdTx, acc Account, genesis bool) []byte

GetSignBytes returns a slice of bytes to sign over for a given transaction and an account.

func InitGenesis

func InitGenesis(ctx sdk.Context, ak AccountKeeper, data GenesisState)

InitGenesis - Init store state from genesis data

CONTRACT: old coins from the FeeCollectionKeeper need to be transferred through a genesis port script to the new fee collector account

func NewAnteHandler

func NewAnteHandler(ak AccountKeeper, supplyKeeper types.SupplyKeeper, sigGasConsumer SignatureVerificationGasConsumer) sdk.AnteHandler

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

func NewQuerier

func NewQuerier(keeper AccountKeeper) sdk.Querier

creates a querier for auth REST endpoints

func ProcessPubKey added in v0.30.0

func ProcessPubKey(acc Account, sig StdSignature, simulate bool) (crypto.PubKey, sdk.Result)

ProcessPubKey verifies that the given account address matches that of the StdSignature. In addition, it will set the public key of the account if it has not been set.

func SetGasMeter

func SetGasMeter(simulate bool, ctx sdk.Context, gasLimit uint64) sdk.Context

SetGasMeter returns a new context with a gas meter set from a given context.

func ValidateMemo added in v0.30.0

func ValidateMemo(stdTx StdTx, params Params) sdk.Result

ValidateMemo validates the memo size.

func ValidateSigCount added in v0.36.0

func ValidateSigCount(stdTx StdTx, params Params) sdk.Result

ValidateSigCount validates that the transaction has a valid cumulative total amount of signatures.

Types

type Account added in v0.18.0

type Account = exported.Account

func GetSignerAcc

func GetSignerAcc(ctx sdk.Context, ak AccountKeeper, addr sdk.AccAddress) (Account, sdk.Result)

GetSignerAcc returns an account for a given address that is expected to sign a transaction.

type AccountKeeper

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

AccountKeeper encodes/decodes accounts using the go-amino (binary) encoding/decoding library.

func NewAccountKeeper

func NewAccountKeeper(
	cdc *codec.Codec, key sdk.StoreKey, paramstore subspace.Subspace, proto func() exported.Account,
) AccountKeeper

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

func (AccountKeeper) GetAccount added in v0.25.0

func (ak AccountKeeper) GetAccount(ctx sdk.Context, addr sdk.AccAddress) exported.Account

GetAccount implements sdk.AccountKeeper.

func (AccountKeeper) GetAllAccounts added in v0.32.0

func (ak AccountKeeper) GetAllAccounts(ctx sdk.Context) []exported.Account

GetAllAccounts returns all accounts in the accountKeeper.

func (AccountKeeper) GetNextAccountNumber added in v0.25.0

func (ak AccountKeeper) GetNextAccountNumber(ctx sdk.Context) uint64

GetNextAccountNumber Returns and increments the global account number counter

func (AccountKeeper) GetParams added in v0.30.0

func (ak AccountKeeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the auth module's parameters.

func (AccountKeeper) GetPubKey added in v0.25.0

func (ak AccountKeeper) GetPubKey(ctx sdk.Context, addr sdk.AccAddress) (crypto.PubKey, sdk.Error)

GetPubKey Returns the PubKey of the account at address

func (AccountKeeper) GetSequence added in v0.25.0

func (ak AccountKeeper) GetSequence(ctx sdk.Context, addr sdk.AccAddress) (uint64, sdk.Error)

GetSequence Returns the Sequence of the account at address

func (AccountKeeper) IterateAccounts added in v0.25.0

func (ak AccountKeeper) IterateAccounts(ctx sdk.Context, process func(exported.Account) (stop bool))

IterateAccounts implements sdk.AccountKeeper.

func (AccountKeeper) Logger added in v0.36.0

func (ak AccountKeeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (AccountKeeper) NewAccount added in v0.25.0

func (ak AccountKeeper) NewAccount(ctx sdk.Context, acc exported.Account) exported.Account

NewAccount creates a new account

func (AccountKeeper) NewAccountWithAddress added in v0.25.0

func (ak AccountKeeper) NewAccountWithAddress(ctx sdk.Context, addr sdk.AccAddress) exported.Account

NewAccountWithAddress implements sdk.AccountKeeper.

func (AccountKeeper) RemoveAccount added in v0.25.0

func (ak AccountKeeper) RemoveAccount(ctx sdk.Context, acc exported.Account)

RemoveAccount removes an account for the account mapper store. NOTE: this will cause supply invariant violation if called

func (AccountKeeper) SetAccount added in v0.25.0

func (ak AccountKeeper) SetAccount(ctx sdk.Context, acc exported.Account)

SetAccount implements sdk.AccountKeeper.

func (AccountKeeper) SetParams added in v0.30.0

func (ak AccountKeeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the auth module's parameters.

type AppModule

type AppModule struct {
	AppModuleBasic
	// contains filtered or unexported fields
}

___________________________ app module object

func NewAppModule

func NewAppModule(accountKeeper AccountKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock

func (AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock)

module begin-block

func (AppModule) EndBlock

module end-block

func (AppModule) ExportGenesis

func (am AppModule) ExportGenesis(ctx sdk.Context) json.RawMessage

module export genesis

func (AppModule) InitGenesis

func (am AppModule) InitGenesis(ctx sdk.Context, data json.RawMessage) []abci.ValidatorUpdate

module init-genesis

func (AppModule) Name

func (AppModule) Name() string

module name

func (AppModule) NewHandler

func (AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

register invariants

func (AppModule) Route

func (AppModule) Route() string

module message route name

type AppModuleBasic

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd

func (AppModuleBasic) GetQueryCmd(cdc *codec.Codec) *cobra.Command

get the root query command of this module

func (AppModuleBasic) GetTxCmd

func (AppModuleBasic) GetTxCmd(cdc *codec.Codec) *cobra.Command

get the root tx command of this module

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec

func (AppModuleBasic) RegisterCodec(cdc *codec.Codec)

register module codec

func (AppModuleBasic) RegisterRESTRoutes

func (AppModuleBasic) RegisterRESTRoutes(ctx context.CLIContext, rtr *mux.Router)

register rest routes

func (AppModuleBasic) ValidateGenesis

func (AppModuleBasic) ValidateGenesis(bz json.RawMessage) error

module validate genesis

type BaseAccount

type BaseAccount = types.BaseAccount

type BaseVestingAccount added in v0.30.0

type BaseVestingAccount = types.BaseVestingAccount

type ContinuousVestingAccount added in v0.30.0

type ContinuousVestingAccount = types.ContinuousVestingAccount

type DelayedVestingAccount added in v0.30.0

type DelayedVestingAccount = types.DelayedVestingAccount

type DummySupplyKeeper added in v0.36.0

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

DummySupplyKeeper defines a supply keeper used only for testing to avoid circle dependencies

func NewDummySupplyKeeper added in v0.36.0

func NewDummySupplyKeeper(ak AccountKeeper) DummySupplyKeeper

NewDummySupplyKeeper creates a DummySupplyKeeper instance

func (DummySupplyKeeper) GetModuleAccount added in v0.36.0

func (sk DummySupplyKeeper) GetModuleAccount(ctx sdk.Context, moduleName string) exported.ModuleAccountI

GetModuleAccount for dummy supply keeper

func (DummySupplyKeeper) GetModuleAddress added in v0.36.0

func (sk DummySupplyKeeper) GetModuleAddress(moduleName string) sdk.AccAddress

GetModuleAddress for dummy supply keeper

func (DummySupplyKeeper) SendCoinsFromAccountToModule added in v0.36.0

func (sk DummySupplyKeeper) SendCoinsFromAccountToModule(ctx sdk.Context, fromAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error

SendCoinsFromAccountToModule for the dummy supply keeper

type GenesisState

type GenesisState = types.GenesisState

func ExportGenesis

func ExportGenesis(ctx sdk.Context, ak AccountKeeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper

type Params

type Params = types.Params

type QueryAccountParams

type QueryAccountParams = types.QueryAccountParams

type SignatureVerificationGasConsumer

type SignatureVerificationGasConsumer = func(meter sdk.GasMeter, sig []byte, pubkey crypto.PubKey, params Params) sdk.Result

SignatureVerificationGasConsumer is the type of function that is used to both consume gas when verifying signatures and also to accept or reject different types of PubKey's. This is where apps can define their own PubKey

type StdFee

type StdFee = types.StdFee

type StdSignDoc

type StdSignDoc = types.StdSignDoc

type StdSignMsg

type StdSignMsg = types.StdSignMsg

type StdSignature

type StdSignature = types.StdSignature

type StdTx

type StdTx = types.StdTx

type TxBuilder

type TxBuilder = types.TxBuilder

type VestingAccount added in v0.30.0

type VestingAccount = exported.VestingAccount

Directories

Path Synopsis
client
cli
legacy
v0_34
DONTCOVER nolint
DONTCOVER nolint
v0_36
DONTCOVER nolint DONTCOVER nolint
DONTCOVER nolint DONTCOVER nolint
nolint noalias
nolint noalias

Jump to

Keyboard shortcuts

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