types

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 1

Documentation

Index

Constants

View Source
const (
	DefaultCodespace string = "params"
	BaseParamsError         = 4001

	CodeInvalidMaxProposalNum uint32 = BaseParamsError + 4
)

Param module codespace constants

View Source
const (
	QueryBlockConfig   = "blockconfig"
	MaxGasUsedPerBlock = "MaxGasUsedPerBlock"
)
View Source
const (
	ProposalTypeUpgrade = "oKCUpgrade"
	UpgradeRouterKey    = "okcUpgrade"

	QueryUpgrade = "okcUpgrade"

	UpgradeStatusPreparing        = 0
	UpgradeStatusWaitingEffective = 1
	UpgradeStatusEffective        = 2
)
View Source
const (
	QueryGasConfig = "gasconfig"
)
View Source
const (
	QueryParams = "params"
)

Variables

View Source
var (
	// ParamStoreKeyParamsParams is the raw store key for params module
	KeyMaxDepositPeriod = []byte("MaxDepositPeriod")
	KeyMinDeposit       = []byte("MinDeposit")
	KeyVotingPeriod     = []byte("VotingPeriod")
	KeyMaxBlockHeight   = []byte("MaxBlockHeight")
)
View Source
var (
	NewParamChange = types.NewParamChange
)
View Source
var RegisteredErrInvalidParamsNum = sdkerrors.Register(params.ModuleName, CodeInvalidMaxProposalNum, "invalid param number")

ErrInvalidMaxProposalNum returns error when the number of params to change are out of limit

Functions

func ErrInvalidParamsNum

func ErrInvalidParamsNum(codespace string, msg string) sdk.EnvelopedErr

ErrInvalidParamsNum returns error when the number of params to change are out of limit

func ParamKeyTable

func ParamKeyTable() sdkparams.KeyTable

ParamKeyTable returns the key declaration for parameters

func ValidateInt64 added in v1.8.0

func ValidateInt64(param string) subspace.ValueValidatorFn

Types

type BlockConfig added in v1.8.0

type BlockConfig struct {
	MaxGasUsedPerBlock int64 `json:"maxGasUsedPerBlock"`
}

BlockConfig is the struct of the parameters in this module

func NewDefaultBlockConfig added in v1.8.0

func NewDefaultBlockConfig() *BlockConfig

func (*BlockConfig) ParamSetPairs added in v1.8.0

func (p *BlockConfig) ParamSetPairs() subspace.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (BlockConfig) String added in v1.8.0

func (p BlockConfig) String() string

type GasConfig added in v1.7.6

type GasConfig struct {
	stypes.GasConfig
}

GasConfig is the struct of the parameters in this module

func (*GasConfig) ParamSetPairs added in v1.7.6

func (p *GasConfig) ParamSetPairs() subspace.ParamSetPairs

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (GasConfig) String added in v1.7.6

func (p GasConfig) String() string

type ParamChange

type ParamChange = types.ParamChange

type ParameterChangeProposal

type ParameterChangeProposal struct {
	sdkparams.ParameterChangeProposal
	Height uint64 `json:"height" yaml:"height"`
}

ParameterChangeProposal is the struct of param change proposal

func NewParameterChangeProposal

func NewParameterChangeProposal(title, description string, changes []types.ParamChange, height uint64,
) ParameterChangeProposal

NewParameterChangeProposal creates a new instance of ParameterChangeProposal

func (ParameterChangeProposal) GetParameterChangeProposal added in v1.7.0

func (pcp ParameterChangeProposal) GetParameterChangeProposal() sdkparams.ParameterChangeProposal

GetParameterChangeProposal is for compatibility with the standard cosmos REST API

func (ParameterChangeProposal) ValidateBasic

func (pcp ParameterChangeProposal) ValidateBasic() sdk.Error

ValidateBasic validates the parameter change proposal

type Params

