keeper

package
v0.0.0-...-3a28d7b Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2023 License: Apache-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetResultFromAcknowledgement

func GetResultFromAcknowledgement(acknowledgement []byte) ([]byte, error)

func NewMsgServerImpl

func NewMsgServerImpl(keeper *Keeper) types.MsgServer

Types

type Keeper

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

func NewKeeper

func NewKeeper(
	cdc codec.Codec,
	storeKey storetypes.StoreKey,
	scopedKeeper restaking.ScopedKeeper,
	bankKeeper restaking.BankKeeper,
	channelKeeper restaking.ChannelKeeper,
	portKeeper restaking.PortKeeper,
	connectionKeeper restaking.ConnectionKeeper,
	clientKeeper restaking.ClientKeeper,
	ibcTransferKeeper restaking.IBCTransferKeeper,
) Keeper

func (Keeper) AfterDelegationSharesModified

func (k Keeper) AfterDelegationSharesModified(ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress)

func (Keeper) BindPort

func (k Keeper) BindPort(ctx sdk.Context, portID string) error

BindPort defines a wrapper function for the ort Keeper's function in order to expose it to module's InitGenesis function

func (Keeper) ClaimCapability

func (k Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error

func (Keeper) CompleteUnbonding

func (k Keeper) CompleteUnbonding(ctx sdk.Context, delAddr sdk.AccAddress, opAddr sdk.AccAddress) (sdk.Coins, error)

func (Keeper) Delegate

func (k Keeper) Delegate(ctx sdk.Context, delegatorAccAddr sdk.AccAddress, operatorAccAddr sdk.AccAddress, amount math.Int) error

func (Keeper) DeleteConsumerAdditionProposal

func (k Keeper) DeleteConsumerAdditionProposal(ctx sdk.Context, chainID string)

func (Keeper) DeleteConsumerValidator

func (k Keeper) DeleteConsumerValidator(ctx sdk.Context, clientID string, valAddr string)

func (Keeper) DeleteDelegationStartInfo

func (k Keeper) DeleteDelegationStartInfo(ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress)

func (Keeper) DeleteOperatorDelegateRecordByKey

func (k Keeper) DeleteOperatorDelegateRecordByKey(ctx sdk.Context, key string)

func (Keeper) DeleteUnbondingIndex

func (k Keeper) DeleteUnbondingIndex(ctx sdk.Context, id uint64)

func (Keeper) DequeueAllMatureUBDQueue

func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, currTime time.Time) (matureUnbonds []types.DOPair)

func (Keeper) EndBlock

func (k Keeper) EndBlock(ctx sdk.Context, req abci.RequestEndBlock)

func (Keeper) GetAllOperators

func (k Keeper) GetAllOperators(ctx sdk.Context) (operators []types.Operator)

func (Keeper) GetCallback

func (k Keeper) GetCallback(ctx sdk.Context, channelID, portID string, seq uint64) (*types.IBCCallback, bool)

func (Keeper) GetConsumerAdditionProposal

func (k Keeper) GetConsumerAdditionProposal(ctx sdk.Context, chainID string) (*types.ConsumerAdditionProposal, bool)

func (Keeper) GetConsumerAdditionPropsToExecute

func (k Keeper) GetConsumerAdditionPropsToExecute(ctx sdk.Context) (propsToExecute []types.ConsumerAdditionProposal)

func (Keeper) GetConsumerClientID

func (k Keeper) GetConsumerClientID(ctx sdk.Context, chainID string) ([]byte, bool)

func (Keeper) GetConsumerClientIDByChannel

func (k Keeper) GetConsumerClientIDByChannel(ctx sdk.Context, srcPortID, srcChannelID string) (string, error)

func (Keeper) GetConsumerClientIDToChannel

func (k Keeper) GetConsumerClientIDToChannel(ctx sdk.Context, clientID string) (string, bool)

func (Keeper) GetConsumerClientIDToTransferChannel

func (k Keeper) GetConsumerClientIDToTransferChannel(ctx sdk.Context, clientID string) (string, bool)

func (Keeper) GetConsumerRestakingToken

func (k Keeper) GetConsumerRestakingToken(ctx sdk.Context, clientID string) []string

func (Keeper) GetConsumerRewardToken

func (k Keeper) GetConsumerRewardToken(ctx sdk.Context, clientID string) []string

func (Keeper) GetConsumerValidator

func (k Keeper) GetConsumerValidator(ctx sdk.Context, clientID string, valAddr string) (*types.ConsumerValidator, bool)

func (Keeper) GetConsumerValidators

func (k Keeper) GetConsumerValidators(ctx sdk.Context, clientID string, maxRetrieve uint32) (validators []types.ConsumerValidator)

