Documentation ¶
Index ¶
- Constants
- Variables
- func ErrEmptyChanges(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptyKey(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptySubspace(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptyValue(codespace sdk.CodespaceType) sdk.Error
- func ErrEmptyVersionUpgrade(codespace sdk.CodespaceType) sdk.Error
- func ErrInvalidACL(codespace sdk.CodespaceType, err error) sdk.Error
- func ErrSettingParameter(codespace sdk.CodespaceType, key, subkey, value, msg string) sdk.Error
- func ErrSubspaceNotFound(codespace sdk.CodespaceType, subspaceName string) sdk.Error
- func ErrUnauthorizedParamChange(codespace sdk.CodespaceType, owner sdk.Address, param string) sdk.Error
- func ErrUnknownSubspace(codespace sdk.CodespaceType, space string) sdk.Error
- func ErrUnrecognizedDAOAction(codespace sdk.CodespaceType, daoActionString string) sdk.Error
- func ErrZeroHeightUpgrade(codespace sdk.CodespaceType) sdk.Error
- func ErrZeroValueDAOAction(codespace sdk.CodespaceType) sdk.Error
- func NewACLKey(subspaceName, paramName string) string
- func ParamKeyTable() sdk.KeyTable
- func RegisterCodec(cdc *codec.Codec)
- func SplitACLKey(aclKey string) (subspaceName, paramName string)
- func ValidateGenesis(data GenesisState) error
- type ACL
- type ACLPair
- type BaseACL
- type DAOAction
- type GenesisState
- type MsgChangeParam
- type MsgDAOTransfer
- type MsgUpgrade
- type NonMapACL
- type Params
- type PosKeeper
- type QueryACLParams
- type QueryDAOParams
- type QueryUpgradeParams
- type SupplyKeeper
- type Upgrade
Constants ¶
const ( DAOAccountName = "dao" DAOTransferString = "dao_transfer" DAOBurnString = "dao_burn" DAOTransfer DAOAction = iota + 1 DAOBurn )
const ( CodeUnknownSubspace sdk.CodeType = 1 CodeSettingParameter = 2 CodeEmptyData = 3 CodeInvalidACL = 4 CodeSubspaceNotFound = 6 CodeUnrecognizedDAOAction = 7 CodeZeroValueDAOAction = 8 CodeZeroHeightUpgrade = 9 CodeEmptyVersionUpgrade = 10 )
Param module codespace constants
const ( EventDAOTransfer = "dao_transfer" EventDAOBurn = "dao_burn" EventParamChange = "param_change" EventUpgrade = "upgrade" EventMustUpgrade = "must_upgrade" )
const ( DAOTransferFee = 100000 MsgChangeParamFee = 100000 MsgUpgradeFee = 100000 )
const ( MsgDAOTransferName = "dao_tranfer" MsgChangeParamName = "change_param" MsgUpgradeName = "upgrade" )
const ( ModuleName = "gov" // ModuleKey defines the name of the module RouterKey = ModuleName // RouterKey defines the routing key for a Parameter Change StoreKey = "gov" // StoreKey is the string store key for the param store TStoreKey = "transient_gov" // TStoreKey is the string store key for the param transient store DefaultCodespace sdk.CodespaceType = ModuleName // default codespace for governance errors QuerierRoute = ModuleName // QuerierRoute is the querier route for the staking module QueryACL = "acl" QueryDAO = "dao" QueryUpgrade = "upgrade" QueryDAOOwner = "daoOwner" )
query endpoints supported by the staking Querier
const (
ACLKeySep = "/"
)
const DefaultParamspace = ModuleName
DefaultParamspace defines the default auth module parameter subspace
Variables ¶
var ( ACLKey = []byte("acl") DAOOwnerKey = []byte("daoOwner") UpgradeKey = []byte("upgrade") )
Parameter keys
var ( GovFeeMap = map[string]int64{ MsgDAOTransferName: DAOTransferFee, MsgChangeParamName: MsgChangeParamFee, MsgUpgradeName: MsgUpgradeFee, } )
var ModuleCdc *codec.Codec
module codec
Functions ¶
func ErrEmptyChanges ¶
func ErrEmptyChanges(codespace sdk.CodespaceType) sdk.Error
ErrEmptyChanges returns an error for empty parameter changes.
func ErrEmptyKey ¶
func ErrEmptyKey(codespace sdk.CodespaceType) sdk.Error
ErrEmptyKey returns an error for when an empty key is given.
func ErrEmptySubspace ¶
func ErrEmptySubspace(codespace sdk.CodespaceType) sdk.Error
ErrEmptySubspace returns an error for an empty subspace.
func ErrEmptyValue ¶
func ErrEmptyValue(codespace sdk.CodespaceType) sdk.Error
ErrEmptyValue returns an error for when an empty key is given.
func ErrEmptyVersionUpgrade ¶
func ErrEmptyVersionUpgrade(codespace sdk.CodespaceType) sdk.Error
func ErrInvalidACL ¶
func ErrInvalidACL(codespace sdk.CodespaceType, err error) sdk.Error
func ErrSettingParameter ¶
func ErrSettingParameter(codespace sdk.CodespaceType, key, subkey, value, msg string) sdk.Error
ErrSettingParameter returns an error for failing to set a parameter.
func ErrSubspaceNotFound ¶
func ErrSubspaceNotFound(codespace sdk.CodespaceType, subspaceName string) sdk.Error
func ErrUnknownSubspace ¶
func ErrUnknownSubspace(codespace sdk.CodespaceType, space string) sdk.Error
ErrUnknownSubspace returns an unknown subspace error.
func ErrUnrecognizedDAOAction ¶
func ErrUnrecognizedDAOAction(codespace sdk.CodespaceType, daoActionString string) sdk.Error
func ErrZeroHeightUpgrade ¶
func ErrZeroHeightUpgrade(codespace sdk.CodespaceType) sdk.Error
func ErrZeroValueDAOAction ¶
func ErrZeroValueDAOAction(codespace sdk.CodespaceType) sdk.Error
func RegisterCodec ¶
RegisterCodec registers all necessary param module types with a given codec.
func SplitACLKey ¶
func ValidateGenesis ¶
func ValidateGenesis(data GenesisState) error
ValidateGenesis performs basic validation of auth genesis data returning an error for any failed validation criteria.
Types ¶
type GenesisState ¶
type GenesisState struct { Params Params `json:"params" yaml:"params"` DAOTokens sdk.Int `json:"DAO_Tokens"` }
GenesisState - all auth state that must be provided at genesis
func DefaultGenesisState ¶
func DefaultGenesisState() GenesisState
DefaultGenesisState - Return a default genesis state
func NewGenesisState ¶
func NewGenesisState(params Params, daoTokens sdk.Int) GenesisState
NewGenesisState - Create a new genesis state
type MsgChangeParam ¶
type MsgChangeParam struct { FromAddress sdk.Address `json:"address"` ParamKey string `json:"param_key"` ParamVal interface{} `json:"param_value"` }
---------------------------------------------------------------------------------------------------------------------- MsgChangeParam structure for changing governance parameters
func (MsgChangeParam) GetSignBytes ¶
func (msg MsgChangeParam) GetSignBytes() []byte
func (MsgChangeParam) GetSigners ¶
func (msg MsgChangeParam) GetSigners() []sdk.Address
func (MsgChangeParam) Type ¶
func (msg MsgChangeParam) Type() string
func (MsgChangeParam) ValidateBasic ¶
func (msg MsgChangeParam) ValidateBasic() sdk.Error
type MsgDAOTransfer ¶
type MsgDAOTransfer struct { FromAddress sdk.Address `json:"from_address"` ToAddress sdk.Address `json:"to_address"` Amount sdk.Int `json:"amount"` Action string `json:"action"` }
---------------------------------------------------------------------------------------------------------------------- MsgChangeParam structure for changing governance parameters
func (MsgDAOTransfer) GetSignBytes ¶
func (msg MsgDAOTransfer) GetSignBytes() []byte
func (MsgDAOTransfer) GetSigners ¶
func (msg MsgDAOTransfer) GetSigners() []sdk.Address
func (MsgDAOTransfer) Type ¶
func (msg MsgDAOTransfer) Type() string
func (MsgDAOTransfer) ValidateBasic ¶
func (msg MsgDAOTransfer) ValidateBasic() sdk.Error
type MsgUpgrade ¶
---------------------------------------------------------------------------------------------------------------------- MsgUpgrade structure for changing governance parameters
func (MsgUpgrade) GetSignBytes ¶
func (msg MsgUpgrade) GetSignBytes() []byte
func (MsgUpgrade) GetSigners ¶
func (msg MsgUpgrade) GetSigners() []sdk.Address
func (MsgUpgrade) Type ¶
func (msg MsgUpgrade) Type() string
func (MsgUpgrade) ValidateBasic ¶
func (msg MsgUpgrade) ValidateBasic() sdk.Error
type Params ¶
type Params struct { ACL ACL `json:"acl"` DAOOwner sdk.Address `json:"dao_owner"` Upgrade Upgrade `json:"upgrade"` }
Params defines the parameters for the auth module.
func (*Params) ParamSetPairs ¶
func (p *Params) ParamSetPairs() sdk.ParamSetPairs
ParamSetPairs implements the ParamSet interface and returns all the key/value pairs pairs of auth module's parameters. nolint
type PosKeeper ¶
type PosKeeper interface { RewardForRelays(ctx sdk.Ctx, relays sdk.Int, address sdk.Address) GetStakedTokens(ctx sdk.Ctx) sdk.Int Validator(ctx sdk.Ctx, addr sdk.Address) posexported.ValidatorI TotalTokens(ctx sdk.Ctx) sdk.Int BurnForChallenge(ctx sdk.Ctx, challenges sdk.Int, address sdk.Address) JailValidator(ctx sdk.Ctx, addr sdk.Address) AllValidators(ctx sdk.Ctx) (validators []posexported.ValidatorI) GetStakedValidators(ctx sdk.Ctx) (validators []posexported.ValidatorI) SessionBlockFrequency(ctx sdk.Ctx) (res int64) StakeDenom(ctx sdk.Ctx) (res string) }
type QueryACLParams ¶
type QueryACLParams struct{}
type QueryDAOParams ¶
type QueryDAOParams struct{}
type QueryUpgradeParams ¶
type QueryUpgradeParams struct{}
type SupplyKeeper ¶
type SupplyKeeper interface { // get total supply of tokens GetSupply(ctx sdk.Ctx) supplyexported.SupplyI // get the address of a module account GetModuleAddress(name string) sdk.Address // get the module account structure GetModuleAccount(ctx sdk.Ctx, moduleName string) supplyexported.ModuleAccountI // set module account structure SetModuleAccount(sdk.Ctx, supplyexported.ModuleAccountI) // send coins to/from module accounts SendCoinsFromModuleToModule(ctx sdk.Ctx, senderModule, recipientModule string, amt sdk.Coins) sdk.Error // send coins from module to validator SendCoinsFromModuleToAccount(ctx sdk.Ctx, senderModule string, recipientAddr sdk.Address, amt sdk.Coins) sdk.Error // send coins from validator to module SendCoinsFromAccountToModule(ctx sdk.Ctx, senderAddr sdk.Address, recipientModule string, amt sdk.Coins) sdk.Error // mint coins MintCoins(ctx sdk.Ctx, moduleName string, amt sdk.Coins) sdk.Error // burn coins BurnCoins(ctx sdk.Ctx, name string, amt sdk.Coins) sdk.Error }
SupplyKeeper defines the expected supply Keeper (noalias)