Documentation
¶
Index ¶
- type PayoutTimeoutQueue
- func (p *PayoutTimeoutQueue) Dequeue(ctx sdk.Context, periodTimeout int64, vaultAddr sdk.AccAddress) error
- func (p *PayoutTimeoutQueue) Enqueue(ctx sdk.Context, periodTimeout int64, vaultAddr sdk.AccAddress) error
- func (p *PayoutTimeoutQueue) RemoveAllForVault(ctx sdk.Context, vaultAddr sdk.AccAddress) error
- func (p *PayoutTimeoutQueue) Walk(ctx sdk.Context, ...) error
- func (p *PayoutTimeoutQueue) WalkDue(ctx sdk.Context, nowSec int64, ...) error
- type PendingSwapOutIndexes
- type PendingSwapOutQueue
- func (p *PendingSwapOutQueue) Dequeue(ctx context.Context, timestamp int64, vault sdk.AccAddress, id uint64) error
- func (p *PendingSwapOutQueue) Enqueue(ctx context.Context, pendingTime int64, req *types.PendingSwapOut) (uint64, error)
- func (p *PendingSwapOutQueue) ExpediteSwapOut(ctx context.Context, id uint64) error
- func (p *PendingSwapOutQueue) Export(ctx context.Context) (*types.PendingSwapOutQueue, error)
- func (p *PendingSwapOutQueue) GetByID(ctx context.Context, id uint64) (int64, *types.PendingSwapOut, error)
- func (p *PendingSwapOutQueue) Import(ctx context.Context, genQueue *types.PendingSwapOutQueue) error
- func (p *PendingSwapOutQueue) Walk(ctx context.Context, ...) error
- func (p *PendingSwapOutQueue) WalkByVault(ctx context.Context, vaultAddr sdk.AccAddress, ...) error
- func (p *PendingSwapOutQueue) WalkDue(ctx context.Context, now int64, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PayoutTimeoutQueue ¶
type PayoutTimeoutQueue struct {
// contains filtered or unexported fields
}
func NewPayoutTimeoutQueue ¶
func NewPayoutTimeoutQueue(builder *collections.SchemaBuilder) *PayoutTimeoutQueue
func (*PayoutTimeoutQueue) Dequeue ¶
func (p *PayoutTimeoutQueue) Dequeue(ctx sdk.Context, periodTimeout int64, vaultAddr sdk.AccAddress) error
Dequeue removes a specific timeout entry (periodTimeout, vault) from the PayoutTimeoutQueue.
func (*PayoutTimeoutQueue) Enqueue ¶
func (p *PayoutTimeoutQueue) Enqueue(ctx sdk.Context, periodTimeout int64, vaultAddr sdk.AccAddress) error
Enqueue schedules a vault for timeout processing by inserting an entry into the PayoutTimeoutQueue keyed by (periodTimeout, vault address).
func (*PayoutTimeoutQueue) RemoveAllForVault ¶
func (p *PayoutTimeoutQueue) RemoveAllForVault(ctx sdk.Context, vaultAddr sdk.AccAddress) error
RemoveAllForVault deletes all timeout entries in the PayoutTimeoutQueue for the given vault address.
func (*PayoutTimeoutQueue) Walk ¶
func (p *PayoutTimeoutQueue) Walk(ctx sdk.Context, fn func(periodTimeout uint64, vaultAddr sdk.AccAddress) (stop bool, err error)) error
Walk iterates over all entries in the PayoutTimeoutQueue. Iteration stops when the callback returns stop=true or an error.
func (*PayoutTimeoutQueue) WalkDue ¶
func (p *PayoutTimeoutQueue) WalkDue(ctx sdk.Context, nowSec int64, fn func(periodTimeout uint64, vaultAddr sdk.AccAddress) (stop bool, err error)) error
WalkDue iterates over all entries in the PayoutTimeoutQueue with a timeout timestamp <= nowSec. For each due entry, the callback is invoked. Iteration stops when a key with time > nowSec is encountered (since keys are ordered) or when the callback returns stop=true or an error.
type PendingSwapOutIndexes ¶
type PendingSwapOutIndexes struct {
ByVault *indexes.Multi[sdk.AccAddress, collections.Triple[int64, uint64, sdk.AccAddress], types.PendingSwapOut]
ByID *indexes.Unique[uint64, collections.Triple[int64, uint64, sdk.AccAddress], types.PendingSwapOut]
}
PendingSwapOutIndexes defines the indexes for the pending swap out queue.
func NewPendingSwapOutIndexes ¶
func NewPendingSwapOutIndexes(sb *collections.SchemaBuilder) PendingSwapOutIndexes
NewPendingSwapOutIndexes creates a new PendingSwapOutIndexes object.
func (PendingSwapOutIndexes) IndexesList ¶
func (i PendingSwapOutIndexes) IndexesList() []collections.Index[collections.Triple[int64, uint64, sdk.AccAddress], types.PendingSwapOut]
IndexesList returns the list of indexes for the pending swap out queue.
type PendingSwapOutQueue ¶
type PendingSwapOutQueue struct {
// IndexedMap is the indexed map of pending swap outs. The key is a triple of (timestamp, id, vault).
IndexedMap *collections.IndexedMap[collections.Triple[int64, uint64, sdk.AccAddress], types.PendingSwapOut, PendingSwapOutIndexes]
// Sequence is the sequence for generating unique swap out IDs.
Sequence collections.Sequence
}
PendingSwapOutQueue is a queue for pending swap outs.
func NewPendingSwapOutQueue ¶
func NewPendingSwapOutQueue(builder *collections.SchemaBuilder, cdc codec.BinaryCodec) *PendingSwapOutQueue
NewPendingSwapOutQueue creates a new PendingSwapOutQueue.
func (*PendingSwapOutQueue) Dequeue ¶
func (p *PendingSwapOutQueue) Dequeue(ctx context.Context, timestamp int64, vault sdk.AccAddress, id uint64) error
Dequeue removes a pending swap out from the queue.
func (*PendingSwapOutQueue) Enqueue ¶
func (p *PendingSwapOutQueue) Enqueue(ctx context.Context, pendingTime int64, req *types.PendingSwapOut) (uint64, error)
Enqueue adds a pending swap out to the queue.
func (*PendingSwapOutQueue) ExpediteSwapOut ¶
func (p *PendingSwapOutQueue) ExpediteSwapOut(ctx context.Context, id uint64) error
ExpediteSwapOut sets the timestamp of a pending swap out to 0.
func (*PendingSwapOutQueue) Export ¶
func (p *PendingSwapOutQueue) Export(ctx context.Context) (*types.PendingSwapOutQueue, error)
Export exports the pending swap out queue to genesis.
func (*PendingSwapOutQueue) GetByID ¶
func (p *PendingSwapOutQueue) GetByID(ctx context.Context, id uint64) (int64, *types.PendingSwapOut, error)
GetByID gets the pending swap out by ID.
func (*PendingSwapOutQueue) Import ¶
func (p *PendingSwapOutQueue) Import(ctx context.Context, genQueue *types.PendingSwapOutQueue) error
Import imports the pending swap out queue from genesis.
func (*PendingSwapOutQueue) Walk ¶
func (p *PendingSwapOutQueue) Walk(ctx context.Context, fn func(timestamp int64, id uint64, vault sdk.AccAddress, req types.PendingSwapOut) (stop bool, err error)) error
Walk iterates over all entries in the PendingSwapOutQueue. Iteration stops when the callback returns stop=true or an error.
func (*PendingSwapOutQueue) WalkByVault ¶
func (p *PendingSwapOutQueue) WalkByVault(ctx context.Context, vaultAddr sdk.AccAddress, fn func(timestamp int64, id uint64, req types.PendingSwapOut) (stop bool, err error)) error
WalkByVault iterates over all entries in the PendingSwapOutQueue for a specific vault. Iteration stops when the callback returns stop=true or an error.
func (*PendingSwapOutQueue) WalkDue ¶
func (p *PendingSwapOutQueue) WalkDue(ctx context.Context, now int64, fn func(timestamp int64, id uint64, vault sdk.AccAddress, req types.PendingSwapOut) (stop bool, err error)) error
WalkDue iterates over all entries in the PendingSwapOutQueue with a timestamp <= now. For each due entry, the callback is invoked. Iteration stops when a key with time > now is encountered (since keys are ordered) or when the callback returns stop=true or an error.