params

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2025 License: Apache-2.0, UNKNOWN not legal advice Imports: 0 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ModuleName = "params"

	// StoreKey = ModuleName
	StoreKeyPrefix = "/pv/"
)
View Source
const (
	ParamTypeString  = "string"
	ParamTypeInt64   = "int64"
	ParamTypeUint64  = "uint64"
	ParamTypeBool    = "bool"
	ParamTypeBytes   = "bytes"
	ParamTypeStrings = "strings"
)

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(params ParamsKeeper) paramsHandler

Types

type DummyKeeper

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

func NewDummyKeeper

func NewDummyKeeper(prmk ParamsKeeperI) DummyKeeper

func (DummyKeeper) WillSetParam

func (dk DummyKeeper) WillSetParam(ctx sdk.Context, key string, value any)

type Param

type Param struct {
	Key   string
	Type  string
	Value any
}

func NewParam

func NewParam(key string, value any) Param

NOTE: do not support structs here.

func (Param) MarshalAmino

func (p Param) MarshalAmino() (string, error)

func (*Param) Parse

func (p *Param) Parse(entry string) error

As would appear in genesis.json.

func (Param) String

func (p Param) String() string

func (*Param) UnmarshalAmino

func (p *Param) UnmarshalAmino(rep string) error

func (Param) ValidateBasic

func (p Param) ValidateBasic() error

type ParamfulKeeper

type ParamfulKeeper interface {
	WillSetParam(ctx sdk.Context, key string, value any)
}

type ParamsKeeper

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

global paramstore Keeper.

func NewParamsKeeper

func NewParamsKeeper(key store.StoreKey) ParamsKeeper

NewParamsKeeper returns a new ParamsKeeper.

func (ParamsKeeper) ForModule

func (pk ParamsKeeper) ForModule(moduleName string) prefixParamsKeeper

func (ParamsKeeper) GetAny

func (pk ParamsKeeper) GetAny(ctx sdk.Context, key string) any

func (ParamsKeeper) GetBool

func (pk ParamsKeeper) GetBool(ctx sdk.Context, key string, ptr *bool)

func (ParamsKeeper) GetBytes

func (pk ParamsKeeper) GetBytes(ctx sdk.Context, key string, ptr *[]byte)

func (ParamsKeeper) GetInt64

func (pk ParamsKeeper) GetInt64(ctx sdk.Context, key string, ptr *int64)

func (ParamsKeeper) GetRaw

func (pk ParamsKeeper) GetRaw(ctx sdk.Context, key string) []byte

func (ParamsKeeper) GetRegisteredKeeper

func (pk ParamsKeeper) GetRegisteredKeeper(moduleName string) ParamfulKeeper

func (ParamsKeeper) GetString

func (pk ParamsKeeper) GetString(ctx sdk.Context, key string, ptr *string)

func (ParamsKeeper) GetStrings

func (pk ParamsKeeper) GetStrings(ctx sdk.Context, key string, ptr *[]string)

func (ParamsKeeper) GetStruct

func (pk ParamsKeeper) GetStruct(ctx sdk.Context, key string, strctPtr any)

func (ParamsKeeper) GetUint64

func (pk ParamsKeeper) GetUint64(ctx sdk.Context, key string, ptr *uint64)

func (ParamsKeeper) Has

func (pk ParamsKeeper) Has(ctx sdk.Context, key string) bool

func (ParamsKeeper) IsRegistered

func (pk ParamsKeeper) IsRegistered(moduleName string) bool

func (ParamsKeeper) Logger

func (pk ParamsKeeper) Logger(ctx sdk.Context) *slog.Logger

XXX: why do we expose this?

func (ParamsKeeper) ModuleExists

func (pk ParamsKeeper) ModuleExists(moduleName string) bool

func (ParamsKeeper) Register

func (pk ParamsKeeper) Register(moduleName string, pmk ParamfulKeeper)

func (ParamsKeeper) SetAny

func (pk ParamsKeeper) SetAny(ctx sdk.Context, key string, value any)

func (ParamsKeeper) SetBool

func (pk ParamsKeeper) SetBool(ctx sdk.Context, key string, value bool)

func (ParamsKeeper) SetBytes

func (pk ParamsKeeper) SetBytes(ctx sdk.Context, key string, value []byte)

func (ParamsKeeper) SetInt64

func (pk ParamsKeeper) SetInt64(ctx sdk.Context, key string, value int64)

func (ParamsKeeper) SetRaw

func (pk ParamsKeeper) SetRaw(ctx sdk.Context, key string, value []byte)

func (ParamsKeeper) SetString

func (pk ParamsKeeper) SetString(ctx sdk.Context, key, value string)

func (ParamsKeeper) SetStrings

func (pk ParamsKeeper) SetStrings(ctx sdk.Context, key string, value []string)

func (ParamsKeeper) SetStruct

func (pk ParamsKeeper) SetStruct(ctx sdk.Context, key string, strct any)

func (ParamsKeeper) SetUint64

func (pk ParamsKeeper) SetUint64(ctx sdk.Context, key string, value uint64)

type ParamsKeeperI

type ParamsKeeperI interface {
	GetString(ctx sdk.Context, key string, ptr *string)
	GetInt64(ctx sdk.Context, key string, ptr *int64)
	GetUint64(ctx sdk.Context, key string, ptr *uint64)
	GetBool(ctx sdk.Context, key string, ptr *bool)
	GetBytes(ctx sdk.Context, key string, ptr *[]byte)
	GetStrings(ctx sdk.Context, key string, ptr *[]string)

	SetString(ctx sdk.Context, key string, value string)
	SetInt64(ctx sdk.Context, key string, value int64)
	SetUint64(ctx sdk.Context, key string, value uint64)
	SetBool(ctx sdk.Context, key string, value bool)
	SetBytes(ctx sdk.Context, key string, value []byte)
	SetStrings(ctx sdk.Context, key string, value []string)

	Has(ctx sdk.Context, key string) bool
	GetRaw(ctx sdk.Context, key string) []byte
	SetRaw(ctx sdk.Context, key string, value []byte)

	GetStruct(ctx sdk.Context, key string, strctPtr any)
	SetStruct(ctx sdk.Context, key string, strct any)

	// NOTE: GetAny and SetAny don't work on structs.
	GetAny(ctx sdk.Context, key string) any
	SetAny(ctx sdk.Context, key string, value any)
}

Jump to

Keyboard shortcuts

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