distribution

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2019 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StoreKey          = ModuleName
	RouterKey         = ModuleName
	QuerierRoute      = ModuleName
	DefaultParamspace = ModuleName

	UserGrowthPoolName = "user_growth_tokens_pool"
	UserRewardPoolName = "user_reward_tokens_pool"
)

Defines auth module constants

View Source
const ModuleName = "trudistribution"

ModuleName is the name of this module

Variables

View Source
var (
	KeyUserGrowthAllocation  = []byte("userGrowthAllocation")
	KeyUserRewardAllocation  = []byte("userRewardAllocation")
	KeyStakeholderAllocation = []byte("stakeholderAllocation")
)

Keys for params

View Source
var ModuleCodec *codec.Codec

ModuleCodec encodes module codec

Functions

func BeginBlocker

func BeginBlocker(ctx sdk.Context, keeper Keeper)

BeginBlocker called every block, process expiring stakes

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)

InitGenesis initializes state from genesis file

func ParamKeyTable

func ParamKeyTable() params.KeyTable

ParamKeyTable for auth module

func ValidateGenesis

func ValidateGenesis(data GenesisState) error

ValidateGenesis validates the genesis state data

Types

type AppModule

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

AppModule defines external data for the module ----------------------------------------------------------------------------

func NewAppModule

func NewAppModule(keeper Keeper) AppModule

NewAppModule creates a NewAppModule object

func (AppModule) BeginBlock

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

BeginBlock returns the begin blocker for the supply module.

func (AppModule) EndBlock

EndBlock returns the end blocker for the supply module. It returns no validator updates.

func (AppModule) ExportGenesis

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

ExportGenesis enforces exporting this module's data to a genesis file

func (AppModule) InitGenesis

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

InitGenesis enforces the creation of the genesis state for the staking module

func (AppModule) NewHandler

func (am AppModule) NewHandler() sdk.Handler

NewHandler creates the handler for the staking module

func (AppModule) NewQuerierHandler

func (am AppModule) NewQuerierHandler() sdk.Querier

NewQuerierHandler creates a new querier handler

func (AppModule) QuerierRoute

func (AppModule) QuerierRoute() string

QuerierRoute defines the querier route

func (AppModule) RegisterInvariants

func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry)

RegisterInvariants enforces registering of invariants

func (AppModule) Route

func (AppModule) Route() string

Route defines the key for the route

type AppModuleBasic

type AppModuleBasic struct{}

AppModuleBasic defines the internal data for the module ----------------------------------------------------------------------------

func (AppModuleBasic) DefaultGenesis

func (AppModuleBasic) DefaultGenesis() json.RawMessage

DefaultGenesis creates the default genesis state for testing

func (AppModuleBasic) GetQueryCmd

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

GetQueryCmd returns no root query command for the staking module.

func (AppModuleBasic) GetTxCmd

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

GetTxCmd returns the root tx command for the staking module.

func (AppModuleBasic) Name

func (AppModuleBasic) Name() string

Name define the name of the module

func (AppModuleBasic) RegisterCodec

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

RegisterCodec registers the types needed for amino encoding/decoding

func (AppModuleBasic) RegisterRESTRoutes

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

RegisterRESTRoutes registers the REST routes for the staking module.

func (AppModuleBasic) ValidateGenesis

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

ValidateGenesis validates the genesis state

type BankKeeper

type BankKeeper interface {
	AddCoin(ctx sdk.Context, addr sdk.AccAddress, amt sdk.Coin,
		referenceID uint64, txType bankexported.TransactionType, setters ...bankexported.TransactionSetter) (sdk.Coins, sdk.Error)

	IterateUserTransactions(ctx sdk.Context, creator sdk.AccAddress, reverse bool, cb func(transaction bankexported.Transaction) (stop bool))
}

BankKeeper is the expected bank keeper interface for this module

type GenesisState

type GenesisState struct {
	Params Params `json:"params"`
}

GenesisState defines genesis data for the module

func DefaultGenesisState

func DefaultGenesisState() GenesisState

DefaultGenesisState returns a default genesis state

func ExportGenesis

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

ExportGenesis exports the genesis state

func NewGenesisState

func NewGenesisState(params Params) GenesisState

NewGenesisState creates a new genesis state.

type Keeper

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

Keeper data type storing keys to the KVStore

func NewKeeper

func NewKeeper(storeKey sdk.StoreKey, paramStore params.Subspace, codec *codec.Codec, bankKeeper BankKeeper,
	accountKeeper auth.AccountKeeper, supplyKeeper supply.Keeper, cosmosDistKeeper cosmosDist.Keeper) Keeper

NewKeeper creates a new keeper of the auth Keeper

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) Params

GetParams gets the genesis params for the auth

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params Params)

SetParams sets the params for the auth

func (Keeper) UpdateParams

func (k Keeper) UpdateParams(ctx sdk.Context, updates Params, updatedFields []string) sdk.Error

UpdateParams updates the required params

type Params

type Params struct {
	UserGrowthAllocation  sdk.Dec `json:"user_growth_allocation"`
	UserRewardAllocation  sdk.Dec `json:"user_reward_allocation"`
	StakeholderAllocation sdk.Dec `json:"stakeholder_allocation"`
}

Params holds parameters for Auth

func DefaultParams

func DefaultParams() Params

DefaultParams is the auth params for testing

func (*Params) ParamSetPairs

func (p *Params) ParamSetPairs() params.ParamSetPairs

ParamSetPairs implements params.ParamSet

Jump to

Keyboard shortcuts

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