Documentation ¶
Index ¶
- func GetResultFromAcknowledgement(acknowledgement []byte) ([]byte, error)
- func NewMsgServerImpl(keeper *Keeper) types.MsgServer
- type Hooks
- type Keeper
- func (k Keeper) AddSouceChain(ctx sdk.Context, sourceChain *types.SourceChain) error
- func (k Keeper) AfterWithdrawDelegateReward(ctx sdk.Context, sourceChain *types.SourceChain, reward math.Int) error
- func (k Keeper) ClaimUnbonding(ctx sdk.Context, deletator sdk.AccAddress, epoch uint64, chainID string) (math.Int, error)
- func (k Keeper) CreateProxyDelegationForEpoch(ctx sdk.Context, epochNumber uint64)
- func (k Keeper) CreateProxyUnbondingForEpoch(ctx sdk.Context, epochNumber uint64) *types.EpochProxyUnbonding
- func (k *Keeper) Delegate(ctx sdk.Context, chainID string, amount math.Int, caller sdk.AccAddress) (*types.ProxyDelegation, error)
- func (k Keeper) GetAllProxyDelegation(ctx sdk.Context) []types.ProxyDelegation
- func (k Keeper) GetCallBack(ctx sdk.Context, channel string, port string, sequence uint64) (*types.IBCCallback, bool)
- func (k Keeper) GetChianProxyDelegationID(ctx sdk.Context, chainID string, epochNumber uint64) (uint64, bool)
- func (k Keeper) GetDelegaionProcessingAmount(delegations []types.ProxyDelegation) map[string]math.Int
- func (k Keeper) GetEpochProxyUnboundings(ctx sdk.Context, epoch uint64) (*types.EpochProxyUnbonding, bool)
- func (k Keeper) GetProxyDelegation(ctx sdk.Context, id uint64) (*types.ProxyDelegation, bool)
- func (k Keeper) GetProxyDelegationID(ctx sdk.Context) uint64
- func (k Keeper) GetSourceChain(ctx sdk.Context, chainID string) (*types.SourceChain, bool)
- func (k Keeper) GetSourceChainAddr(ctx sdk.Context, connectionID string, ctlAddress string) (string, error)
- func (k Keeper) GetUserUnbonding(ctx sdk.Context, chainID string, epoch uint64, delegator string) (*types.UserUnbonding, bool)
- func (k Keeper) GetUserUnbondingID(ctx sdk.Context, id string) (*types.UserUnbonding, bool)
- func (k Keeper) HandleIBCAcknowledgement(ctx sdk.Context, packet *channeltypes.Packet, acknowledgement []byte) error
- func (k Keeper) Hooks() Hooks
- func (k Keeper) IncreaseProxyDelegationID(ctx sdk.Context) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) ProcessEpochProxyUnbondings(ctx sdk.Context, epoch uint64, proxyUnbondings []types.ProxyUnbonding) error
- func (k *Keeper) ProcessProxyDelegation(ctx sdk.Context, curEpochNumber uint64, records []types.ProxyDelegation)
- func (k Keeper) ProcessUndelegationEpoch(ctx sdk.Context, epochNumber uint64)
- func (k Keeper) RemoveCallBack(ctx sdk.Context, channel string, port string, sequence uint64)
- func (k Keeper) SetCallBack(ctx sdk.Context, channel string, port string, sequence uint64, ...)
- func (k Keeper) SetChainProxyDelegationID(ctx sdk.Context, chainID string, epochNumber uint64, delegationID uint64)
- func (k Keeper) SetDistriWithdrawAddress(ctx sdk.Context) error
- func (k Keeper) SetEpochProxyUnboundings(ctx sdk.Context, unbondings *types.EpochProxyUnbonding)
- func (k Keeper) SetProxyDelegation(ctx sdk.Context, id uint64, delegation *types.ProxyDelegation)
- func (k Keeper) SetSourceChain(ctx sdk.Context, sourceChain *types.SourceChain)
- func (k Keeper) SetUserUnbonding(ctx sdk.Context, userUnbonding *types.UserUnbonding)
- func (k Keeper) StartReinvest(ctx sdk.Context)
- func (k Keeper) Undelegate(ctx sdk.Context, chainID string, amount math.Int, delegator sdk.AccAddress) (*types.UserUnbonding, error)
- func (k Keeper) UpdateRedeemRate(ctx sdk.Context, delegations []types.ProxyDelegation)
- func (k Keeper) WithdrawDelegateReward(ctx sdk.Context, sourceChain *types.SourceChain) error
- type Querier
- func (k Querier) EpochProxyUnbonding(goCtx context.Context, req *types.QueryEpochProxyUnbondingRequest) (*types.QueryEpochProxyUnbondingResponse, error)
- func (k Querier) ProxyDelegation(goCtx context.Context, req *types.QueryProxyDelegationRequest) (*types.QueryProxyDelegationResponse, error)
- func (k Querier) SourceChain(goCtx context.Context, req *types.QuerySourceChainRequest) (*types.QuerySourceChainResponse, error)
- func (k Querier) UserUnbonding(goCtx context.Context, req *types.QueryUserUnbondingRequest) (*types.QueryUserUnbondingResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMsgServerImpl ¶
NewMsgServerImpl creates and returns a new types.MsgServer, fulfilling the interstaking Msg service interface
Types ¶
type Hooks ¶
type Hooks struct {
// contains filtered or unexported fields
}
func (Hooks) AfterEpochEnd ¶
AfterEpochEnd implements types.EpochHooks
type Keeper ¶
type Keeper struct {
// contains filtered or unexported fields
}
func NewKeeper ¶
func NewKeeper( cdc codec.Codec, storeKey storetypes.StoreKey, accountKeeper types.AccountKeeper, bankKeeper types.BankKeeper, epochKeeper types.EpochKeeper, ibcClientKeeper *ibckeeper.Keeper, icaCtlKeeper icacontrollerkeeper.Keeper, ibcTransferKeeper ibctransferkeeper.Keeper, ) Keeper
func (Keeper) AddSouceChain ¶
func (Keeper) AfterWithdrawDelegateReward ¶
func (Keeper) ClaimUnbonding ¶
func (k Keeper) ClaimUnbonding(ctx sdk.Context, deletator sdk.AccAddress, epoch uint64, chainID string) (math.Int, error)
ClaimUnbonding implement delegator claim reward and stake token.
func (Keeper) CreateProxyDelegationForEpoch ¶
CreateProxyDelegationForEpoch create a new ProxyDelegation in current epoch for all available chain. If current epoch already has ProxyDelegation for the chain, then do nothing
func (Keeper) CreateProxyUnbondingForEpoch ¶
func (k Keeper) CreateProxyUnbondingForEpoch(ctx sdk.Context, epochNumber uint64) *types.EpochProxyUnbonding
CreateProxyUnbondingForEpoch a new unbonding in current epoch.
func (*Keeper) Delegate ¶
func (k *Keeper) Delegate(ctx sdk.Context, chainID string, amount math.Int, caller sdk.AccAddress) (*types.ProxyDelegation, error)
Delegate performs a liquid stake delegation. delegator transfer the ibcToken to module account then get derivative token by the rate.
func (Keeper) GetAllProxyDelegation ¶
func (k Keeper) GetAllProxyDelegation(ctx sdk.Context) []types.ProxyDelegation
func (Keeper) GetCallBack ¶
func (Keeper) GetChianProxyDelegationID ¶
func (k Keeper) GetChianProxyDelegationID(ctx sdk.Context, chainID string, epochNumber uint64) (uint64, bool)
GetChianProxyDelegationID get ProxyDelegation's ID of a chain by epoch and chainID
func (Keeper) GetDelegaionProcessingAmount ¶
func (Keeper) GetEpochProxyUnboundings ¶
func (Keeper) GetProxyDelegation ¶
GetProxyDelegation return ProxyDelegation by id
func (Keeper) GetSourceChain ¶
GetSourceChain get source chain by chainID
func (Keeper) GetSourceChainAddr ¶
func (Keeper) GetUserUnbonding ¶
func (Keeper) GetUserUnbondingID ¶
func (Keeper) HandleIBCAcknowledgement ¶
func (Keeper) IncreaseProxyDelegationID ¶
func (Keeper) ProcessEpochProxyUnbondings ¶
func (*Keeper) ProcessProxyDelegation ¶
func (k *Keeper) ProcessProxyDelegation(ctx sdk.Context, curEpochNumber uint64, records []types.ProxyDelegation)
ProcessProxyDelegation start liquid stake on source chain with provide delegation records. This process will continue to advance the status of the ProxyDelegation according to the IBC ack. So here just start and restart the process.
func (Keeper) ProcessUndelegationEpoch ¶
ProcessUndelegationEpoch advance the Unbondings in the past epoch into the next status
func (Keeper) RemoveCallBack ¶
func (Keeper) SetCallBack ¶
func (Keeper) SetChainProxyDelegationID ¶
func (k Keeper) SetChainProxyDelegationID(ctx sdk.Context, chainID string, epochNumber uint64, delegationID uint64)
SetChianProxyDelegationID set ProxyDelegation's ID of chain at specific epoch and chainID
func (Keeper) SetDistriWithdrawAddress ¶
SetDistriWithdrawAddress set the sourcechain staking reward recipient. Only after successful, the sourcechain is available.
func (Keeper) SetEpochProxyUnboundings ¶
func (k Keeper) SetEpochProxyUnboundings(ctx sdk.Context, unbondings *types.EpochProxyUnbonding)
func (Keeper) SetProxyDelegation ¶
SetProxyDelegation store ProxyDelegation
func (Keeper) SetSourceChain ¶
func (k Keeper) SetSourceChain(ctx sdk.Context, sourceChain *types.SourceChain)
func (Keeper) SetUserUnbonding ¶
func (k Keeper) SetUserUnbonding(ctx sdk.Context, userUnbonding *types.UserUnbonding)
func (Keeper) StartReinvest ¶
func (Keeper) Undelegate ¶
func (Keeper) UpdateRedeemRate ¶
func (k Keeper) UpdateRedeemRate(ctx sdk.Context, delegations []types.ProxyDelegation)
UpdateRedeemRate update redeemrate for each source chain TODO Record the rate in the last few epochs, and then average?
func (Keeper) WithdrawDelegateReward ¶
type Querier ¶
type Querier struct {
Keeper
}
func (Querier) EpochProxyUnbonding ¶
func (k Querier) EpochProxyUnbonding(goCtx context.Context, req *types.QueryEpochProxyUnbondingRequest) ( *types.QueryEpochProxyUnbondingResponse, error, )
EpochProxyUnbonding implements types.QueryServer
func (Querier) ProxyDelegation ¶
func (k Querier) ProxyDelegation(goCtx context.Context, req *types.QueryProxyDelegationRequest) (*types.QueryProxyDelegationResponse, error)
ProxyDelegation implements types.QueryServer
func (Querier) SourceChain ¶
func (k Querier) SourceChain(goCtx context.Context, req *types.QuerySourceChainRequest) (*types.QuerySourceChainResponse, error)
SourceChain implements types.QueryServer
func (Querier) UserUnbonding ¶
func (k Querier) UserUnbonding(goCtx context.Context, req *types.QueryUserUnbondingRequest) (*types.QueryUserUnbondingResponse, error)
UserUnbonding implements types.QueryServer