params

package
v0.23.0-iris1 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Gov    = "gov"
	Global = "global"
)
View Source
const IrisDenom = "iris"
View Source
const IrisPrecision = 18

Variables

This section is empty.

Functions

func ActivatedParamKey

func ActivatedParamKey(ty string) string

ActivatedParamKey - paramstore key for msg type activation

func DefaultPrecison

func DefaultPrecison(amount int64) sdk.Int

func Get

func Get(ctx sdk.Context, k Getter, key string, ptr interface{}) error

func InitGenesis

func InitGenesis(ctx sdk.Context, k Keeper, data GenesisState)

InitGenesis stores activated type to param store

func InitParamGenesis

func InitParamGenesis(ctx sdk.Context, k Keeper, state ParamGenesisState)

func NewAnteHandler

func NewAnteHandler(k Keeper) sdk.AnteHandler

NewAnteHandler returns an AnteHandler that checks whether msg type is activate or not

func Pow10

func Pow10(y int) sdk.Int

func ToBigCoin

func ToBigCoin(ctx sdk.Context, k Getter, coin types.Coin) (types.Coin, error)

Types

type BuildStoreKey

type BuildStoreKey = func(key string) string

type CoinConfig

type CoinConfig struct {
	Denom    string `json:"denom"`
	Precison int64  `json:"precison"`
}

type GenesisState

type GenesisState struct {
	ActivatedTypes []string `json:"activated-types"`
}

GenesisState defines initial activated msg types

type Getter

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

Getter exposes methods related with only getting params

func (Getter) Get

func (k Getter) Get(ctx sdk.Context, key string, ptr interface{}) error

Get exposes get

func (Getter) GetBool

func (k Getter) GetBool(ctx sdk.Context, key string) (res bool, err error)

GetBool is helper function for bool params

func (Getter) GetBoolWithDefault

func (k Getter) GetBoolWithDefault(ctx sdk.Context, key string, def bool) (res bool)

GetBoolWithDefault is helper function for bool params with default value

func (Getter) GetInt

func (k Getter) GetInt(ctx sdk.Context, key string) (res sdk.Int, err error)

GetInt is helper function for sdk.Int params

func (Getter) GetInt16

func (k Getter) GetInt16(ctx sdk.Context, key string) (res int16, err error)

GetInt16 is helper function for int16 params

func (Getter) GetInt16WithDefault

func (k Getter) GetInt16WithDefault(ctx sdk.Context, key string, def int16) (res int16)

GetInt16WithDefault is helper function for int16 params with default value

func (Getter) GetInt32

func (k Getter) GetInt32(ctx sdk.Context, key string) (res int32, err error)

GetInt32 is helper function for int32 params

func (Getter) GetInt32WithDefault

func (k Getter) GetInt32WithDefault(ctx sdk.Context, key string, def int32) (res int32)

GetInt32WithDefault is helper function for int32 params with default value

func (Getter) GetInt64

func (k Getter) GetInt64(ctx sdk.Context, key string) (res int64, err error)

GetInt64 is helper function for int64 params

func (Getter) GetInt64WithDefault

func (k Getter) GetInt64WithDefault(ctx sdk.Context, key string, def int64) (res int64)

GetInt64WithDefault is helper function for int64 params with default value

func (Getter) GetIntWithDefault

func (k Getter) GetIntWithDefault(ctx sdk.Context, key string, def sdk.Int) (res sdk.Int)

GetIntWithDefault is helper function for sdk.Int params with default value

func (Getter) GetRat

func (k Getter) GetRat(ctx sdk.Context, key string) (res sdk.Rat, err error)

GetRat is helper function for rat params

func (Getter) GetRatWithDefault

func (k Getter) GetRatWithDefault(ctx sdk.Context, key string, def sdk.Rat) (res sdk.Rat)

GetRatWithDefault is helper function for sdk.Rat params with default value

func (Getter) GetRaw

func (k Getter) GetRaw(ctx sdk.Context, key string) []byte

GetRaw exposes getRaw

func (Getter) GetString

