mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
loopdb+sweepbatcher: add the DropBatch call
This commit is contained in:
parent
38f0e3a1f5
commit
939c9b4ccf
5 changed files with 41 additions and 0 deletions
|
|
@ -25,6 +25,15 @@ func (q *Queries) ConfirmBatch(ctx context.Context, id int32) error {
|
|||
return err
|
||||
}
|
||||
|
||||
const dropBatch = `-- name: DropBatch :exec
|
||||
DELETE FROM sweep_batches WHERE id = $1
|
||||
`
|
||||
|
||||
func (q *Queries) DropBatch(ctx context.Context, id int32) error {
|
||||
_, err := q.db.ExecContext(ctx, dropBatch, id)
|
||||
return err
|
||||
}
|
||||
|
||||
const getBatchSweeps = `-- name: GetBatchSweeps :many
|
||||
SELECT
|
||||
sweeps.id, sweeps.swap_hash, sweeps.batch_id, sweeps.outpoint_txid, sweeps.outpoint_index, sweeps.amt, sweeps.completed,
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import (
|
|||
type Querier interface {
|
||||
ConfirmBatch(ctx context.Context, id int32) error
|
||||
CreateReservation(ctx context.Context, arg CreateReservationParams) error
|
||||
DropBatch(ctx context.Context, id int32) error
|
||||
FetchLiquidityParams(ctx context.Context) ([]byte, error)
|
||||
GetBatchSweeps(ctx context.Context, batchID int32) ([]GetBatchSweepsRow, error)
|
||||
GetBatchSweptAmount(ctx context.Context, batchID int32) (int64, error)
|
||||
|
|
|
|||
|
|
@ -23,6 +23,9 @@ INSERT INTO sweep_batches (
|
|||
$6
|
||||
) RETURNING id;
|
||||
|
||||
-- name: DropBatch :exec
|
||||
DELETE FROM sweep_batches WHERE id = $1;
|
||||
|
||||
-- name: UpdateBatch :exec
|
||||
UPDATE sweep_batches SET
|
||||
confirmed = $2,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue