Documentation
¶
Index ¶
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- type EquivalentNativeCoinMultiplier
- type Hooks
- func (Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) AfterEpochEnd(ctx sdk.Context, _ string, _ int64)
- func (Hooks) AfterUnbondingInitiated(ctx sdk.Context, id uint64) error
- func (Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (Hooks) AfterValidatorCreated(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
- func (Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochNumber int64)
- func (Hooks) BeforeValidatorModified(ctx sdk.Context, valAddr sdk.ValAddress) error
- func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
- type Keeper
- func (k Keeper) AddMTStakingDenom(ctx sdk.Context, denom string) bool
- func (k Keeper) CalculateEquivalentNativeCoin(ctx sdk.Context, coin sdk.Coin) (targetCoin sdk.Coin, err error)
- func (k Keeper) CollectAgentsReward(ctx sdk.Context)
- func (k Keeper) CompleteUnbonding(ctx sdk.Context, delegatorAccAddr, agentAccAddr sdk.AccAddress) (sdk.Coins, error)
- func (k Keeper) DecreaseDelegatorAgentShares(ctx sdk.Context, shares math.Int, agentAddress, delegator sdk.AccAddress) error
- func (k Keeper) DequeueAllMatureUBDQueue(ctx sdk.Context, curTime time.Time) (matureUnbonds []types.DAPair)
- func (k Keeper) EndBlocker(ctx sdk.Context) ([]abci.ValidatorUpdate, error)
- func (k Keeper) GenerateAccount(ctx sdk.Context, prefix, suffix string) *authtypes.ModuleAccount
- func (k Keeper) GetAllAgent(ctx sdk.Context) []types.MTStakingAgent
- func (k Keeper) GetAllAgentsByVal(ctx sdk.Context, valAddr sdk.ValAddress) []types.MTStakingAgent
- func (k Keeper) GetDelegation(ctx sdk.Context, agentAddress, delegator sdk.AccAddress) (*types.MTStakingDelegation, bool)
- func (k Keeper) GetDelegatorAgentShares(ctx sdk.Context, agentAddress, delegator sdk.AccAddress) math.Int
- func (k Keeper) GetDelegatorWithdrawRewardHeight(ctx sdk.Context, delegatorAccAddr, agentAccAddr sdk.AccAddress) (int64, bool)
- func (k Keeper) GetEquivalentNativeCoinMultiplier(ctx sdk.Context, denom string) (multiplier sdk.Dec, found bool)
- func (k Keeper) GetMTStakingAgent(ctx sdk.Context, denom string, valAddr sdk.ValAddress) (*types.MTStakingAgent, bool)
- func (k Keeper) GetMTStakingAgentAddressByDenomAndVal(ctx sdk.Context, denom string, valAddr sdk.ValAddress) ([]byte, bool)
- func (k Keeper) GetMTStakingAgentByAddress(ctx sdk.Context, agentAccAddr sdk.AccAddress) (*types.MTStakingAgent, bool)
- func (k Keeper) GetMTStakingDenomWhiteList(ctx sdk.Context) (*types.MTStakingDenomWhiteList, bool)
- func (k Keeper) GetMTStakingUnbonding(ctx sdk.Context, agentAddress sdk.AccAddress, delegatorAddr sdk.AccAddress) (*types.MTStakingUnbondingDelegation, bool)
- func (k Keeper) GetOrCreateMTStakingAgent(ctx sdk.Context, denom string, validatorAddr sdk.ValAddress) *types.MTStakingAgent
- func (k Keeper) GetOrCreateMTStakingUnbonding(ctx sdk.Context, agentAddress, delegatorAddr sdk.AccAddress) *types.MTStakingUnbondingDelegation
- func (k Keeper) GetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time) (dvPairs []types.DAPair)
- func (k Keeper) GetUnbondingDelegationFromAgent(ctx sdk.Context, agentAddress sdk.AccAddress) (ubds []types.MTStakingUnbondingDelegation)
- func (k Keeper) HandleMultiTokenStakingAdditionProposal(ctx sdk.Context, proposal *types.AddNonNativeTokenToStakingProposal) error
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncreaseDelegatorAgentShares(ctx sdk.Context, shares math.Int, agentAddress, delegator sdk.AccAddress) error
- func (k Keeper) InsertUBDQueue(ctx sdk.Context, ubd *types.MTStakingUnbondingDelegation, ...)
- func (k Keeper) InstantSlash(ctx sdk.Context, valAddr sdk.ValAddress, delegator sdk.AccAddress, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MTStakingDelegate(ctx sdk.Context, delegatorAccAddr sdk.AccAddress, validatorAddr sdk.ValAddress, ...) (newShares math.Int, err error)
- func (k Keeper) MTStakingUndelegate(ctx sdk.Context, delegatorAccAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) (completeTime time.Time, err error)
- func (k Keeper) ProcessCompletedUnbonding(ctx sdk.Context)
- func (k Keeper) RefreshAgentDelegation(ctx sdk.Context, agent *types.MTStakingAgent) error
- func (k Keeper) RefreshAllAgentDelegation(ctx sdk.Context)
- func (k Keeper) RemoveMTStakingDenom(ctx sdk.Context, denom string) bool
- func (k Keeper) RemoveMTStakingUnbonding(ctx sdk.Context, agentAddress, delegatorAddr sdk.AccAddress)
- func (k Keeper) SetDelegatorWithdrawRewardHeight(ctx sdk.Context, delegatorAccAddr, agentAccAddr sdk.AccAddress, height int64) bool
- func (k Keeper) SetEquivalentNativeCoinMultiplier(ctx sdk.Context, epoch int64, denom string, multiplier sdk.Dec)
- func (k Keeper) SetMTStakingAgent(ctx sdk.Context, agentAccAddr sdk.AccAddress, agent *types.MTStakingAgent)
- func (k Keeper) SetMTStakingDenomAndValWithAgentAddress(ctx sdk.Context, agentAddress sdk.AccAddress, denom string, ...)
- func (k Keeper) SetMTStakingUnbondingDelegation(ctx sdk.Context, unbonding *types.MTStakingUnbondingDelegation)
- func (k Keeper) SetUBDQueueTimeSlice(ctx sdk.Context, timestamp time.Time, keys []types.DAPair)
- func (k Keeper) SlashAgentFromValidator(ctx sdk.Context, valAddr sdk.ValAddress, slashFactor sdk.Dec)
- func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.MTStakingUnbondingDelegation, ...) (totalSlashAmount math.Int)
- func (k Keeper) UBDQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator
- func (k Keeper) Unbond(ctx sdk.Context, delegatorAccAddr sdk.AccAddress, valAddr sdk.ValAddress, ...) error
- func (k Keeper) UpdateEquivalentNativeCoinMultiplier(ctx sdk.Context, epoch int64)
- func (k Keeper) WithdrawReward(ctx sdk.Context, valAddr sdk.ValAddress, stakeDenom string, ...) (sdk.Coin, error)
- type Querier
- func (k Querier) Agent(goCtx context.Context, req *types.QueryAgentRequest) (*types.QueryAgentResponse, error)
- func (k Querier) AgentDelegations(goCtx context.Context, req *types.QueryAgentDelegationsRequest) (*types.QueryAgentDelegationsResponse, error)
- func (k Querier) AgentUnbondingDelegations(goCtx context.Context, req *types.AgentUnbondingDelegationsRequest) (*types.AgentUnbondingDelegationsResponse, error)
- func (k Querier) Agents(goCtx context.Context, req *types.QueryAgentsRequest) (*types.QueryAgentsResponse, error)
- func (k Querier) Delegation(goCtx context.Context, req *types.DelegationRequest) (*types.DelegationResponse, error)
- func (k Querier) DelegatorAgents(goCtx context.Context, req *types.DelegatorAgentsRequest) (*types.DelegatorAgentsResponse, error)
- func (k Querier) DelegatorDelegations(goCtx context.Context, req *types.DelegatorDelegationsRequest) (*types.DelegatorDelegationsResponse, error)
- func (k Querier) DelegatorUnbondingDelegations(goCtx context.Context, req *types.DelegatorUnbondingDelegationsRequest) (*types.DelegatorUnbondingDelegationsResponse, error)
- func (k Querier) DenomAgents(goCtx context.Context, req *types.QueryDenomAgentsRequest) (*types.QueryDenomAgentsResponse, error)
- func (k Querier) UnbondingDelegation(goCtx context.Context, req *types.UnbondingDelegationRequest) (*types.UnbondingDelegationResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
Types ¶
type EquivalentNativeCoinMultiplier ¶
TODO Temporarily use this method to feed prices !!!
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (Hooks) AfterDelegationModified ¶
func (Hooks) AfterDelegationModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
AfterDelegationModified implements types.StakingHooks
func (Hooks) AfterUnbondingInitiated ¶
AfterUnbondingInitiated implements types.StakingHooks.
func (Hooks) AfterValidatorBeginUnbonding ¶
func (Hooks) AfterValidatorBeginUnbonding(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBeginUnbonding implements types.StakingHooks
func (Hooks) AfterValidatorBonded ¶
func (Hooks) AfterValidatorBonded(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorBonded implements types.StakingHooks
func (Hooks) AfterValidatorCreated ¶
AfterValidatorCreated implements types.StakingHooks
func (Hooks) AfterValidatorRemoved ¶
func (Hooks) AfterValidatorRemoved(ctx sdk.Context, consAddr sdk.ConsAddress, valAddr sdk.ValAddress) error
AfterValidatorRemoved implements types.StakingHooks
func (Hooks) BeforeDelegationCreated ¶
func (Hooks) BeforeDelegationCreated(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationCreated implements types.StakingHooks
func (Hooks) BeforeDelegationRemoved ¶
func (Hooks) BeforeDelegationRemoved(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationRemoved implements types.StakingHooks
func (Hooks) BeforeDelegationSharesModified ¶
func (Hooks) BeforeDelegationSharesModified(ctx sdk.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error
BeforeDelegationSharesModified implements types.StakingHooks
func (Hooks) BeforeEpochStart ¶
BeforeEpochStart implements types.EpochHooks
func (Hooks) BeforeValidatorModified ¶
BeforeValidatorModified implements types.StakingHooks
func (Hooks) BeforeValidatorSlashed ¶
func (h Hooks) BeforeValidatorSlashed(ctx sdk.Context, valAddr sdk.ValAddress, fraction sdk.Dec) error
BeforeValidatorSlashed implements types.StakingHooks
type Keeper ¶
type Keeper struct { EquivalentNativeCoinMultiplier EquivalentNativeCoinMultiplier // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, epochKeeper types.EpochKeeper, stakingKeeper types.StakingKeeper, distributionKeeper types.DistributionKeeper, ) Keeper
func (Keeper) AddMTStakingDenom ¶
func (Keeper) CalculateEquivalentNativeCoin ¶
func (Keeper) CollectAgentsReward ¶
CollectAgentsReward defines a method for withdraw staking reward for all agents. TODO let user call it.
func (Keeper) CompleteUnbonding ¶
func (Keeper) DecreaseDelegatorAgentShares ¶
func (Keeper) DequeueAllMatureUBDQueue ¶
func (Keeper) EndBlocker ¶
func (Keeper) GenerateAccount ¶
func (Keeper) GetAllAgent ¶
func (k Keeper) GetAllAgent(ctx sdk.Context) []types.MTStakingAgent
func (Keeper) GetAllAgentsByVal ¶
func (k Keeper) GetAllAgentsByVal(ctx sdk.Context, valAddr sdk.ValAddress) []types.MTStakingAgent
func (Keeper) GetDelegation ¶
func (k Keeper) GetDelegation(ctx sdk.Context, agentAddress, delegator sdk.AccAddress) (*types.MTStakingDelegation, bool)
func (Keeper) GetDelegatorAgentShares ¶
func (Keeper) GetDelegatorWithdrawRewardHeight ¶
func (Keeper) GetEquivalentNativeCoinMultiplier ¶
func (Keeper) GetMTStakingAgent ¶
func (k Keeper) GetMTStakingAgent(ctx sdk.Context, denom string, valAddr sdk.ValAddress) (*types.MTStakingAgent, bool)
func (Keeper) GetMTStakingAgentAddressByDenomAndVal ¶
func (Keeper) GetMTStakingAgentByAddress ¶
func (k Keeper) GetMTStakingAgentByAddress(ctx sdk.Context, agentAccAddr sdk.AccAddress) (*types.MTStakingAgent, bool)
func (Keeper) GetMTStakingDenomWhiteList ¶
func (Keeper) GetMTStakingUnbonding ¶
func (k Keeper) GetMTStakingUnbonding(ctx sdk.Context, agentAddress sdk.AccAddress, delegatorAddr sdk.AccAddress) (*types.MTStakingUnbondingDelegation, bool)
func (Keeper) GetOrCreateMTStakingAgent ¶
func (k Keeper) GetOrCreateMTStakingAgent(ctx sdk.Context, denom string, validatorAddr sdk.ValAddress) *types.MTStakingAgent
func (Keeper) GetOrCreateMTStakingUnbonding ¶
func (k Keeper) GetOrCreateMTStakingUnbonding(ctx sdk.Context, agentAddress, delegatorAddr sdk.AccAddress) *types.MTStakingUnbondingDelegation
func (Keeper) GetUBDQueueTimeSlice ¶
func (Keeper) GetUnbondingDelegationFromAgent ¶
func (k Keeper) GetUnbondingDelegationFromAgent(ctx sdk.Context, agentAddress sdk.AccAddress) (ubds []types.MTStakingUnbondingDelegation)
func (Keeper) HandleMultiTokenStakingAdditionProposal ¶
func (Keeper) IncreaseDelegatorAgentShares ¶
func (Keeper) InsertUBDQueue ¶
func (Keeper) InstantSlash ¶
func (k Keeper) InstantSlash(ctx sdk.Context, valAddr sdk.ValAddress, delegator sdk.AccAddress, slashCoin sdk.Coin) error
InstantSlash define a method for slash the delegator of an agent. TODO rename such as InstantSlashAgent?
func (Keeper) MTStakingDelegate ¶
func (Keeper) MTStakingUndelegate ¶
func (k Keeper) MTStakingUndelegate( ctx sdk.Context, delegatorAccAddr sdk.AccAddress, valAddr sdk.ValAddress, balance sdk.Coin, ) (completeTime time.Time, err error)
MTStakingUndelegate defines a method for performing an undelegation from a delegate and a validator. Delegator burn the shares of the agents. Then agent account begin undelegate.
func (Keeper) ProcessCompletedUnbonding ¶
func (Keeper) RefreshAgentDelegation ¶
func (Keeper) RefreshAllAgentDelegation ¶
RefreshAllAgentDelegation defines a method for updating all agent delegation amount base on current multiplier.
func (Keeper) RemoveMTStakingDenom ¶
func (Keeper) RemoveMTStakingUnbonding ¶
func (k Keeper) RemoveMTStakingUnbonding(ctx sdk.Context, agentAddress, delegatorAddr sdk.AccAddress)
func (Keeper) SetDelegatorWithdrawRewardHeight ¶
func (Keeper) SetEquivalentNativeCoinMultiplier ¶
func (Keeper) SetMTStakingAgent ¶
func (k Keeper) SetMTStakingAgent(ctx sdk.Context, agentAccAddr sdk.AccAddress, agent *types.MTStakingAgent)
func (Keeper) SetMTStakingDenomAndValWithAgentAddress ¶
func (k Keeper) SetMTStakingDenomAndValWithAgentAddress(ctx sdk.Context, agentAddress sdk.AccAddress, denom string, valAddr sdk.ValAddress)
func (Keeper) SetMTStakingUnbondingDelegation ¶
func (k Keeper) SetMTStakingUnbondingDelegation(ctx sdk.Context, unbonding *types.MTStakingUnbondingDelegation)
func (Keeper) SetUBDQueueTimeSlice ¶
func (Keeper) SlashAgentFromValidator ¶
func (k Keeper) SlashAgentFromValidator(ctx sdk.Context, valAddr sdk.ValAddress, slashFactor sdk.Dec)
SlashAgentFromValidator define a method to slash all agent which delegate to the slashed validator.
func (Keeper) SlashUnbondingDelegation ¶
func (k Keeper) SlashUnbondingDelegation(ctx sdk.Context, unbondingDelegation types.MTStakingUnbondingDelegation, infractionHeight int64, slashFactor sdk.Dec, ) (totalSlashAmount math.Int)
slash an unbonding delegation Refer to the design of cosmos sdk
func (Keeper) UBDQueueIterator ¶
UBDQueueIterator returns all the unbonding queue timeslices from time 0 until endTime.
func (Keeper) Unbond ¶
func (k Keeper) Unbond(ctx sdk.Context, delegatorAccAddr sdk.AccAddress, valAddr sdk.ValAddress, balance sdk.Coin) error
Unbond defines a method for removing shares from an agent by a delegator then agent undelegate funds from a validator.
func (Keeper) UpdateEquivalentNativeCoinMultiplier ¶
UpdateEquivalentNativeCoinMultiplier defines a method for updating the equivalent native coin multiplier for all token in white list
func (Keeper) WithdrawReward ¶
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) Agent ¶
func (k Querier) Agent(goCtx context.Context, req *types.QueryAgentRequest) (*types.QueryAgentResponse, error)
Agent implements types.QueryServer.
func (Querier) AgentDelegations ¶
func (k Querier) AgentDelegations(goCtx context.Context, req *types.QueryAgentDelegationsRequest) (*types.QueryAgentDelegationsResponse, error)
AgentDelegations implements types.QueryServer.
func (Querier) AgentUnbondingDelegations ¶
func (k Querier) AgentUnbondingDelegations(goCtx context.Context, req *types.AgentUnbondingDelegationsRequest) (*types.AgentUnbondingDelegationsResponse, error)
AgentUnbondingDelegations implements types.QueryServer.
func (Querier) Agents ¶
func (k Querier) Agents(goCtx context.Context, req *types.QueryAgentsRequest) (*types.QueryAgentsResponse, error)
Agents implements types.QueryServer.
func (Querier) Delegation ¶
func (k Querier) Delegation(goCtx context.Context, req *types.DelegationRequest) (*types.DelegationResponse, error)
Delegation implements types.QueryServer.
func (Querier) DelegatorAgents ¶
func (k Querier) DelegatorAgents(goCtx context.Context, req *types.DelegatorAgentsRequest) (*types.DelegatorAgentsResponse, error)
DelegatorAgents implements types.QueryServer.
func (Querier) DelegatorDelegations ¶
func (k Querier) DelegatorDelegations(goCtx context.Context, req *types.DelegatorDelegationsRequest) (*types.DelegatorDelegationsResponse, error)
DelegatorDelegations implements types.QueryServer.
func (Querier) DelegatorUnbondingDelegations ¶
func (k Querier) DelegatorUnbondingDelegations(goCtx context.Context, req *types.DelegatorUnbondingDelegationsRequest) (*types.DelegatorUnbondingDelegationsResponse, error)
DelegatorUnbondingDelegations implements types.QueryServer.
func (Querier) DenomAgents ¶
func (k Querier) DenomAgents(goCtx context.Context, req *types.QueryDenomAgentsRequest) (*types.QueryDenomAgentsResponse, error)
DenomAgents implements types.QueryServer.
func (Querier) UnbondingDelegation ¶
func (k Querier) UnbondingDelegation(goCtx context.Context, req *types.UnbondingDelegationRequest) (*types.UnbondingDelegationResponse, error)
UnbondingDelegation implements types.QueryServer.