mirror of
https://github.com/aljazceru/ark.git
synced 2025-12-17 20:24:21 +01:00
* sweeper base implementation * sweeper service final implementation * fixes * fix CSV script * RoundSwept event fix & test * remove Vtxos after a sweep transaction * ARK_ROUND_LIFETIME config * remove TxBuilder.GetLifetime * refactor sweeper * use GetTransaction blocktime * polish and comments * fix linting * pair programming fixes * several fixes * clean Println * fixes * linter fixes * remove infrastructure deps from application layer * Fixes --------- Co-authored-by: altafan <18440657+altafan@users.noreply.github.com>
29 lines
1005 B
Go
29 lines
1005 B
Go
package domain
|
|
|
|
import (
|
|
"context"
|
|
)
|
|
|
|
type RoundEventRepository interface {
|
|
Save(ctx context.Context, id string, events ...RoundEvent) error
|
|
Load(ctx context.Context, id string) (*Round, error)
|
|
}
|
|
|
|
type RoundRepository interface {
|
|
AddOrUpdateRound(ctx context.Context, round Round) error
|
|
GetCurrentRound(ctx context.Context) (*Round, error)
|
|
GetRoundWithId(ctx context.Context, id string) (*Round, error)
|
|
GetRoundWithTxid(ctx context.Context, txid string) (*Round, error)
|
|
GetSweepableRounds(ctx context.Context) ([]Round, error)
|
|
}
|
|
|
|
type VtxoRepository interface {
|
|
AddVtxos(ctx context.Context, vtxos []Vtxo) error
|
|
SpendVtxos(ctx context.Context, vtxos []VtxoKey) error
|
|
RedeemVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error)
|
|
GetVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error)
|
|
GetVtxosForRound(ctx context.Context, txid string) ([]Vtxo, error)
|
|
SweepVtxos(ctx context.Context, vtxos []VtxoKey) error
|
|
GetSpendableVtxos(ctx context.Context, pubkey string) ([]Vtxo, error)
|
|
}
|