Files
ark/asp/internal/core/domain/round_repo.go
Pietralberto Mazza be1f4654f9 Add badger implementations of repos (#22)
* Fixes to domain layer

* Update repo manager interface

* Add badger repo impls

* Keep projection store in sync with event store

* Update deps

* Remove ripemd160
2023-11-30 14:16:44 +01:00

22 lines
680 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)
}
type VtxoRepository interface {
AddVtxos(ctx context.Context, vtxos []Vtxo) error
SpendVtxos(ctx context.Context, vtxos []VtxoKey) error
GetVtxos(ctx context.Context, vtxos []VtxoKey) ([]Vtxo, error)
}