keeper

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewQuerier

func NewQuerier(keeper Keeper) sdk.Querier

NewQuerier creates a new sync Querier instance

Types

type Keeper

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

Keeper defines the sync module Keeper

func NewKeeper

func NewKeeper(
	cdc *codec.Codec, key sdk.StoreKey, paramSpace types.ParamSubspace,
	paramsKeeper params.Keeper, slashKeeper slash.Keeper, stakingKeeper staking.Keeper,
	guardKeeper guard.Keeper, validatorKeeper validator.Keeper,
) Keeper

NewKeeper returns a sync keeper. It handles: - submitting sync changes - depositing funds into changes, and activating upon sufficient funds being deposited - users voting on changes, 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) AddPullerReward added in v0.2.4

func (keeper Keeper) AddPullerReward(ctx sdk.Context, ethAddress string, amount sdk.Int)

func (Keeper) ApplyChange

func (keeper Keeper) ApplyChange(ctx sdk.Context, change types.Change) bool

func (Keeper) ApproveChange

func (keeper Keeper) ApproveChange(ctx sdk.Context, changeID uint64, voterAddr sdk.AccAddress) error

ApproveChange adds a vote on a specific change

func (Keeper) ConfirmParamProposal

func (keeper Keeper) ConfirmParamProposal(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) GetActiveChanges

func (keeper Keeper) GetActiveChanges(ctx sdk.Context) (changes types.Changes)

GetActiveChanges get all the active changes

func (Keeper) GetBondedValidators added in v0.2.4

func (keeper Keeper) GetBondedValidators(ctx sdk.Context) []staking.Validator

func (Keeper) GetChange

func (keeper Keeper) GetChange(ctx sdk.Context, changeID uint64) (change types.Change, ok bool)

GetChange get change from store by ID

func (Keeper) GetChangeID

func (keeper Keeper) GetChangeID(ctx sdk.Context) (changeID uint64, err error)

GetChangeID gets the highest change ID

func (Keeper) GetChanges

func (keeper Keeper) GetChanges(ctx sdk.Context) (changes types.Changes)

GetChanges returns all the changes from store

func (Keeper) GetChangesFiltered

func (keeper Keeper) GetChangesFiltered(ctx sdk.Context, params types.QueryChangesParams) []types.Change

GetChangesFiltered retrieves changes filtered by a given set of params which include pagination parameters along with voter and depositor addresses and a change status. The voter address will filter changes by whether or not that address has voted on changes. The depositor address will filter changes by whether or not that address has deposited to them. Finally, status will filter changes by status.

NOTE: If no filters are provided, all changes will be returned in paginated form.

func (Keeper) GetTallyParams

func (keeper Keeper) GetTallyParams(ctx sdk.Context) types.TallyParams

GetTallyParams returns the current TallyParam from the sync param store

func (Keeper) GetVotingParams

func (keeper Keeper) GetVotingParams(ctx sdk.Context) types.VotingParams

GetVotingParams returns the current VotingParams from the sync param store

func (Keeper) GuardProof

func (keeper Keeper) GuardProof(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) GuardTrigger

func (keeper Keeper) GuardTrigger(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) InitGuardRequest

func (keeper Keeper) InitGuardRequest(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) InsertActiveChangeQueue

func (keeper Keeper) InsertActiveChangeQueue(ctx sdk.Context, changeID uint64)

InsertActiveChangeQueue inserts a ID into the active change queue

func (Keeper) IterateChanges

func (keeper Keeper) IterateChanges(ctx sdk.Context, cb func(change types.Change) (stop bool))

IterateChanges iterates over the all the changes and performs a callback function

func (Keeper) PullerReward

func (keeper Keeper) PullerReward(ctx sdk.Context) sdk.Int

func (Keeper) RemoveFromActiveChangeQueue

func (keeper Keeper) RemoveFromActiveChangeQueue(ctx sdk.Context, changeID uint64)

RemoveFromActiveChangeQueue removes a changeID from the Active Change Queue

func (Keeper) SetChange

func (keeper Keeper) SetChange(ctx sdk.Context, change types.Change)

SetChange set a change to store

func (Keeper) SetChangeID

func (keeper Keeper) SetChangeID(ctx sdk.Context, changeID uint64)

SetChangeID sets the new change ID to the store

func (Keeper) SetTallyParams

func (keeper Keeper) SetTallyParams(ctx sdk.Context, tallyParams types.TallyParams)

SetTallyParams sets TallyParams to the sync param store

func (Keeper) SetVotingParams

func (keeper Keeper) SetVotingParams(ctx sdk.Context, votingParams types.VotingParams)

SetVotingParams sets VotingParams to the sync param store

func (Keeper) SubmitChange

func (keeper Keeper) SubmitChange(ctx sdk.Context, changeType string, data []byte, blockNum uint64, initiatorAddr sdk.AccAddress) (types.Change, error)

SubmitChange create new change given a content

func (Keeper) Subscribe

func (keeper Keeper) Subscribe(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) SyncDelegator

func (keeper Keeper) SyncDelegator(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) SyncValidator

func (keeper Keeper) SyncValidator(ctx sdk.Context, change types.Change) (bool, error)

func (Keeper) UpdateSidechainAddr

func (keeper Keeper) UpdateSidechainAddr(ctx sdk.Context, change types.Change) (bool, error)

Jump to

Keyboard shortcuts

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