keeper

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Keeper

type Keeper struct {
	Params collections.Item[types.Params]
	// contains filtered or unexported fields
}

Keeper of the vote store

func NewKeeper

func NewKeeper(
	cdc codec.Codec, storeService corestore.KVStoreService,
	referralKeeper types.ReferralKeeper, authority sdk.AccAddress,
	router baseapp.MessageRouter, accountKeeper types.AccountKeeper,
) Keeper

NewKeeper creates a vote keeper

func (Keeper) AddGovernor

func (k Keeper) AddGovernor(ctx sdk.Context, gov sdk.AccAddress) error

func (Keeper) AddProposalHistoryRecord

func (k Keeper) AddProposalHistoryRecord(ctx sdk.Context, record types.ProposalHistoryRecord)

func (Keeper) Answer

func (k Keeper) Answer(ctx sdk.Context, acc string, yes bool) error

func (Keeper) BeginBlock

func (k Keeper) BeginBlock(ctx sdk.Context) error

func (Keeper) EndPoll

func (k Keeper) EndPoll(ctx sdk.Context)

func (Keeper) EndPollHandler

func (k Keeper) EndPollHandler(ctx sdk.Context, _ []byte, _ time.Time)

func (Keeper) EndProposal

func (k Keeper) EndProposal(ctx sdk.Context, proposal types.Proposal, agreed bool)

func (Keeper) GetAgreed

func (k Keeper) GetAgreed(ctx sdk.Context) (gov types.Government)

func (Keeper) GetCurrentPoll

func (k Keeper) GetCurrentPoll(ctx sdk.Context) (poll types.Poll, ok bool)

func (Keeper) GetCurrentProposal

func (k Keeper) GetCurrentProposal(ctx sdk.Context) *types.Proposal

func (Keeper) GetDisagreed

func (k Keeper) GetDisagreed(ctx sdk.Context) (gov types.Government)

func (Keeper) GetGovernment

func (k Keeper) GetGovernment(ctx sdk.Context) types.Government

func (Keeper) GetHistory

func (k Keeper) GetHistory(ctx sdk.Context, limit int32, page int32) []types.ProposalHistoryRecord

func (Keeper) GetParams

func (k Keeper) GetParams(ctx sdk.Context) (params types.Params)

GetParams returns the total set of referral parameters.

func (Keeper) GetPollHistory

func (k Keeper) GetPollHistory(ctx sdk.Context, limit int32, page int32) []types.PollHistoryItem

func (Keeper) GetPollHistoryAll

func (k Keeper) GetPollHistoryAll(ctx sdk.Context) []types.PollHistoryItem

func (Keeper) GetPollStatus

func (k Keeper) GetPollStatus(ctx sdk.Context) (yes, no uint64)

func (Keeper) GetStartBlock

func (k Keeper) GetStartBlock(ctx sdk.Context) int64

func (Keeper) IterateThroughCurrentPollAnswers

func (k Keeper) IterateThroughCurrentPollAnswers(ctx sdk.Context, callback func(acc string, ans bool) (stop bool)) (err error)

func (Keeper) LoadPolls

func (k Keeper) LoadPolls(ctx sdk.Context, state types.GenesisState)

func (Keeper) Logger

func (k Keeper) Logger(ctx sdk.Context) log.Logger

Logger returns a module-specific logger.

func (Keeper) Propose

func (k Keeper) Propose(ctx sdk.Context, msg types.MsgPropose) error

func (Keeper) RemoveGovernor

func (k Keeper) RemoveGovernor(ctx sdk.Context, gov sdk.AccAddress) error

func (Keeper) Router

func (k Keeper) Router() baseapp.MessageRouter

func (Keeper) SaveProposalToHistory

func (k Keeper) SaveProposalToHistory(ctx sdk.Context, store corestore.KVStore)

func (Keeper) SetAgreed

func (k Keeper) SetAgreed(ctx sdk.Context, agreed types.Government)

func (Keeper) SetCurrentProposal

func (k Keeper) SetCurrentProposal(ctx sdk.Context, proposal types.Proposal)

func (Keeper) SetDisagreed

func (k Keeper) SetDisagreed(ctx sdk.Context, disagreed types.Government)

func (Keeper) SetGovernment

func (k Keeper) SetGovernment(ctx sdk.Context, gov types.Government)

func (Keeper) SetParams

func (k Keeper) SetParams(ctx sdk.Context, params types.Params)

SetParams sets the referral parameters to the param space.

func (Keeper) SetStartBlock

func (k Keeper) SetStartBlock(ctx sdk.Context)

func (Keeper) StartPoll

func (k Keeper) StartPoll(ctx sdk.Context, poll types.Poll) error

func (Keeper) Validate

func (k Keeper) Validate(gov types.Government,
	aGov types.Government,
	dGov types.Government,
) (complete bool, agreed bool)

func (Keeper) Vote

func (k Keeper) Vote(ctx sdk.Context, voter sdk.AccAddress, agree bool) error

type MsgServer

type MsgServer Keeper

func (MsgServer) AddGovernor

func (MsgServer) AnswerPoll

func (MsgServer) Propose

func (MsgServer) RemoveGovernor

func (MsgServer) StartPoll

func (MsgServer) UpdateParams

func (MsgServer) Vote

type QueryServer

type QueryServer struct {
	Keeper
}

func (QueryServer) Current

func (QueryServer) Government

func (QueryServer) History

func (QueryServer) Params

func (QueryServer) Poll

func (QueryServer) PollHistory

Jump to

Keyboard shortcuts

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