params

package
v0.16.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	DefaultCodespace sdk.CodespaceType = "params"
	//
	CodeInvalidString sdk.CodeType = 0

	//gov
	CodeInvalidMinDeposit        sdk.CodeType = 100
	CodeInvalidMinDepositDenom   sdk.CodeType = 101
	CodeInvalidMinDepositAmount  sdk.CodeType = 102
	CodeInvalidDepositPeriod     sdk.CodeType = 103
	CodeInvalidVotingPeriod      sdk.CodeType = 104
	CodeInvalidVotingProcedure   sdk.CodeType = 105
	CodeInvalidThreshold         sdk.CodeType = 106
	CodeInvalidParticipation     sdk.CodeType = 107
	CodeInvalidVeto              sdk.CodeType = 108
	CodeInvalidGovernancePenalty sdk.CodeType = 109
	CodeInvalidTallyingProcedure sdk.CodeType = 110
	CodeInvalidKey               sdk.CodeType = 111
	CodeInvalidModule            sdk.CodeType = 112
	CodeInvalidQueryParams       sdk.CodeType = 113
	CodeInvalidMaxProposalNum    sdk.CodeType = 114
	CodeInvalidSystemHaltPeriod  sdk.CodeType = 115

	//service
	CodeInvalidMaxRequestTimeout    sdk.CodeType = 200
	CodeInvalidMinDepositMultiple   sdk.CodeType = 201
	CodeInvalidServiceFeeTax        sdk.CodeType = 202
	CodeInvalidSlashFraction        sdk.CodeType = 203
	CodeInvalidArbitrationTimeLimit sdk.CodeType = 204
	CodeComplaintRetrospect         sdk.CodeType = 205
	CodeInvalidServiceTxSizeLimit   sdk.CodeType = 206

	//upgrade
	CodeInvalidUpgradeParams sdk.CodeType = 300

	//mint
	CodeInvalidMintInflation sdk.CodeType = 400

	//stake
	CodeInvalidUnbondingTime sdk.CodeType = 500
	CodeInvalidMaxValidators sdk.CodeType = 501
	CodeInvalidBondDenom     sdk.CodeType = 502

	//auth
	CodeInvalidGasPriceThreshold sdk.CodeType = 600
	CodeInvalidTxSizeLimit       sdk.CodeType = 601

	//distribution
	CodeInvalidCommunityTax        sdk.CodeType = 700
	CodeInvalidBaseProposerReward  sdk.CodeType = 701
	CodeInvalidBonusProposerReward sdk.CodeType = 702

	//slash
	CodeInvalidSlashParams sdk.CodeType = 800

	//asset
	CodeInvalidAssetTaxRate         sdk.CodeType = 900
	CodeInvalidMintTokenFeeRatio    sdk.CodeType = 901
	CodeInvalidGatewayAssetFeeRatio sdk.CodeType = 902
	CodeInvalidIssueTokenBaseFee    sdk.CodeType = 903
	CodeInvalidCreateGatewayBaseFee sdk.CodeType = 904
)
View Source
const (
	SignalParamspace = "Sig"
	GovParamspace    = "Gov"
)
View Source
const (
	QueryModule = "module"
)

query endpoints supported by the params Querier

Variables

This section is empty.

Functions

func ErrInvalidString

func ErrInvalidString(valuestr string) sdk.Error

func GetParamKey

func GetParamKey(keystr string) string

func GetParamSpaceFromKey

func GetParamSpaceFromKey(keystr string) string

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

creates a querier for params REST endpoints

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

Register concrete types on codec codec

func RegisterParamSet

func RegisterParamSet(paramSets map[string]ParamSet, ps ...ParamSet)

Types

type GovArrayParameter

type GovArrayParameter interface {
	GovParameter

	LoadValueByKey(ctx sdk.Context, key string) bool

	Insert(ctx sdk.Context, json string)
}

type GovParameter

type GovParameter interface {
	Parameter

	Valid(json string) sdk.Error

	GetValueFromRawData(cdc *codec.Codec, res []byte) interface{}

	Update(ctx sdk.Context, json string)

	ToJson(string) string
}

type Keeper

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

Keeper of the global paramstore

func NewKeeper

func NewKeeper(cdc *codec.Codec, key *sdk.KVStoreKey, tkey *sdk.TransientStoreKey) (k Keeper)

NewKeeper constructs a params keeper

func (Keeper) GetParamSet

func (k Keeper) GetParamSet(paramSpace string) (ParamSet, bool)

Get existing substore from keeper

func (Keeper) GetSubspace

func (k Keeper) GetSubspace(storename string) (Subspace, bool)

Get existing substore from keeper

func (Keeper) RegisterParamSet

func (k Keeper) RegisterParamSet(ps ...ParamSet)

func (Keeper) Subspace

func (k Keeper) Subspace(spacename string) Subspace

Allocate subspace used for keepers

type KeyValuePairs

type KeyValuePairs = subspace.KeyValuePairs

re-export types from subspace

type ParamSet

type ParamSet = subspace.ParamSet

re-export types from subspace

type ParamSets

type ParamSets = subspace.ParamSets

re-export types from subspace

type Parameter

type Parameter interface {
	InitGenesis(interface{})

	GetStoreKey() []byte

	SetReadWriter(paramSpace Subspace)

	SaveValue(ctx sdk.Context)

	LoadValue(ctx sdk.Context) bool
}

type QueryModuleParams

type QueryModuleParams struct {
	Module string
}

defines the params for query: "custom/params/module"

type ReadOnlySubspace

type ReadOnlySubspace = subspace.ReadOnlySubspace

re-export types from subspace

type SignalParameter

type SignalParameter interface {
	Parameter
}

type Subspace

type Subspace = subspace.Subspace

re-export types from subspace

type TypeTable

type TypeTable = subspace.TypeTable

re-export types from subspace

func NewTypeTable

func NewTypeTable(keytypes ...interface{}) TypeTable

re-export functions from subspace

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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