params

package
v0.9.0-rc0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2018 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCodespace                    sdk.CodespaceType = "params"
	CodeInvalidMinDeposit               sdk.CodeType      = 100
	CodeInvalidMinDepositDenom          sdk.CodeType      = 101
	CodeInvalidMinDepositAmount         sdk.CodeType      = 102
	CodeInvalidDepositPeriod            sdk.CodeType      = 103
	CodeInvalidCurrentUpgradeProposalID sdk.CodeType      = 104
	CodeInvalidVotingPeriod             sdk.CodeType      = 105
	CodeInvalidVotingProcedure          sdk.CodeType      = 106
	CodeInvalidThreshold                sdk.CodeType      = 107
	CodeInvalidParticipation            sdk.CodeType      = 108
	CodeInvalidVeto                     sdk.CodeType      = 109
	CodeInvalidTallyingProcedure        sdk.CodeType      = 110
	CodeInvalidKey                      sdk.CodeType      = 111
	CodeInvalidParamString              sdk.CodeType      = 112
	CodeInvalidModule                   sdk.CodeType      = 113
	CodeInvalidQueryParams              sdk.CodeType      = 114
	CodeInvalidMaxRequestTimeout        sdk.CodeType      = 115
	CodeInvalidMinDepositMultiple       sdk.CodeType      = 116
)
View Source
const (
	SignalParamspace = "Sig"
	GovParamspace    = "Gov"
)

Variables

View Source
var ParamMapping = make(map[string]GovParameter)

Functions

func InitGenesisParameter

func InitGenesisParameter(p Parameter, ctx sdk.Context, genesisData interface{})

func RegisterGovParamMapping

func RegisterGovParamMapping(gps ...GovParameter)

func SetParamReadWriter

func SetParamReadWriter(paramSpace Subspace, ps ...Parameter)

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) GetSubspace

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

Get existing substore from keeper

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 Parameter

type Parameter interface {
	InitGenesis(interface{})

	GetStoreKey() []byte

	SetReadWriter(paramSpace Subspace)

	SaveValue(ctx sdk.Context)

	LoadValue(ctx sdk.Context) bool
}

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