func (Keeper) GetDelegation

func (k Keeper) GetDelegation(ctx sdk.Context, ownerAddr, operatorAddr sdk.AccAddress) (*types.Delegation, bool)

func (Keeper) GetDelegationStartInfo

func (k Keeper) GetDelegationStartInfo(
	ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress,
) (starting types.DelegationStartingInfo, found bool)

func (Keeper) GetOperator

func (k Keeper) GetOperator(ctx sdk.Context, operatorAccAddr sdk.AccAddress) (*types.Operator, bool)

func (Keeper) GetOperatorDelegateRecord

func (k Keeper) GetOperatorDelegateRecord(ctx sdk.Context, blockHeight uint64, operatorAccAddr sdk.AccAddress) (*types.OperatorDelegationRecord, bool)

TODO convert blockHeight to epoch?

func (Keeper) GetOperatorDelegateRecordByKey

func (k Keeper) GetOperatorDelegateRecordByKey(ctx sdk.Context, key string) (*types.OperatorDelegationRecord, bool)

func (Keeper) GetOperatorHistoricalRewards

func (k Keeper) GetOperatorHistoricalRewards(ctx sdk.Context, period uint64, operatorAccAddr sdk.AccAddress) (history types.OperatorHistoricalRewards, found bool)

func (Keeper) GetOperatorLastRewardPeriod

func (k Keeper) GetOperatorLastRewardPeriod(ctx sdk.Context, operatorAccAddr sdk.AccAddress) (uint64, bool)

func (Keeper) GetOperatorUndelegationRecord

func (k Keeper) GetOperatorUndelegationRecord(ctx sdk.Context, blockHeight uint64, operatorAccAddr sdk.AccAddress) (*types.OperatorUndelegationRecord, bool)

func (Keeper) GetOperatorUndelegationRecordByKey

func (k Keeper) GetOperatorUndelegationRecordByKey(ctx sdk.Context, key string) (*types.OperatorUndelegationRecord, bool)

func (Keeper) GetOperatorWithdrawRewardRecordByKey

func (k Keeper) GetOperatorWithdrawRewardRecordByKey(ctx sdk.Context, recordKey string) (types.OperatorWithdrawRewardRecord, bool)

func (Keeper) GetPort

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

GetPort returns the portID for the CCV module. Used in ExportGenesis

func (Keeper) GetTemplateClient

func (k Keeper) GetTemplateClient(ctx sdk.Context) *ibctm.ClientState

GetTemplateClient returns the template client for provider proposals

func (Keeper) GetUBDQueueTimeSlice

func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DOPair)

func (Keeper) GetUnbondingDelegation

func (k Keeper) GetUnbondingDelegation(ctx sdk.Context, delAddr sdk.AccAddress, opAddr sdk.AccAddress) (ubd types.UnbondingDelegation, found bool)

func (Keeper) GetUnbondingDelegationByUnbondingID

func (k Keeper) GetUnbondingDelegationByUnbondingID(ctx sdk.Context, id uint64) (ubd types.UnbondingDelegation, found bool)

func (Keeper) GetUnderlyingClient

func (k Keeper) GetUnderlyingClient(ctx sdk.Context, connectionID string) (
	clientID string, tmClient *ibctm.ClientState, err error,
)

Retrieves the underlying client state corresponding to a connection ID.

func (Keeper) GetUnderlyingConnection

func (k Keeper) GetUnderlyingConnection(ctx sdk.Context, srcPortID, srcChannelID string) (string, error)

func (Keeper) GetWithdrawRewardRecordKeyFromTransferID

func (k Keeper) GetWithdrawRewardRecordKeyFromTransferID(ctx sdk.Context, transferID string) ([]byte, bool)

func (Keeper) HandleConsumerAdditionProposal

func (k Keeper) HandleConsumerAdditionProposal(ctx sdk.Context, proposal *types.ConsumerAdditionProposal) error

func (Keeper) HandleIBCAcknowledgement

func (k Keeper) HandleIBCAcknowledgement(ctx sdk.Context, packet *channeltypes.Packet, acknowledgement []byte) error

func (Keeper) HandleOperatorWithdrawRewardCallback

func (k Keeper) HandleOperatorWithdrawRewardCallback(
	ctx sdk.Context,
	packet *channeltypes.Packet,
	acknowledgement []byte,
	callback *types.IBCCallback,
) error

func (Keeper) HasDelegationStartInfo

func (k Keeper) HasDelegationStartInfo(ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress) bool

func (Keeper) IncrementUnbondingID

func (k Keeper) IncrementUnbondingID(ctx sdk.Context) (unbondingID uint64)

func (Keeper) InitGenesis

