Documentation ¶
Index ¶
- Constants
- Variables
- func GetDepositRecordIDBytes(id uint64) []byte
- func GetEpochUnbondingRecordIDBytes(id uint64) []byte
- func GetEpochUnbondingRecordIDFromBytes(bz []byte) uint64
- type Keeper
- func (k Keeper) AddHostZoneToEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64, chainId string, ...) (val *types.EpochUnbondingRecord, success bool)
- func (k Keeper) AppendDepositRecord(ctx sdk.Context, depositRecord types.DepositRecord) uint64
- func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks
- func (k Keeper) DepositRecord(c context.Context, req *types.QueryGetDepositRecordRequest) (*types.QueryGetDepositRecordResponse, error)
- func (k Keeper) DepositRecordAll(c context.Context, req *types.QueryAllDepositRecordRequest) (*types.QueryAllDepositRecordResponse, error)
- func (k Keeper) DepositRecordByHost(c context.Context, req *types.QueryDepositRecordByHostRequest) (*types.QueryDepositRecordByHostResponse, error)
- func (k Keeper) EpochUnbondingRecord(c context.Context, req *types.QueryGetEpochUnbondingRecordRequest) (*types.QueryGetEpochUnbondingRecordResponse, error)
- func (k Keeper) EpochUnbondingRecordAll(c context.Context, req *types.QueryAllEpochUnbondingRecordRequest) (*types.QueryAllEpochUnbondingRecordResponse, error)
- func (k Keeper) GetAllDepositRecord(ctx sdk.Context) (list []types.DepositRecord)
- func (k Keeper) GetAllEpochUnbondingRecord(ctx sdk.Context) (list []types.EpochUnbondingRecord)
- func (k Keeper) GetAllLSMTokenDeposit(ctx sdk.Context) []types.LSMTokenDeposit
- func (k Keeper) GetAllPreviousEpochUnbondingRecords(ctx sdk.Context, epochNumber uint64) (list []types.EpochUnbondingRecord)
- func (k Keeper) GetAllUserRedemptionRecord(ctx sdk.Context) (list []types.UserRedemptionRecord)
- func (k Keeper) GetDepositRecord(ctx sdk.Context, id uint64) (val types.DepositRecord, found bool)
- func (k Keeper) GetDepositRecordCount(ctx sdk.Context) uint64
- func (k Keeper) GetEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64) (val types.EpochUnbondingRecord, found bool)
- func (k Keeper) GetHostZoneUnbondingByChainId(ctx sdk.Context, epochNumber uint64, chainId string) (val *types.HostZoneUnbonding, found bool)
- func (k Keeper) GetLSMDepositsForHostZone(ctx sdk.Context, chainId string) []types.LSMTokenDeposit
- func (k Keeper) GetLSMDepositsForHostZoneWithStatus(ctx sdk.Context, chainId string, status types.LSMTokenDeposit_Status) []types.LSMTokenDeposit
- func (k Keeper) GetLSMTokenDeposit(ctx sdk.Context, chainId, denom string) (deposit types.LSMTokenDeposit, found bool)
- func (k Keeper) GetParams(ctx sdk.Context) types.Params
- func (k Keeper) GetTransferDepositRecordByEpochAndChain(ctx sdk.Context, epochNumber uint64, chainId string) (val *types.DepositRecord, found bool)
- func (k Keeper) GetUserRedemptionRecord(ctx sdk.Context, id string) (val types.UserRedemptionRecord, found bool)
- func (k Keeper) IBCTransferLSMToken(ctx sdk.Context, lsmTokenDeposit types.LSMTokenDeposit, ...) error
- func (k Keeper) IBCTransferNativeTokens(ctx sdk.Context, msg *transfertypes.MsgTransfer, ...) error
- func (k Keeper) IterateUserRedemptionRecords(ctx sdk.Context, ...)
- func (k Keeper) LSMDeposit(c context.Context, req *types.QueryLSMDepositRequest) (*types.QueryLSMDepositResponse, error)
- func (k Keeper) LSMDeposits(c context.Context, req *types.QueryLSMDepositsRequest) (*types.QueryLSMDepositsResponse, error)
- func (k Keeper) LSMTransferCallback(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) Logger(ctx sdk.Context) log.Logger
- func (k Keeper) MarshalTransferCallbackArgs(ctx sdk.Context, delegateCallback types.TransferCallback) ([]byte, error)
- func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
- func (k Keeper) OnTimeoutPacket(ctx sdk.Context, packet channeltypes.Packet) error
- func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
- func (k Keeper) RemoveDepositRecord(ctx sdk.Context, id uint64)
- func (k Keeper) RemoveEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64)
- func (k Keeper) RemoveLSMTokenDeposit(ctx sdk.Context, chainId, denom string)
- func (k Keeper) RemoveUserRedemptionRecord(ctx sdk.Context, id string)
- func (k Keeper) SetDepositRecord(ctx sdk.Context, depositRecord types.DepositRecord)
- func (k Keeper) SetDepositRecordCount(ctx sdk.Context, count uint64)
- func (k Keeper) SetEpochUnbondingRecord(ctx sdk.Context, epochUnbondingRecord types.EpochUnbondingRecord)
- func (k Keeper) SetHostZoneUnbondingRecord(ctx sdk.Context, epochNumber uint64, chainId string, ...) error
- func (k Keeper) SetHostZoneUnbondingStatus(ctx sdk.Context, chainId string, epochUnbondingRecordIds []uint64, ...) error
- func (k Keeper) SetLSMTokenDeposit(ctx sdk.Context, deposit types.LSMTokenDeposit)
- func (k Keeper) SetParams(ctx sdk.Context, params types.Params)
- func (k Keeper) SetUserRedemptionRecord(ctx sdk.Context, userRedemptionRecord types.UserRedemptionRecord)
- func (k Keeper) TransferCallback(ctx sdk.Context, packet channeltypes.Packet, ...) error
- func (k Keeper) UnmarshalTransferCallbackArgs(ctx sdk.Context, delegateCallback []byte) (*types.TransferCallback, error)
- func (k Keeper) UpdateLSMTokenDepositStatus(ctx sdk.Context, deposit types.LSMTokenDeposit, ...)
- func (k Keeper) UserRedemptionRecord(c context.Context, req *types.QueryGetUserRedemptionRecordRequest) (*types.QueryGetUserRedemptionRecordResponse, error)
- func (k Keeper) UserRedemptionRecordAll(c context.Context, req *types.QueryAllUserRedemptionRecordRequest) (*types.QueryAllUserRedemptionRecordResponse, error)
- func (k Keeper) UserRedemptionRecordForUser(c context.Context, req *types.QueryAllUserRedemptionRecordForUserRequest) (*types.QueryAllUserRedemptionRecordForUserResponse, error)
Constants ¶
const IBCCallbacksID_LSMTransfer = "lsm-transfer"
const IBCCallbacksID_NativeTransfer = "transfer"
Variables ¶
var ( // Timeout for the IBC transfer of the LSM Token to the host zone LSMDepositTransferTimeout = time.Hour * 24 // 1 day )
Functions ¶
func GetDepositRecordIDBytes ¶
GetDepositRecordIDBytes returns the byte representation of the ID
func GetEpochUnbondingRecordIDBytes ¶
GetEpochUnbondingRecordIDBytes returns the byte representation of the ID
func GetEpochUnbondingRecordIDFromBytes ¶
GetEpochUnbondingRecordIDFromBytes returns ID in uint64 format from a byte array
Types ¶
type Keeper ¶
type Keeper struct { // *cosmosibckeeper.Keeper Cdc codec.BinaryCodec AccountKeeper types.AccountKeeper TransferKeeper ibctransferkeeper.Keeper IBCKeeper ibckeeper.Keeper ICACallbacksKeeper icacallbackskeeper.Keeper // contains filtered or unexported fields }
func NewKeeper ¶
func NewKeeper( Cdc codec.BinaryCodec, storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, AccountKeeper types.AccountKeeper, TransferKeeper ibctransferkeeper.Keeper, ibcKeeper ibckeeper.Keeper, ICACallbacksKeeper icacallbackskeeper.Keeper, ) *Keeper
func (Keeper) AddHostZoneToEpochUnbondingRecord ¶
func (k Keeper) AddHostZoneToEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64, chainId string, hzu *types.HostZoneUnbonding) (val *types.EpochUnbondingRecord, success bool)
Adds a HostZoneUnbonding to an EpochUnbondingRecord TODO [cleanup]: Return error instead of success
func (Keeper) AppendDepositRecord ¶
AppendDepositRecord appends a depositRecord in the store with a new id and update the count
func (Keeper) Callbacks ¶
func (k Keeper) Callbacks() icacallbackstypes.ModuleCallbacks
func (Keeper) DepositRecord ¶
func (k Keeper) DepositRecord(c context.Context, req *types.QueryGetDepositRecordRequest) (*types.QueryGetDepositRecordResponse, error)
func (Keeper) DepositRecordAll ¶
func (k Keeper) DepositRecordAll(c context.Context, req *types.QueryAllDepositRecordRequest) (*types.QueryAllDepositRecordResponse, error)
func (Keeper) DepositRecordByHost ¶
func (k Keeper) DepositRecordByHost(c context.Context, req *types.QueryDepositRecordByHostRequest) (*types.QueryDepositRecordByHostResponse, error)
func (Keeper) EpochUnbondingRecord ¶
func (k Keeper) EpochUnbondingRecord(c context.Context, req *types.QueryGetEpochUnbondingRecordRequest) (*types.QueryGetEpochUnbondingRecordResponse, error)
func (Keeper) EpochUnbondingRecordAll ¶
func (k Keeper) EpochUnbondingRecordAll(c context.Context, req *types.QueryAllEpochUnbondingRecordRequest) (*types.QueryAllEpochUnbondingRecordResponse, error)
func (Keeper) GetAllDepositRecord ¶
func (k Keeper) GetAllDepositRecord(ctx sdk.Context) (list []types.DepositRecord)
GetAllDepositRecord returns all depositRecord
func (Keeper) GetAllEpochUnbondingRecord ¶
func (k Keeper) GetAllEpochUnbondingRecord(ctx sdk.Context) (list []types.EpochUnbondingRecord)
GetAllEpochUnbondingRecord returns all epochUnbondingRecord
func (Keeper) GetAllLSMTokenDeposit ¶
func (k Keeper) GetAllLSMTokenDeposit(ctx sdk.Context) []types.LSMTokenDeposit
func (Keeper) GetAllPreviousEpochUnbondingRecords ¶
func (k Keeper) GetAllPreviousEpochUnbondingRecords(ctx sdk.Context, epochNumber uint64) (list []types.EpochUnbondingRecord)
GetAllPreviousEpochUnbondingRecords returns all epochUnbondingRecords prior to a given epoch
func (Keeper) GetAllUserRedemptionRecord ¶
func (k Keeper) GetAllUserRedemptionRecord(ctx sdk.Context) (list []types.UserRedemptionRecord)
GetAllUserRedemptionRecord returns all userRedemptionRecord
func (Keeper) GetDepositRecord ¶
GetDepositRecord returns a depositRecord from its id
func (Keeper) GetDepositRecordCount ¶
GetDepositRecordCount get the total number of depositRecord
func (Keeper) GetEpochUnbondingRecord ¶
func (k Keeper) GetEpochUnbondingRecord(ctx sdk.Context, epochNumber uint64) (val types.EpochUnbondingRecord, found bool)
GetEpochUnbondingRecord returns a epochUnbondingRecord from its id
func (Keeper) GetHostZoneUnbondingByChainId ¶
func (k Keeper) GetHostZoneUnbondingByChainId(ctx sdk.Context, epochNumber uint64, chainId string) (val *types.HostZoneUnbonding, found bool)
GetEpochUnbondingRecordByEpoch returns a epochUnbondingRecord from its epochNumber
func (Keeper) GetLSMDepositsForHostZone ¶
func (Keeper) GetLSMDepositsForHostZoneWithStatus ¶
func (k Keeper) GetLSMDepositsForHostZoneWithStatus(ctx sdk.Context, chainId string, status types.LSMTokenDeposit_Status) []types.LSMTokenDeposit
func (Keeper) GetLSMTokenDeposit ¶
func (Keeper) GetTransferDepositRecordByEpochAndChain ¶
func (Keeper) GetUserRedemptionRecord ¶
func (k Keeper) GetUserRedemptionRecord(ctx sdk.Context, id string) (val types.UserRedemptionRecord, found bool)
GetUserRedemptionRecord returns a userRedemptionRecord from its id
func (Keeper) IBCTransferLSMToken ¶
func (k Keeper) IBCTransferLSMToken( ctx sdk.Context, lsmTokenDeposit types.LSMTokenDeposit, transferChannelID string, hostZoneDepositAddress string, hostZoneDelegationICAAddress string, ) error
Transfer's LSM Tokens to the host from LSMLiquidStakes This is invoked immediately after the LSMLiquidStake
func (Keeper) IBCTransferNativeTokens ¶
func (k Keeper) IBCTransferNativeTokens(ctx sdk.Context, msg *transfertypes.MsgTransfer, depositRecord types.DepositRecord) error
Transfers native tokens, accumulated from normal liquid stakes, to the host zone This is invoked epochly
func (Keeper) IterateUserRedemptionRecords ¶
func (k Keeper) IterateUserRedemptionRecords(ctx sdk.Context, fn func(index int64, userRedemptionRecord types.UserRedemptionRecord) (stop bool), )
IterateUserRedemptionRecords iterates zones
func (Keeper) LSMDeposit ¶
func (k Keeper) LSMDeposit(c context.Context, req *types.QueryLSMDepositRequest) (*types.QueryLSMDepositResponse, error)
func (Keeper) LSMDeposits ¶
func (k Keeper) LSMDeposits(c context.Context, req *types.QueryLSMDepositsRequest) (*types.QueryLSMDepositsResponse, error)
func (Keeper) LSMTransferCallback ¶
func (k Keeper) LSMTransferCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error
Callback after an LSM token is IBC tranferred to the host zone
If successful: mark the LSM Token status as DETOKENIZATION_QUEUE If failure: mark the LSM Token status as FAILED If timeout: revert the LSM Token status back to TRANSFER_QUEUE so it gets resubmitted
func (Keeper) MarshalTransferCallbackArgs ¶
func (Keeper) OnAcknowledgementPacket ¶
func (k Keeper) OnAcknowledgementPacket(ctx sdk.Context, packet channeltypes.Packet, acknowledgement []byte) error
OnAcknowledgementPacket unmarshals the acknowledgement object to determine if the ack was successful and then passes that to the ICACallback If this packet does not have associated callback data, there will be no additional ack logic in CallRegisteredICACallback
func (Keeper) OnTimeoutPacket ¶
OnTimeoutPacket passes the ack timeout to the ICACallback If there was no callback data associated with this packet, there will be no additional ack logic in CallRegisteredICACallback
func (Keeper) Params ¶
func (k Keeper) Params(c context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error)
func (Keeper) RemoveDepositRecord ¶
RemoveDepositRecord removes a depositRecord from the store
func (Keeper) RemoveEpochUnbondingRecord ¶
RemoveEpochUnbondingRecord removes a epochUnbondingRecord from the store
func (Keeper) RemoveLSMTokenDeposit ¶
func (Keeper) RemoveUserRedemptionRecord ¶
RemoveUserRedemptionRecord removes a userRedemptionRecord from the store
func (Keeper) SetDepositRecord ¶
func (k Keeper) SetDepositRecord(ctx sdk.Context, depositRecord types.DepositRecord)
SetDepositRecord set a specific depositRecord in the store
func (Keeper) SetDepositRecordCount ¶
SetDepositRecordCount set the total number of depositRecord
func (Keeper) SetEpochUnbondingRecord ¶
func (k Keeper) SetEpochUnbondingRecord(ctx sdk.Context, epochUnbondingRecord types.EpochUnbondingRecord)
SetEpochUnbondingRecord set a specific epochUnbondingRecord in the store
func (Keeper) SetHostZoneUnbondingRecord ¶
func (k Keeper) SetHostZoneUnbondingRecord(ctx sdk.Context, epochNumber uint64, chainId string, hostZoneUnbonding types.HostZoneUnbonding) error
Stores a host zone unbonding record - set via an epoch unbonding record
func (Keeper) SetHostZoneUnbondingStatus ¶
func (k Keeper) SetHostZoneUnbondingStatus(ctx sdk.Context, chainId string, epochUnbondingRecordIds []uint64, status types.HostZoneUnbonding_Status) error
Updates the status for a given host zone across relevant epoch unbonding record IDs
func (Keeper) SetLSMTokenDeposit ¶
func (k Keeper) SetLSMTokenDeposit(ctx sdk.Context, deposit types.LSMTokenDeposit)
func (Keeper) SetUserRedemptionRecord ¶
func (k Keeper) SetUserRedemptionRecord(ctx sdk.Context, userRedemptionRecord types.UserRedemptionRecord)
SetUserRedemptionRecord set a specific userRedemptionRecord in the store
func (Keeper) TransferCallback ¶
func (k Keeper) TransferCallback(ctx sdk.Context, packet channeltypes.Packet, ackResponse *icacallbackstypes.AcknowledgementResponse, args []byte) error
func (Keeper) UnmarshalTransferCallbackArgs ¶
func (Keeper) UpdateLSMTokenDepositStatus ¶
func (k Keeper) UpdateLSMTokenDepositStatus(ctx sdk.Context, deposit types.LSMTokenDeposit, status types.LSMTokenDeposit_Status)
func (Keeper) UserRedemptionRecord ¶
func (k Keeper) UserRedemptionRecord(c context.Context, req *types.QueryGetUserRedemptionRecordRequest) (*types.QueryGetUserRedemptionRecordResponse, error)
func (Keeper) UserRedemptionRecordAll ¶
func (k Keeper) UserRedemptionRecordAll(c context.Context, req *types.QueryAllUserRedemptionRecordRequest) (*types.QueryAllUserRedemptionRecordResponse, error)
func (Keeper) UserRedemptionRecordForUser ¶
func (k Keeper) UserRedemptionRecordForUser(c context.Context, req *types.QueryAllUserRedemptionRecordForUserRequest) (*types.QueryAllUserRedemptionRecordForUserResponse, error)
Source Files ¶
- callback_lsm_transfer.go
- callback_native_transfer.go
- callbacks.go
- deposit_record.go
- epoch_unbonding_record.go
- grpc_query.go
- grpc_query_deposit_record.go
- grpc_query_epoch_unbonding_record.go
- grpc_query_lsm_deposits.go
- grpc_query_params.go
- grpc_query_user_redemption_record.go
- grpc_query_user_redemption_record_for_user.go
- ibc.go
- keeper.go
- lsm_token_deposit.go
- params.go
- transfer.go
- user_redemption_record.go