func (k Getter) GetString(ctx sdk.Context, key string) (res string, err error)

GetString is helper function for string params

func (Getter) GetStringWithDefault

func (k Getter) GetStringWithDefault(ctx sdk.Context, key string, def string) (res string)

GetStringWithDefault is helper function for string params with default value

func (Getter) GetUint

func (k Getter) GetUint(ctx sdk.Context, key string) (res sdk.Uint, err error)

GetUint is helper function for sdk.Uint params

func (Getter) GetUint16

func (k Getter) GetUint16(ctx sdk.Context, key string) (res uint16, err error)

GetUint16 is helper function for uint16 params

func (Getter) GetUint16WithDefault

func (k Getter) GetUint16WithDefault(ctx sdk.Context, key string, def uint16) (res uint16)

GetUint16WithDefault is helper function for uint16 params with default value

func (Getter) GetUint32

func (k Getter) GetUint32(ctx sdk.Context, key string) (res uint32, err error)

GetUint32 is helper function for uint32 params

func (Getter) GetUint32WithDefault

func (k Getter) GetUint32WithDefault(ctx sdk.Context, key string, def uint32) (res uint32)

GetUint32WithDefault is helper function for uint32 params with default value

func (Getter) GetUint64

func (k Getter) GetUint64(ctx sdk.Context, key string) (res uint64, err error)

GetUint64 is helper function for uint64 params

func (Getter) GetUint64WithDefault

func (k Getter) GetUint64WithDefault(ctx sdk.Context, key string, def uint64) (res uint64)

GetUint64WithDefault is helper function for uint64 params with default value

func (Getter) GetUintWithDefault

func (k Getter) GetUintWithDefault(ctx sdk.Context, key string, def sdk.Uint) (res sdk.Uint)

GetUintWithDefault is helper function for sdk.Uint params with default value

type GetterProxy

type GetterProxy struct {
	BuildStoreKey
	// contains filtered or unexported fields
}

func (GetterProxy) Get

func (proxy GetterProxy) Get(ctx sdk.Context, key string, res interface{}) (err error)

func (GetterProxy) GetBool

func (proxy GetterProxy) GetBool(ctx sdk.Context, key string) (res bool, err error)

GetBool is helper function for bool params

func (GetterProxy) GetBoolWithDefault

func (proxy GetterProxy) GetBoolWithDefault(ctx sdk.Context, key string, def bool) (res bool)

GetBoolWithDefault is helper function for bool params with default value

func (GetterProxy) GetInt

func (proxy GetterProxy) GetInt(ctx sdk.Context, key string) (res sdk.Int, err error)

GetInt is helper function for sdk.Int params

func (GetterProxy) GetInt16

func (proxy GetterProxy) GetInt16(ctx sdk.Context, key string) (res int16, err error)

GetInt16 is helper function for int16 params

func (GetterProxy) GetInt16WithDefault

func (proxy GetterProxy) GetInt16WithDefault(ctx sdk.Context, key string, def int16) (res int16)

GetInt16WithDefault is helper function for int16 params with default value

func (GetterProxy) GetInt32

func (proxy GetterProxy) GetInt32(ctx sdk.Context, key string) (res int32, err error)

GetInt32 is helper function for int32 params

func (GetterProxy) GetInt32WithDefault

func (proxy GetterProxy) GetInt32WithDefault(ctx sdk.Context, key string, def int32) (res int32)

GetInt32WithDefault is helper function for int32 params with default value

func (GetterProxy) GetInt64

func (proxy GetterProxy) GetInt64(ctx sdk.Context, key string) (res int64, err error)

GetInt64 is helper function for int64 params

func (GetterProxy) GetInt64WithDefault

func (proxy GetterProxy) GetInt64WithDefault(ctx sdk.Context, key string, def int64) (res int64)

GetInt64WithDefault is helper function for int64 params with default value

func (GetterProxy) GetIntWithDefault

func (proxy GetterProxy) GetIntWithDefault(ctx sdk.Context, key string, def sdk.Int) (res sdk.Int)

GetIntWithDefault is helper function for sdk.Int params with default value

