keeper

package
v0.0.0-...-92848d0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: MIT Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMsgServerImpl

func NewMsgServerImpl(keeper *Keeper) types.MsgServer

NewMsgServerImpl returns an implementation of the bank MsgServer interface for the provided Keeper.

Types

type CustomMessenger

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

func CustomMessageDecorator

func CustomMessageDecorator(provKeeper *Keeper) *CustomMessenger

CustomMessageDecorator returns decorator for custom CosmWasm bindings messages

func (CustomMessenger) DispatchMsg

func (h CustomMessenger) DispatchMsg(ctx sdk.Context, contractAddr sdk.AccAddress, _ string, msg wasmvmtypes.CosmosMsg) ([]sdk.Event, [][]byte, error)

DispatchMsg executes on the contractMsg.

type Keeper

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

func NewKeeper

func NewKeeper(cdc codec.BinaryCodec, storeKey storetypes.StoreKey,
	authority string, bankKeeper types.BankKeeper, wasmKeeper types.WasmKeeper,
	stakingKeeper types.StakingKeeper, meshConsumer types.MeshSecurityConsumer,
) *Keeper

func (Keeper) ExportGenesis

func (k Keeper) ExportGenesis(ctx sdk.Context) *types.GenesisState

ExportGenesis returns the meshsecurity provider module's exported genesis.

func (Keeper) GetAuthority

func (k Keeper) GetAuthority() string

GetAuthority returns the x/staking module's authority.

func (Keeper) GetParams

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

GetParams gets the module's parameters.

func (Keeper) HandleBondMsg

func (k Keeper) HandleBondMsg(ctx sdk.Context, actor sdk.AccAddress, bondMsg *contract.BondMsg) ([]sdk.Event, [][]byte, error)

func (Keeper) HandleRestakeMsg

func (k Keeper) HandleRestakeMsg(ctx sdk.Context, actor sdk.AccAddress, restakeMsg *contract.RestakeMsg) ([]sdk.Event, [][]byte, error)

func (Keeper) HandleUnbondMsg

func (k Keeper) HandleUnbondMsg(ctx sdk.Context, actor sdk.AccAddress, unbondMsg *contract.UnbondMsg) ([]sdk.Event, [][]byte, error)

func (Keeper) HandleUnstakeMsg

func (k Keeper) HandleUnstakeMsg(ctx sdk.Context, actor sdk.AccAddress, unstakeMsg *contract.UnstakeMsg) ([]sdk.Event, [][]byte, error)

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, genState *types.GenesisState)

InitGenesis initializes the meshsecurity provider module's state from a provided genesis state.

func (Keeper) InstantUndelegate

func (k Keeper) InstantUndelegate(ctx sdk.Context, delAddr sdk.AccAddress, validator stakingtypes.Validator, sharesAmount sdk.Dec) (sdk.Coin, error)

func (Keeper) Logger

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

Logger returns a module-specific logger.

func (Keeper) NativeStakingAddress

func (k Keeper) NativeStakingAddress(ctx sdk.Context) string

NativeStakingAddress - Address of native staking contract

func (Keeper) SendJailHandlingMsg

func (k Keeper) SendJailHandlingMsg(ctx sdk.Context, contractAddr sdk.AccAddress, jailed []contract.ValidatorAddr, tombstoned []contract.ValidatorAddr) error

SendJailHandlingMsg send jail handling message to contract via sudo

func (Keeper) SetParams

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

SetParams sets the module's parameters.

func (Keeper) VaultAddress

func (k Keeper) VaultAddress(ctx sdk.Context) string

VaultAddress - Address of vault contract

type StakingDecorator

type StakingDecorator struct {
	slashingtypes.StakingKeeper
	// contains filtered or unexported fields
}

StakingDecorator decorate vanilla staking keeper to capture the jail and unjail events

func NewStakingDecorator

func NewStakingDecorator(stakingKeeper slashingtypes.StakingKeeper, k *Keeper) *StakingDecorator

NewStakingDecorator constructor

func (StakingDecorator) Jail

func (s StakingDecorator) Jail(ctx sdk.Context, consAddr sdk.ConsAddress)

Jail captures the jail event and calls the decorated staking keeper jail method

func (StakingDecorator) Slash

func (s StakingDecorator) Slash(ctx sdk.Context, consAddr sdk.ConsAddress, power int64, height int64, slashRatio sdk.Dec) math.Int

Slash captures the slash event and calls the decorated staking keeper slash method

func (StakingDecorator) SlashWithInfractionReason

func (s StakingDecorator) SlashWithInfractionReason(ctx sdk.Context, consAddr sdk.ConsAddress, infractionHeight int64, power int64, slashFactor sdk.Dec, infraction stakingtypes.Infraction) math.Int

SlashWithInfractionReason implementation doesn't require the infraction (types.Infraction) to work but is required by Interchain Security.

func (StakingDecorator) Unjail

func (s StakingDecorator) Unjail(ctx sdk.Context, consAddr sdk.ConsAddress)

Unjail captures the unjail event and calls the decorated staking keeper unjail method

type StakingKeeperAdapter

type StakingKeeperAdapter struct {
	types.SDKStakingKeeper
	// contains filtered or unexported fields
}

StakingKeeperAdapter is an adapter to enhance the vanilla sdk staking keeper with additional functionality required for MS. The methods match Osmosis SDK fork.

func NewStakingKeeperAdapter

func NewStakingKeeperAdapter(k types.SDKStakingKeeper, b types.SDKBankKeeper) *StakingKeeperAdapter

NewStakingKeeperAdapter constructor

func (StakingKeeperAdapter) InstantUndelegate

func (s StakingKeeperAdapter) InstantUndelegate(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress, sharesAmount sdk.Dec) (sdk.Coins, error)

InstantUndelegate allows another module account to undelegate while bypassing unbonding time. This function is a combination of Undelegate and CompleteUnbonding, but skips the creation and deletion of UnbondingDelegationEntry

The code is copied from the Osmosis SDK fork https://github.com/osmosis-labs/cosmos-sdk/blob/v0.45.0x-osmo-v9.3/x/staking/keeper/delegation.go#L757

Jump to

Keyboard shortcuts

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