func (k Keeper) InitGenesis(ctx sdk.Context, state *types.GenesisState) []abci.ValidatorUpdate

func (Keeper) InsertUBDQueue

func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd types.UnbondingDelegation, completionTime time.Time)

func (Keeper) IsBound

func (k Keeper) IsBound(ctx sdk.Context, portID string) bool

func (Keeper) NotifyConsumerSlashOperator

func (k Keeper) NotifyConsumerSlashOperator(
	ctx sdk.Context,
	slashCoin sdk.Coin,
	operatorAddr string,
	slashValidator []types.OperatedValidator,
)

func (Keeper) OnOperatorReceiveAllRewards

func (k Keeper) OnOperatorReceiveAllRewards(ctx sdk.Context, operatorAccAddr sdk.AccAddress, rewards []sdk.Coin) error

OnOperatorReceiveAllRewards define a method for operator receive restaking reward. It should be called at ibc transfer ack. When receive rewards from all consumers then the operator start a new period

func (Keeper) OnRecvConsumerPacketData

func (k Keeper) OnRecvConsumerPacketData(
	ctx sdk.Context,
	packet channeltypes.Packet,
	consumerPacket restaking.ConsumerPacket,
) ibcexported.Acknowledgement

func (Keeper) OnRecvConsumerSlash

func (k Keeper) OnRecvConsumerSlash(
	ctx sdk.Context,
	consumerClientID string,
	slashList []restaking.ConsumerSlash,
) error

func (Keeper) OnRecvConsumerVSC

func (k Keeper) OnRecvConsumerVSC(
	ctx sdk.Context,
	consumerClientID string,
	changeList []restaking.ValidatorSetChange,
) ibcexported.Acknowledgement

func (Keeper) OnRecvIBCTransferPacket

func (k Keeper) OnRecvIBCTransferPacket(ctx sdk.Context, packet channeltypes.Packet) error

func (Keeper) ProcessCompletedUnbonding

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

func (Keeper) ProcessPendingOperatorDelegationRecord

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

func (Keeper) ProcessPendingOperatorUndelegationRecord

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

func (Keeper) RegisterOperator

func (k Keeper) RegisterOperator(ctx sdk.Context, msg types.MsgRegisterOperatorRequest) error

func (Keeper) RemoveUnbondingDelegation

func (k Keeper) RemoveUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)

RemoveUnbondingDelegation removes the unbonding delegation object and associated index.

func (Keeper) SendDelegation

func (k Keeper) SendDelegation(ctx sdk.Context, operator *types.Operator, amount math.Int)

TODO change amount type from math.Int to sdk.Coin

func (Keeper) SendUndelegation

func (k Keeper) SendUndelegation(ctx sdk.Context, operator *types.Operator, amount math.Int, entryIDs []uint64)

TODO change amount type from math.Int to sdk.Coin

func (Keeper) SetCallback

func (k Keeper) SetCallback(ctx sdk.Context, channelID, portID string, seq uint64, callback types.IBCCallback)

func (Keeper) SetConsumerAdditionProposal

func (k Keeper) SetConsumerAdditionProposal(ctx sdk.Context, prop *types.ConsumerAdditionProposal)

func (Keeper) SetConsumerClientID

func (k Keeper) SetConsumerClientID(ctx sdk.Context, chainID, clientID string)

func (Keeper) SetConsumerClientIDToChannel

func (k Keeper) SetConsumerClientIDToChannel(ctx sdk.Context, clientID, channelID string)

func (Keeper) SetConsumerClientIDToTransferChannel

func (k Keeper) SetConsumerClientIDToTransferChannel(ctx sdk.Context, clientID, channelID string)

func (Keeper) SetConsumerRestakingToken

func (k Keeper) SetConsumerRestakingToken(ctx sdk.Context, clientID string, tokens []string)

func (Keeper) SetConsumerRewardToken

func (k Keeper) SetConsumerRewardToken(ctx sdk.Context, clientID string, tokens []string)

func (Keeper) SetConsumerValidator

func (k Keeper) SetConsumerValidator(ctx sdk.Context, clientID string, validator types.ConsumerValidator)

func (Keeper) SetDelegation

func (k Keeper) SetDelegation(ctx sdk.Context, ownerAddr, operatorAddr sdk.AccAddress, delegation *types.Delegation)

func (Keeper) SetDelegationStartInfo

func (k Keeper) SetDelegationStartInfo(
	ctx sdk.Context,
	delegatorAccAddr, operatorAccAddr sdk.AccAddress,
	starting types.DelegationStartingInfo,
)

func (Keeper) SetOperator

func (k Keeper) SetOperator(ctx sdk.Context, operatorAccAddr sdk.AccAddress, operator *types.Operator)

