authx

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2019 License: BSD-2-Clause Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreKey      = types.StoreKey
	QuerierRoute  = types.QuerierRoute
	ModuleName    = types.ModuleName
	QueryAccountX = types.QueryAccountX

	CodeSpaceAuthX     = types.CodeSpaceAuthX
	CodeGasPriceTooLow = types.CodeGasPriceTooLow

	DefaultParamspace       = types.DefaultParamspace
	DefaultMinGasPriceLimit = types.DefaultMinGasPriceLimit
)

Variables

View Source
var (
	ErrInvalidMinGasPriceLimit = types.ErrInvalidMinGasPriceLimit
	ErrGasPriceTooLow          = types.ErrGasPriceTooLow
	NewLockedCoin              = types.NewLockedCoin
	NewParams                  = types.NewParams
	NewAccountX                = types.NewAccountX
	DefaultParams              = types.DefaultParams
)
View Source
var (
	// AddressStoreKeyPrefix prefix for accountx-by-address store
	AddressStoreKeyPrefix = []byte{0x01}

	PrefixUnlockedCoinsQueue = []byte("UnlockedCoinsQueue")
	KeyDelimiter             = []byte(";")
)

Functions

func AddressStoreKey

func AddressStoreKey(addr sdk.AccAddress) []byte

func EndBlocker

func EndBlocker(ctx sdk.Context, aux AccountXKeeper, keeper ExpectedAccountKeeper, tk ExpectedTokenKeeper)

func InitGenesis

func InitGenesis(ctx sdk.Context, keeper AccountXKeeper, data GenesisState)

InitGenesis - Init store state from genesis data

func KeyUnlockedCoinsQueue

func KeyUnlockedCoinsQueue(unlockedTime int64, address sdk.AccAddress) []byte

func NewAnteHandler

func NewAnteHandler(ak auth.AccountKeeper, supplyKeeper authtypes.SupplyKeeper,
	axk AccountXKeeper, anteHelper AnteHelper) 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 AccountXKeeper) sdk.Querier

creates a querier for auth REST endpoints

func PreTotalSupplyInvariant added in v0.0.4

func PreTotalSupplyInvariant(k AccountXKeeper) sdk.Invariant

func PrefixUnlockedTimeQueueTime

func PrefixUnlockedTimeQueueTime(unlockedTime int64) []byte

func WrapAnteHandler added in v0.0.4

func WrapAnteHandler(ah sdk.AnteHandler,
	axk AccountXKeeper, anteHelper AnteHelper) sdk.AnteHandler

Types

type AccountX

type AccountX = types.AccountX

type AccountXKeeper

type AccountXKeeper struct {
	EventTypeMsgQueue string
	// contains filtered or unexported fields
}

func NewKeeper

func NewKeeper(cdc *codec.Codec, key sdk.StoreKey, paramSubspace params.Subspace, keeper SupplyKeeper, ak ExpectedAccountKeeper, eventTypeMsgQueue string) AccountXKeeper

func (AccountXKeeper) GetAccountX

func (axk AccountXKeeper) GetAccountX(ctx sdk.Context, addr sdk.AccAddress) (ax types.AccountX, ok bool)

func (AccountXKeeper) GetOrCreateAccountX

func (axk AccountXKeeper) GetOrCreateAccountX(ctx sdk.Context, addr sdk.AccAddress) types.AccountX

func (AccountXKeeper) GetParams

func (axk AccountXKeeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams gets the asset module's parameters.

func (AccountXKeeper) InsertUnlockedCoinsQueue

func (axk AccountXKeeper) InsertUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)

func (AccountXKeeper) IterateAccounts

func (axk AccountXKeeper) IterateAccounts(ctx sdk.Context, process func(types.AccountX) (stop bool))

func (AccountXKeeper) PreTotalSupply added in v0.0.4

func (axk AccountXKeeper) PreTotalSupply(ctx sdk.Context)

----------------------------------------------------------------------------- PreTotalSupply sets the Authx Module Account

func (AccountXKeeper) RemoveFromUnlockedCoinsQueue

func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueue(ctx sdk.Context, unlockedTime int64, address sdk.AccAddress)

func (AccountXKeeper) RemoveFromUnlockedCoinsQueueByKey

func (axk AccountXKeeper) RemoveFromUnlockedCoinsQueueByKey(ctx sdk.Context, key []byte)

func (AccountXKeeper) SetAccountX

func (axk AccountXKeeper) SetAccountX(ctx sdk.Context, ax types.AccountX)

func (AccountXKeeper) SetParams