func (GetterProxy) GetRat

func (proxy GetterProxy) GetRat(ctx sdk.Context, key string) (res sdk.Rat, err error)

GetRat is helper function for rat params

func (GetterProxy) GetRatWithDefault

func (proxy GetterProxy) GetRatWithDefault(ctx sdk.Context, key string, def sdk.Rat) (res sdk.Rat)

GetRatWithDefault is helper function for sdk.Rat params with default value

func (GetterProxy) GetRaw

func (proxy GetterProxy) GetRaw(ctx sdk.Context, key string) []byte

GetRaw exposes getRaw

func (GetterProxy) GetString

func (proxy GetterProxy) GetString(ctx sdk.Context, key string) (res string, err error)

GetString is helper function for string params

func (GetterProxy) GetStringWithDefault

func (proxy GetterProxy) GetStringWithDefault(ctx sdk.Context, key string, def string) (res string)

GetStringWithDefault is helper function for string params with default value

func (GetterProxy) GetUint

func (proxy GetterProxy) GetUint(ctx sdk.Context, key string) (res sdk.Uint, err error)

GetUint is helper function for sdk.Uint params

func (GetterProxy) GetUint16

func (proxy GetterProxy) GetUint16(ctx sdk.Context, key string) (res uint16, err error)

GetUint16 is helper function for uint16 params

func (GetterProxy) GetUint16WithDefault

func (proxy GetterProxy) GetUint16WithDefault(ctx sdk.Context, key string, def uint16) (res uint16)

GetUint16WithDefault is helper function for uint16 params with default value

func (GetterProxy) GetUint32

func (proxy GetterProxy) GetUint32(ctx sdk.Context, key string) (res uint32, err error)

GetUint32 is helper function for uint32 params

func (GetterProxy) GetUint32WithDefault

func (proxy GetterProxy) GetUint32WithDefault(ctx sdk.Context, key string, def uint32) (res uint32)

GetUint32WithDefault is helper function for uint32 params with default value

func (GetterProxy) GetUint64

func (proxy GetterProxy) GetUint64(ctx sdk.Context, key string) (res uint64, err error)

GetUint64 is helper function for uint64 params

func (GetterProxy) GetUint64WithDefault

func (proxy GetterProxy) GetUint64WithDefault(ctx sdk.Context, key string, def uint64) (res uint64)

GetUint64WithDefault is helper function for uint64 params with default value

func (GetterProxy) GetUintWithDefault

func (proxy GetterProxy) GetUintWithDefault(ctx sdk.Context, key string, def sdk.Uint) (res sdk.Uint)

GetUintWithDefault is helper function for sdk.Uint params with default value

func (GetterProxy) GovGetter

func (proxy GetterProxy) GovGetter() GetterProxy

Getter returns readonly struct,get from Gov

type Keeper

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

Keeper manages global parameter store

func InitKeeper

func InitKeeper(ctx sdk.Context, cdc *wire.Codec, key sdk.StoreKey, params ...interface{}) Keeper

InitKeeper constructs a new Keeper with initial parameters

func NewKeeper

func NewKeeper(cdc *wire.Codec, key sdk.StoreKey) Keeper

NewKeeper constructs a new Keeper

func (Keeper) Getter

func (k Keeper) Getter() GetterProxy

Getter returns readonly struct,default get from Global

func (Keeper) Setter

func (k Keeper) Setter() SetterProxy

Getter returns readonly struct,add Prefix "global"

type ParamGenesisState

type ParamGenesisState struct {
	Coins []CoinConfig `json:"coins"`
}

func DefaultGenesisState

func DefaultGenesisState() (state ParamGenesisState)

type Setter

type Setter struct {
	Getter
}

Setter exposes all methods including Set

func (Setter) Set

func (k Setter) Set(ctx sdk.Context, key string, param interface{}) error

Set exposes set

func (Setter) SetBool

func (k Setter) SetBool(ctx sdk.Context, key string, param bool)

SetBool is helper function for bool params

func (Setter) SetInt

func (k Setter) SetInt(ctx sdk.Context, key string, param sdk.Int)