type Params struct {
	// DexList proposal params
	// Maximum period for okb holders to deposit on a dex list proposal. Initial value: 2 days
	MaxDepositPeriod time.Duration `json:"max_deposit_period"`
	// Minimum deposit for a critical dex list proposal to enter voting period
	MinDeposit sdk.SysCoins `json:"min_deposit"`
	// Length of the critical voting period for dex list proposal
	VotingPeriod time.Duration `json:"voting_period"`
	// block height for dex list can not be greater than DexListMaxBlockHeight
	MaxBlockHeight uint64 `json:"max_block_height"`
}

Params is the struct of the parameters in this module

func DefaultParams

func DefaultParams() Params

DefaultParams returns the instance of Params with default value

func (*Params) ParamSetPairs

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

ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint

func (Params) String

func (p Params) String() string

type UpgradeCache added in v1.7.0

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

func NewUpgreadeCache added in v1.7.0

func NewUpgreadeCache(storeKey *sdk.KVStoreKey, logger log.Logger, cdc *codec.Codec) *UpgradeCache

func (*UpgradeCache) ClaimReadyForUpgrade added in v1.7.0

func (uc *UpgradeCache) ClaimReadyForUpgrade(name string, cb func(UpgradeInfo))

func (*UpgradeCache) IsUpgradeExist added in v1.7.0

func (uc *UpgradeCache) IsUpgradeExist(ctx sdk.Context, name string) bool

func (*UpgradeCache) IterateAllUpgradeInfo added in v1.7.0

func (uc *UpgradeCache) IterateAllUpgradeInfo(ctx sdk.Context, cb func(info UpgradeInfo) (stop bool)) sdk.Error

func (*UpgradeCache) QueryReadyForUpgrade added in v1.7.0

func (uc *UpgradeCache) QueryReadyForUpgrade(name string) ([]func(UpgradeInfo), bool)

func (*UpgradeCache) ReadUpgradeInfo added in v1.7.0

func (uc *UpgradeCache) ReadUpgradeInfo(ctx sdk.Context, name string) (UpgradeInfo, error)

func (*UpgradeCache) WriteUpgradeInfo added in v1.7.0

func (uc *UpgradeCache) WriteUpgradeInfo(ctx sdk.Context, info UpgradeInfo, forceCover bool) sdk.Error

type UpgradeInfo added in v1.7.0

type UpgradeInfo struct {
	Name         string `json:"name" yaml:"name"`
	ExpectHeight uint64 `json:"expectHeight" yaml:"expectHeight"`
	Config       string `json:"config,omitempty" yaml:"config,omitempty"`

	EffectiveHeight uint64        `json:"effectiveHeight,omitempty" yaml:"effectiveHeight,omitempty"`
	Status          UpgradeStatus `json:"status,omitempty" yaml:"status,omitempty"`
}

type UpgradeProposal added in v1.7.0

type UpgradeProposal struct {
	Title       string `json:"title" yaml:"title"`
	Description string `json:"description" yaml:"description"`

	Name         string `json:"name" yaml:"name"`
	ExpectHeight uint64 `json:"expectHeight" yaml:"expectHeight"`
	Config       string `json:"config,omitempty" yaml:"config,omitempty"`
}

UpgradeProposal is the struct of param change proposal

func NewUpgradeProposal added in v1.7.0

func NewUpgradeProposal(title, description, name string, expectHeight uint64, config string) UpgradeProposal

func (UpgradeProposal) GetDescription added in v1.7.0

func (up UpgradeProposal) GetDescription() string

func (UpgradeProposal) GetTitle added in v1.7.0

func (up UpgradeProposal) GetTitle() string

func (UpgradeProposal) ProposalRoute added in v1.7.0

func (up UpgradeProposal) ProposalRoute() string

func (UpgradeProposal) ProposalType added in v1.7.0

func (up UpgradeProposal) ProposalType() string

func (UpgradeProposal) String added in v1.7.0

func (up UpgradeProposal) String() string

String implements the Stringer interface.

func (UpgradeProposal) ValidateBasic added in v1.7.0

func (up UpgradeProposal) ValidateBasic() sdk.Error

type UpgradeStatus added in v1.7.0

type UpgradeStatus uint32

Jump to

Keyboard shortcuts

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