loopdb: add helper methods to update swap costs

This commit adds the necessary sqlc code and SwapStore function to
update swap costs for all swaps in one transaction.
This commit is contained in:
Andras Banki-Horvath 2024-05-30 22:37:45 +02:00
parent 08aa4db35d
commit 4f5c806ba5
No known key found for this signature in database
GPG key ID: 80E5375C094198D8
8 changed files with 245 additions and 0 deletions

View file

@ -65,6 +65,11 @@ type SwapStore interface {
// it's decoding using the proto package's `Unmarshal` method.
FetchLiquidityParams(ctx context.Context) ([]byte, error)
// BatchUpdateLoopOutSwapCosts updates the swap costs for a batch of
// loop out swaps.
BatchUpdateLoopOutSwapCosts(ctx context.Context,
swaps map[lntypes.Hash]SwapCost) error
// Close closes the underlying database.
Close() error
}