SetInt is helper function for sdk.Int params

func (Setter) SetInt16

func (k Setter) SetInt16(ctx sdk.Context, key string, param int16)

SetInt16 is helper function for int16 params

func (Setter) SetInt32

func (k Setter) SetInt32(ctx sdk.Context, key string, param int32)

SetInt32 is helper function for int32 params

func (Setter) SetInt64

func (k Setter) SetInt64(ctx sdk.Context, key string, param int64)

SetInt64 is helper function for int64 params

func (Setter) SetRat

func (k Setter) SetRat(ctx sdk.Context, key string, param sdk.Rat)

SetRat is helper function for rat params

func (Setter) SetRaw

func (k Setter) SetRaw(ctx sdk.Context, key string, param []byte)

SetRaw exposes setRaw

func (Setter) SetString

func (k Setter) SetString(ctx sdk.Context, key string, param string)

SetString is helper function for string params

func (Setter) SetUint

func (k Setter) SetUint(ctx sdk.Context, key string, param sdk.Uint)

SetUint is helper function for sdk.Uint params

func (Setter) SetUint16

func (k Setter) SetUint16(ctx sdk.Context, key string, param uint16)

SetUint16 is helper function for uint16 params

func (Setter) SetUint32

func (k Setter) SetUint32(ctx sdk.Context, key string, param uint32)

SetUint32 is helper function for uint32 params

func (Setter) SetUint64

func (k Setter) SetUint64(ctx sdk.Context, key string, param uint64)

SetUint64 is helper function for uint64 params

type SetterProxy

type SetterProxy struct {
	GetterProxy
	// contains filtered or unexported fields
}

func (SetterProxy) GovSetter

func (proxy SetterProxy) GovSetter() SetterProxy

Getter returns readonly struct,add Prefix "gov"

func (SetterProxy) Set

func (proxy SetterProxy) Set(ctx sdk.Context, key string, param interface{}) error

Set exposes set

func (SetterProxy) SetBool

func (proxy SetterProxy) SetBool(ctx sdk.Context, key string, param bool)

SetBool is helper function for bool params

func (SetterProxy) SetInt

func (proxy SetterProxy) SetInt(ctx sdk.Context, key string, param sdk.Int)

SetInt is helper function for sdk.Int params

func (SetterProxy) SetInt16

func (proxy SetterProxy) SetInt16(ctx sdk.Context, key string, param int16)

SetInt16 is helper function for int16 params

func (SetterProxy) SetInt32

func (proxy SetterProxy) SetInt32(ctx sdk.Context, key string, param int32)

SetInt32 is helper function for int32 params

func (SetterProxy) SetInt64

func (proxy SetterProxy) SetInt64(ctx sdk.Context, key string, param int64)

SetInt64 is helper function for int64 params

func (SetterProxy) SetRat

func (proxy SetterProxy) SetRat(ctx sdk.Context, key string, param sdk.Rat)

SetRat is helper function for rat params

func (SetterProxy) SetRaw

func (proxy SetterProxy) SetRaw(ctx sdk.Context, key string, param []byte)

SetRaw exposes setRaw

func (SetterProxy) SetString

func (proxy SetterProxy) SetString(ctx sdk.Context, key string, param string)

SetString is helper function for string params

func (SetterProxy) SetUint

func (proxy SetterProxy) SetUint(ctx sdk.Context, key string, param sdk.Uint)

SetUint is helper function for sdk.Uint params

func (SetterProxy) SetUint16

func (proxy SetterProxy) SetUint16(ctx sdk.Context, key string, param uint16)

SetUint16 is helper function for uint16 params

func (SetterProxy) SetUint32

func (proxy SetterProxy) SetUint32(ctx sdk.Context, key string, param uint32)

SetUint32 is helper function for uint32 params

func (SetterProxy) SetUint64

func (proxy SetterProxy) SetUint64(ctx sdk.Context, key string, param uint64)

SetUint64 is helper function for uint64 params

Directories

Path Synopsis
client
cli

Jump to

Keyboard shortcuts

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