Documentation ¶
Index ¶
- func NewLegacyMsgServerImpl(govAcct string, server govv1.MsgServer) govv1beta1.MsgServer
- func NewLegacyQueryServerImpl(qs govv1.QueryServer) govv1beta1.QueryServer
- func NewMsgServerImpl(k Keeper) govv1.MsgServer
- func NewQueryServerImpl(k Keeper) govv1.QueryServer
- type Keeper
- func (keeper Keeper) ActivateVotingPeriod(ctx sdk.Context, proposal v1.Proposal)
- func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, ...) (bool, error)
- func (keeper Keeper) DeleteAndBurnDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) DetermineProposalVote(proposal v1.Proposal) (v1.VoteOption, string, error)
- func (keeper Keeper) GetAllDeposits(ctx sdk.Context) (deposits v1.Deposits)
- func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit v1.Deposit, found bool)
- func (keeper Keeper) GetDeposits(ctx sdk.Context, proposalID uint64) (deposits v1.Deposits)
- func (keeper Keeper) IterateAllDeposits(ctx sdk.Context, cb func(deposit v1.Deposit) (stop bool))
- func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit v1.Deposit) (stop bool))
- func (keeper Keeper) RefundAndDeleteDeposits(ctx sdk.Context, proposalID uint64)
- func (keeper Keeper) SetDeposit(ctx sdk.Context, deposit v1.Deposit)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLegacyMsgServerImpl ¶
func NewLegacyMsgServerImpl(govAcct string, server govv1.MsgServer) govv1beta1.MsgServer
NewMsgServerImpl creates an implementation of the gov v1 MsgServer interface for the given keeper.
func NewLegacyQueryServerImpl ¶
func NewLegacyQueryServerImpl(qs govv1.QueryServer) govv1beta1.QueryServer
NewQueryServerImpl creates an implementation of the QueryServer interface for the given keeper
func NewMsgServerImpl ¶
NewMsgServerImpl creates an implementation of the gov v1 MsgServer interface for the given keeper.
func NewQueryServerImpl ¶
func NewQueryServerImpl(k Keeper) govv1.QueryServer
NewQueryServerImpl creates an implementation of the QueryServer interface for the given keeper.
Types ¶
type Keeper ¶
Keeper defines the governance module Keeper
func NewKeeper ¶
func NewKeeper( cdc codec.BinaryCodec, key storetypes.StoreKey, paramSpace govtypes.ParamSubspace, accountKeeper govtypes.AccountKeeper, bankKeeper govtypes.BankKeeper, stakingKeeper govtypes.StakingKeeper, legacyRouter govv1beta1.Router, router *baseapp.MsgServiceRouter, config customtypes.Config, ) Keeper
NewKeeper returns a governance keeper. It handles: - submitting governance proposals - depositing funds into proposals, and activating upon sufficient funds being deposited - users voting on proposals, with weight proportional to stake in the system - and tallying the result of the vote.
CONTRACT: the parameter Subspace must have the param key table already initialized
func (Keeper) ActivateVotingPeriod ¶
func (Keeper) AddDeposit ¶
func (keeper Keeper) AddDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (bool, error)
AddDeposit adds or updates a deposit of a specific depositor on a specific proposal. Activates voting period when appropriate and returns true in that case, else returns false.
func (Keeper) DeleteAndBurnDeposits ¶
DeleteAndBurnDeposits deletes and burn all the deposits on a specific proposal.
func (Keeper) DetermineProposalVote ¶
DetermineProposalVote determines if we should vote Yes, No or No With Veto on the given proposal. It submits our rules together with the summary and details to OpenAI
func (Keeper) GetAllDeposits ¶
GetAllDeposits returns all the deposits from the store
func (Keeper) GetDeposit ¶
func (keeper Keeper) GetDeposit(ctx sdk.Context, proposalID uint64, depositorAddr sdk.AccAddress) (deposit v1.Deposit, found bool)
GetDeposit gets the deposit of a specific depositor on a specific proposal
func (Keeper) GetDeposits ¶
GetDeposits returns all the deposits from a proposal
func (Keeper) IterateAllDeposits ¶
IterateAllDeposits iterates over all the stored deposits and performs a callback function
func (Keeper) IterateDeposits ¶
func (keeper Keeper) IterateDeposits(ctx sdk.Context, proposalID uint64, cb func(deposit v1.Deposit) (stop bool))
IterateDeposits iterates over all the proposals deposits and performs a callback function
func (Keeper) RefundAndDeleteDeposits ¶
RefundAndDeleteDeposits refunds and deletes all the deposits on a specific proposal.