v04

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

DONTCOVER

Index

Constants

View Source
const (
	// ModuleName nonlint
	ModuleName = "treasury"

	// RouterKey is the message route for distribution
	RouterKey = ModuleName

	// ProposalTypeTaxRateUpdate defines the type for a TaxRateUpdateProposal
	ProposalTypeTaxRateUpdate = "TaxRateUpdate"

	// ProposalTypeRewardWeightUpdate defines the type for a RewardWeightUpdateProposal
	ProposalTypeRewardWeightUpdate = "RewardWeightUpdate"

	// Block units
	BlocksPerMinute = uint64(10)
	BlocksPerHour   = BlocksPerMinute * 60
	BlocksPerDay    = BlocksPerHour * 24
	BlocksPerWeek   = BlocksPerDay * 7
)

Variables

This section is empty.

Functions

func RegisterLegacyAminoCodec

func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino)

RegisterLegacyAminoCodec nolint

Types

type GenesisState

type GenesisState struct {
	Params               Params             `json:"params" yaml:"params"` // market params
	TaxRate              sdk.Dec            `json:"tax_rate" yaml:"tax_rate"`
	RewardWeight         sdk.Dec            `json:"reward_weight" yaml:"reward_weight"`
	TaxCaps              map[string]sdk.Int `json:"tax_caps" yaml:"tax_caps"`
	TaxProceed           sdk.Coins          `json:"tax_proceed" yaml:"tax_proceed"`
	EpochInitialIssuance sdk.Coins          `json:"epoch_initial_issuance" yaml:"epoch_initial_issuance"`
	CumulativeHeight     int64              `json:"cumulated_height" yaml:"cumulated_height"`
	TRs                  []sdk.Dec          `json:"TRs" yaml:"TRs"`
	SRs                  []sdk.Dec          `json:"SRs" yaml:"SRs"`
	TSLs                 []sdk.Int          `json:"TSLs" yaml:"TSLs"`
}

GenesisState - all treasury state that must be provided at genesis

type Params

type Params struct {
	TaxPolicy               PolicyConstraints `json:"tax_policy" yaml:"tax_policy"`
	RewardPolicy            PolicyConstraints `json:"reward_policy" yaml:"reward_policy"`
	SeigniorageBurdenTarget sdk.Dec           `json:"seigniorage_burden_target" yaml:"seigniorage_burden_target"`
	MiningIncrement         sdk.Dec           `json:"mining_increment" yaml:"mining_increment"`
	WindowShort             int64             `json:"window_short" yaml:"window_short"`
	WindowLong              int64             `json:"window_long" yaml:"window_long"`
	WindowProbation         int64             `json:"window_probation" yaml:"window_probation"`
}

Params treasury parameters

type PolicyConstraints

type PolicyConstraints struct {
	RateMin       sdk.Dec  `json:"rate_min"`
	RateMax       sdk.Dec  `json:"rate_max"`
	Cap           sdk.Coin `json:"cap"`
	ChangeRateMax sdk.Dec  `json:"change_max"`
}

PolicyConstraints wraps constraints around updating a key Treasury variable

type RewardWeightUpdateProposal

type RewardWeightUpdateProposal struct {
	Title        string  `json:"title" yaml:"title"`                 // Title of the Proposal
	Description  string  `json:"description" yaml:"description"`     // Description of the Proposal
	RewardWeight sdk.Dec `json:"reward_weight" yaml:"reward_weight"` // target RewardWeight
}

RewardWeightUpdateProposal update treasury tax-rate

func (RewardWeightUpdateProposal) GetDescription

func (p RewardWeightUpdateProposal) GetDescription() string

GetDescription returns the description of an RewardWeightUpdateProposal.

func (RewardWeightUpdateProposal) GetTitle

func (p RewardWeightUpdateProposal) GetTitle() string

GetTitle returns the title of an RewardWeightUpdateProposal.

func (RewardWeightUpdateProposal) ProposalRoute

func (RewardWeightUpdateProposal) ProposalRoute() string

ProposalRoute returns the routing key of an RewardWeightUpdateProposal.

func (RewardWeightUpdateProposal) ProposalType

func (p RewardWeightUpdateProposal) ProposalType() string

ProposalType returns the type of an RewardWeightUpdateProposal.

func (RewardWeightUpdateProposal) String

String implements the Stringer interface.

func (RewardWeightUpdateProposal) ValidateBasic

func (p RewardWeightUpdateProposal) ValidateBasic() error

ValidateBasic runs basic stateless validity checks

type TaxRateUpdateProposal

type TaxRateUpdateProposal struct {
	Title       string  `json:"title" yaml:"title"`             // Title of the Proposal
	Description string  `json:"description" yaml:"description"` // Description of the Proposal
	TaxRate     sdk.Dec `json:"tax_rate" yaml:"tax_rate"`       // target TaxRate
}

TaxRateUpdateProposal updates treasury tax-rate

func (TaxRateUpdateProposal) GetDescription

func (p TaxRateUpdateProposal) GetDescription() string

GetDescription returns the description of an TaxRateUpdateProposal.

func (TaxRateUpdateProposal) GetTitle

func (p TaxRateUpdateProposal) GetTitle() string

GetTitle returns the title of an TaxRateUpdateProposal.

func (TaxRateUpdateProposal) ProposalRoute

func (TaxRateUpdateProposal) ProposalRoute() string

ProposalRoute returns the routing key of an TaxRateUpdateProposal.

func (TaxRateUpdateProposal) ProposalType

func (p TaxRateUpdateProposal) ProposalType() string

ProposalType returns the type of an TaxRateUpdateProposal.

func (TaxRateUpdateProposal) String

func (p TaxRateUpdateProposal) String() string

String implements the Stringer interface.

func (TaxRateUpdateProposal) ValidateBasic

func (p TaxRateUpdateProposal) ValidateBasic() error

ValidateBasic runs basic stateless validity checks

Jump to

Keyboard shortcuts

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