func (Keeper) SetOperatorDelegateRecord

func (k Keeper) SetOperatorDelegateRecord(ctx sdk.Context, blockHeight uint64, record *types.OperatorDelegationRecord)

func (Keeper) SetOperatorDelegateRecordByKey

func (k Keeper) SetOperatorDelegateRecordByKey(ctx sdk.Context, key string, record *types.OperatorDelegationRecord)

func (Keeper) SetOperatorHistoricalRewards

func (k Keeper) SetOperatorHistoricalRewards(ctx sdk.Context, period uint64, operatorAccAddr sdk.AccAddress, history types.OperatorHistoricalRewards)

func (Keeper) SetOperatorLastRewardPeriod

func (k Keeper) SetOperatorLastRewardPeriod(ctx sdk.Context, operatorAccAddr sdk.AccAddress, period uint64)

func (Keeper) SetOperatorUndelegationRecord

func (k Keeper) SetOperatorUndelegationRecord(ctx sdk.Context, blockHeight uint64, record *types.OperatorUndelegationRecord)

func (Keeper) SetOperatorUndelegationRecordByKey

func (k Keeper) SetOperatorUndelegationRecordByKey(ctx sdk.Context, key string, record *types.OperatorUndelegationRecord)

func (Keeper) SetOperatorWithdrawRewardRecord

func (k Keeper) SetOperatorWithdrawRewardRecord(ctx sdk.Context, blockHeight uint64, operatorAccAddr sdk.AccAddress, withdraw *types.OperatorWithdrawRewardRecord)

func (Keeper) SetOperatorWithdrawRewardRecordByKey

func (k Keeper) SetOperatorWithdrawRewardRecordByKey(ctx sdk.Context, recordKey string, record *types.OperatorWithdrawRewardRecord)

func (Keeper) SetPort

func (k Keeper) SetPort(ctx sdk.Context, portID string)

SetPort sets the portID for the CCV module. Used in InitGenesis

func (Keeper) SetTransferIDToWithdrawRewardRecordKey

func (k Keeper) SetTransferIDToWithdrawRewardRecordKey(ctx sdk.Context, transferID, withdrawRecordKey string)

func (Keeper) SetUBDQueueTimeSlice

func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DOPair)

SetUBDQueueTimeSlice sets a specific unbonding queue timeslice.

func (Keeper) SetUnbondingDelegation

func (k Keeper) SetUnbondingDelegation(ctx sdk.Context, ubd types.UnbondingDelegation)

func (Keeper) SetUnbondingDelegationByUnbondingID

func (k Keeper) SetUnbondingDelegationByUnbondingID(ctx sdk.Context, ubd types.UnbondingDelegation, id uint64)

func (Keeper) SetUnbondingDelegationEntry

func (k Keeper) SetUnbondingDelegationEntry(
	ctx sdk.Context, creationHeight uint64, delAddr sdk.AccAddress, opAddr sdk.AccAddress, balance sdk.Coin,
) (entryID uint64)

func (Keeper) UBDQueueIterator

func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator

func (Keeper) Undelegate

func (k Keeper) Undelegate(ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress, amount math.Int) error

func (Keeper) VerifyConnectingConsumer

func (k Keeper) VerifyConnectingConsumer(ctx sdk.Context, tmClient *ibctm.ClientState) error

VerifyConnectingConsumer

func (Keeper) WithdrawDelegatorRewards

func (k Keeper) WithdrawDelegatorRewards(ctx sdk.Context, delegatorAccAddr, operatorAccAddr sdk.AccAddress) error

func (Keeper) WithdrawOperatorsReward

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

WithdrawOperatorsReward define a method to withdraw all operator restaking reward from consumer TODO there maybe to many operators, so call it by offChain service? or make a queues, don't iterate all operator?

type Querier

type Querier struct {
	*Keeper
}

Querier is used as Keeper will have duplicate methods if used directly, and gRPC names take precedence over keeper

func (Querier) Delegation

Delegation implements types.QueryServer.

func (Querier) DelegatorDelegations

DelegatorDelegations implements types.QueryServer.

func (Querier) DelegatorOperators

DelegatorOperators implements types.QueryServer.

func (Querier) DelegatorUnbondingDelegations

DelegatorUnbondingDelegations implements types.QueryServer.

func (Querier) Operator

Operator implements types.QueryServer.

func (Querier) OperatorDelegations

OperatorDelegations implements types.QueryServer.

func (Querier) OperatorUnbondingDelegations

OperatorUnbondingDelegations implements types.QueryServer.

func (Querier) Operators

Operators implements types.QueryServer.

func (Querier) UnbondingDelegation

UnbondingDelegation implements types.QueryServer.

Jump to

Keyboard shortcuts

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