Documentation
¶
Index ¶
- type FeeTimeoutQueue
- func (p *FeeTimeoutQueue) Dequeue(ctx sdk.Context, feeTimeout int64, vaultAddr sdk.AccAddress) error
- func (p *FeeTimeoutQueue) Enqueue(ctx sdk.Context, feeTimeout int64, vaultAddr sdk.AccAddress) error
- func (p *FeeTimeoutQueue) Walk(ctx sdk.Context, ...) error
- func (p *FeeTimeoutQueue) WalkDue(ctx sdk.Context, nowSec int64, ...) error
- 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) Reschedule(ctx context.Context, oldTimestamp int64, vault sdk.AccAddress, id uint64, ...) 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 FeeTimeoutQueue ¶ added in v1.1.0
type FeeTimeoutQueue struct {
// contains filtered or unexported fields
}
FeeTimeoutQueue manages scheduled fee collections for vaults within the fee-reconciliation flow.
func NewFeeTimeoutQueue ¶ added in v1.1.0
func NewFeeTimeoutQueue(builder *collections.SchemaBuilder) *FeeTimeoutQueue
NewFeeTimeoutQueue initializes a new FeeTimeoutQueue using the provided collections schema builder.
func (*FeeTimeoutQueue) Dequeue ¶ added in v1.1.0
func (p *FeeTimeoutQueue) Dequeue(ctx sdk.Context, feeTimeout int64, vaultAddr sdk.AccAddress) error
Dequeue removes a specific timeout entry (feeTimeout, vault) from the FeeTimeoutQueue.
func (*FeeTimeoutQueue) Enqueue ¶ added in v1.1.0
func (p *FeeTimeoutQueue) Enqueue(ctx sdk.Context, feeTimeout int64, vaultAddr sdk.AccAddress) error
Enqueue schedules a vault for fee collection processing by inserting an entry into the FeeTimeoutQueue keyed by (feeTimeout, vault address).
func (*FeeTimeoutQueue) Walk ¶ added in v1.1.0
func (p *FeeTimeoutQueue) Walk(ctx sdk.Context, fn func(feeTimeout uint64, vaultAddr sdk.AccAddress) (stop bool, err error)) error
Walk iterates over all entries in the FeeTimeoutQueue.
func (*FeeTimeoutQueue) WalkDue ¶ added in v1.1.0
func (p *FeeTimeoutQueue) WalkDue(ctx sdk.Context, nowSec int64, fn func(feeTimeout uint64, vaultAddr sdk.AccAddress) (stop bool, err error)) error
WalkDue iterates over all entries in the FeeTimeoutQueue with a timeout timestamp <= nowSec. For each due entry, the callback is invoked.
type PayoutTimeoutQueue ¶
type PayoutTimeoutQueue struct {
// contains filtered or unexported fields
}
PayoutTimeoutQueue manages scheduled payout distributions for vaults.
func NewPayoutTimeoutQueue ¶
func NewPayoutTimeoutQueue(builder *collections.SchemaBuilder) *PayoutTimeoutQueue
NewPayoutTimeoutQueue initializes a new PayoutTimeoutQueue using the provided collections schema builder.
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 and clears its failure count, so an operator who fixed the cause of repeated failures gets an immediate retry instead of waiting out the accumulated backoff.
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) Reschedule ¶ added in v1.2.2
func (p *PendingSwapOutQueue) Reschedule(ctx context.Context, oldTimestamp int64, vault sdk.AccAddress, id uint64, newTimestamp int64, req *types.PendingSwapOut) error
Reschedule moves an existing pending swap out to newTimestamp and replaces its stored request, which is how a request that could neither be settled nor refunded is moved off the front of the queue without losing its escrow record. The request is not re-validated, since refusing to re-key would leave the entry camped at the front of the queue. Callers must supply an atomic context because removal and insertion are two writes.
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.