Documentation ¶
Index ¶
- Constants
- Variables
- func ErrInvalidParamsNum(codespace string, msg string) sdk.EnvelopedErr
- func ParamKeyTable() sdkparams.KeyTable
- type ParamChange
- type ParameterChangeProposal
- type Params
- type UpgradeCache
- func (uc *UpgradeCache) ClaimReadyForUpgrade(name string, cb func(UpgradeInfo))
- func (uc *UpgradeCache) IsUpgradeExist(ctx sdk.Context, name string) bool
- func (uc *UpgradeCache) IterateAllUpgradeInfo(ctx sdk.Context, cb func(info UpgradeInfo) (stop bool)) sdk.Error
- func (uc *UpgradeCache) QueryReadyForUpgrade(name string) ([]func(UpgradeInfo), bool)
- func (uc *UpgradeCache) ReadUpgradeInfo(ctx sdk.Context, name string) (UpgradeInfo, error)
- func (uc *UpgradeCache) WriteUpgradeInfo(ctx sdk.Context, info UpgradeInfo, forceCover bool) sdk.Error
- type UpgradeInfo
- type UpgradeProposal
- type UpgradeStatus
Constants ¶
const ( DefaultCodespace string = "params" BaseParamsError = 4001 CodeInvalidMaxProposalNum uint32 = BaseParamsError + 4 )
Param module codespace constants
const ( ProposalTypeUpgrade = "OKBCUpgrade" UpgradeRouterKey = "okbcUpgrade" QueryUpgrade = "okbcUpgrade" UpgradeStatusPreparing = 0 UpgradeStatusWaitingEffective = 1 UpgradeStatusEffective = 2 )
const (
QueryParams = "params"
)
Variables ¶
var ( // ParamStoreKeyParamsParams is the raw store key for params module KeyMaxDepositPeriod = []byte("MaxDepositPeriod") KeyMinDeposit = []byte("MinDeposit") KeyVotingPeriod = []byte("VotingPeriod") KeyMaxBlockHeight = []byte("MaxBlockHeight") )
var (
NewParamChange = types.NewParamChange
)
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 ¶
ParamKeyTable returns the key declaration for parameters
Types ¶
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) 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
type UpgradeCache ¶
type UpgradeCache struct {
// contains filtered or unexported fields
}
func NewUpgreadeCache ¶
func NewUpgreadeCache(storeKey *sdk.KVStoreKey, logger log.Logger, cdc *codec.Codec) *UpgradeCache
func (*UpgradeCache) ClaimReadyForUpgrade ¶
func (uc *UpgradeCache) ClaimReadyForUpgrade(name string, cb func(UpgradeInfo))
func (*UpgradeCache) IsUpgradeExist ¶
func (uc *UpgradeCache) IsUpgradeExist(ctx sdk.Context, name string) bool
func (*UpgradeCache) IterateAllUpgradeInfo ¶
func (uc *UpgradeCache) IterateAllUpgradeInfo(ctx sdk.Context, cb func(info UpgradeInfo) (stop bool)) sdk.Error
func (*UpgradeCache) QueryReadyForUpgrade ¶
func (uc *UpgradeCache) QueryReadyForUpgrade(name string) ([]func(UpgradeInfo), bool)
func (*UpgradeCache) ReadUpgradeInfo ¶
func (uc *UpgradeCache) ReadUpgradeInfo(ctx sdk.Context, name string) (UpgradeInfo, error)
func (*UpgradeCache) WriteUpgradeInfo ¶
func (uc *UpgradeCache) WriteUpgradeInfo(ctx sdk.Context, info UpgradeInfo, forceCover bool) sdk.Error
type UpgradeInfo ¶
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 ¶
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 ¶
func NewUpgradeProposal(title, description, name string, expectHeight uint64, config string) UpgradeProposal
func (UpgradeProposal) GetDescription ¶
func (up UpgradeProposal) GetDescription() string
func (UpgradeProposal) GetTitle ¶
func (up UpgradeProposal) GetTitle() string
func (UpgradeProposal) ProposalRoute ¶
func (up UpgradeProposal) ProposalRoute() string
func (UpgradeProposal) ProposalType ¶
func (up UpgradeProposal) ProposalType() string
func (UpgradeProposal) String ¶
func (up UpgradeProposal) String() string
String implements the Stringer interface.
func (UpgradeProposal) ValidateBasic ¶
func (up UpgradeProposal) ValidateBasic() sdk.Error
type UpgradeStatus ¶
type UpgradeStatus uint32