keeper

package
v8.0.0-...-c6607cb Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckContractAddressIsDisabled

func CheckContractAddressIsDisabled(disabledPrecompiles []string, addr common.Address, methodId []byte) error

func NewLegacyQueryServer

func NewLegacyQueryServer(qs v1.QueryServer, k *Keeper) v1beta1.QueryServer

func NewMsgServerImpl

func NewMsgServerImpl(k *Keeper) types.MsgServerPro

NewMsgServerImpl returns an implementation of the gov msgServer interface for the provided Keeper.

Types

type Keeper

type Keeper struct {
	*govkeeper.Keeper

	CustomerParams collections.Map[string, types.CustomParams]
	FXSchema       collections.Schema
	// contains filtered or unexported fields
}

func (Keeper) ActivateVotingPeriod

func (keeper Keeper) ActivateVotingPeriod(ctx context.Context, proposal v1.Proposal) error

ActivateVotingPeriod activates the voting period of a proposal

func (Keeper) AddDeposit

func (keeper Keeper) AddDeposit(ctx context.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) CheckDisabledPrecompiles

func (keeper Keeper) CheckDisabledPrecompiles(ctx sdk.Context, contractAddress common.Address, methodId []byte) error

func (Keeper) GetCustomMsgQuorum

func (keeper Keeper) GetCustomMsgQuorum(ctx context.Context, defaultQuorum string, proposal v1.Proposal) string

func (Keeper) GetCustomMsgVotingPeriod

func (keeper Keeper) GetCustomMsgVotingPeriod(ctx context.Context, defaultVotingPeriod *time.Duration, proposal v1.Proposal) *time.Duration

func (Keeper) GetCustomParams

func (keeper Keeper) GetCustomParams(ctx context.Context, msgType string) (types.CustomParams, bool)

func (Keeper) GetDisabledMsgs

func (keeper Keeper) GetDisabledMsgs(ctx sdk.Context) []string

func (Keeper) GetMinDepositAmountFromProposalMsgs

func (keeper Keeper) GetMinDepositAmountFromProposalMsgs(ctx context.Context, defaultMinDeposit sdk.Coins, proposal v1.Proposal) (sdk.Coins, error)

func (Keeper) GetSwitchParams

func (keeper Keeper) GetSwitchParams(ctx sdk.Context) (params types.SwitchParams)

func (Keeper) HasDeposit

func (keeper Keeper) HasDeposit(ctx sdk.Context, proposalId uint64, depositor sdk.AccAddress) (bool, error)

func (Keeper) HasVote

func (keeper Keeper) HasVote(ctx sdk.Context, proposalId uint64, voter sdk.AccAddress) (bool, error)

func (Keeper) InitCustomParams

func (keeper Keeper) InitCustomParams(ctx sdk.Context) error

func (Keeper) IteratorActiveProposal

func (keeper Keeper) IteratorActiveProposal(ctx sdk.Context, t time.Time, fn func(proposal v1.Proposal) (bool, error)) error

func (Keeper) IteratorInactiveProposal

func (keeper Keeper) IteratorInactiveProposal(ctx sdk.Context, t time.Time, fn func(proposal v1.Proposal) (bool, error)) error

func (Keeper) SetSwitchParams

func (keeper Keeper) SetSwitchParams(ctx sdk.Context, params *types.SwitchParams) error

func (Keeper) Tally

func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error)

Tally iterates over the votes and updates the tally of a proposal based on the voting power of the voters

type QueryServer

type QueryServer struct {
	v1.QueryServer
	// contains filtered or unexported fields
}

func NewQueryServer

func NewQueryServer(k *Keeper) QueryServer

func (QueryServer) TallyResult

TallyResult queries the tally of a proposal vote

Jump to

Keyboard shortcuts

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