func (axk AccountXKeeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the asset module's parameters.

func (AccountXKeeper) UnlockedCoinsQueueIterator

func (axk AccountXKeeper) UnlockedCoinsQueueIterator(ctx sdk.Context, unlockedTime int64) sdk.Iterator

type AnteHelper

type AnteHelper interface {
	CheckMsg(ctx sdk.Context, msg sdk.Msg, memo string) sdk.Error
}

type AppModule added in v0.0.4

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

___________________________ app module object

func NewAppModule added in v0.0.4

func NewAppModule(axk AccountXKeeper, tk ExpectedTokenKeeper) AppModule

NewAppModule creates a new AppModule object

func (AppModule) BeginBlock added in v0.0.4

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

module begin-block

func (AppModule) EndBlock added in v0.0.4

module end-block

func (AppModule) ExportGenesis added in v0.0.4

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

module export genesis

func (AppModule) InitGenesis added in v0.0.4

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

module init-genesis

func (AppModule) Name added in v0.0.4

func (AppModule) Name() string

module name

func (AppModule) NewHandler added in v0.0.4

func (am AppModule) NewHandler() sdk.Handler

module handler

func (AppModule) NewQuerierHandler added in v0.0.4

func (am AppModule) NewQuerierHandler() sdk.Querier

module querier

func (AppModule) QuerierRoute added in v0.0.4

func (AppModule) QuerierRoute() string

module querier route name

func (AppModule) RegisterInvariants added in v0.0.4

func (AppModule) RegisterInvariants(_ sdk.InvariantRegistry)

register invariants

func (AppModule) Route added in v0.0.4

func (AppModule) Route() string

module message route name

type AppModuleBasic added in v0.0.4

type AppModuleBasic struct{}

app module basics object

func (AppModuleBasic) DefaultGenesis added in v0.0.4

func (AppModuleBasic) DefaultGenesis() json.RawMessage

default genesis state

func (AppModuleBasic) GetQueryCmd added in v0.0.4

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

get the root query command of this module

func (AppModuleBasic) GetTxCmd added in v0.0.4

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

get the root tx command of this module

func (AppModuleBasic) Name added in v0.0.4

func (AppModuleBasic) Name() string

module name

func (AppModuleBasic) RegisterCodec added in v0.0.4

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

register module codec

func (AppModuleBasic) RegisterRESTRoutes added in v0.0.4

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

register rest routes

func (AppModuleBasic) ValidateGenesis added in v0.0.4

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

module validate genesis

type ExpectedAccountKeeper added in v0.0.4

type ExpectedAccountKeeper interface {
	GetAccount(ctx sdk.Context, addr sdk.AccAddress) auth.Account
	SetAccount(ctx sdk.Context, acc auth.Account)
}

type ExpectedTokenKeeper added in v0.0.4

type ExpectedTokenKeeper interface {
	UpdateTokenSendLock(ctx sdk.Context, symbol string, amount sdk.Int, lock bool) sdk.Error
}

type GenesisState

type GenesisState struct {
	Params    types.Params    `json:"params"`
	AccountXs types.AccountXs `json:"accountxs"`
}

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState - Return a default genesis state

func ExportGenesis

func ExportGenesis(ctx sdk.Context, keeper AccountXKeeper) GenesisState

ExportGenesis returns a GenesisState for a given context and keeper

func NewGenesisState

func NewGenesisState(params types.Params, accountXs types.AccountXs) GenesisState

func (GenesisState) ValidateGenesis added in v0.0.4

func (data GenesisState) ValidateGenesis() error

ValidateGenesis performs basic validation of asset genesis data returning an error for any failed validation criteria.

type LockedCoin

type LockedCoin = types.LockedCoin

type LockedCoins

type LockedCoins = types.LockedCoins

type NotificationUnlock added in v0.0.4

type NotificationUnlock struct {
	Address     sdk.AccAddress    `json:"address" yaml:"address"`
	Unlocked    sdk.Coins         `json:"unlocked"`
	LockedCoins types.LockedCoins `json:"locked_coins"`
	FrozenCoins sdk.Coins         `json:"frozen_coins"`
	Coins       sdk.Coins         `json:"coins" yaml:"coins"`
	Height      int64             `json:"height"`
}

type SupplyKeeper added in v0.0.4

type SupplyKeeper interface {
	GetModuleAddress(name string) sdk.AccAddress
	GetModuleAccount(ctx sdk.Context, moduleName string) supply.ModuleAccountI
	SetModuleAccount(ctx sdk.Context, macc supply.ModuleAccountI)
	//SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) sdk.Error
	SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) sdk.Error
}

SupplyKeeper defines the expected supply keeper (noalias)

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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