From 3d4ee8b874bd20f97914469fb7b0b6e3aced83dd Mon Sep 17 00:00:00 2001 From: ziggie Date: Mon, 25 Aug 2025 16:26:02 +0200 Subject: [PATCH] paymentsdb: rename defaultKVStoreOptions func We rename the modifier to use the same naming as used in the graphDB to align the codebase. --- payments/db/kv_store.go | 9 +-------- payments/db/options.go | 8 ++++++++ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/payments/db/kv_store.go b/payments/db/kv_store.go index bde4b2e92..67b4a920b 100644 --- a/payments/db/kv_store.go +++ b/payments/db/kv_store.go @@ -133,18 +133,11 @@ type KVStore struct { keepFailedPaymentAttempts bool } -// defaultKVStoreOptions returns the default options for the KV store. -func defaultKVStoreOptions() *StoreOptions { - return &StoreOptions{ - KeepFailedPaymentAttempts: false, - } -} - // NewKVStore creates a new KVStore for payments. func NewKVStore(db kvdb.Backend, options ...OptionModifier) (*KVStore, error) { - opts := defaultKVStoreOptions() + opts := DefaultOptions() for _, applyOption := range options { applyOption(opts) } diff --git a/payments/db/options.go b/payments/db/options.go index 4f6fa573e..9e98aafa3 100644 --- a/payments/db/options.go +++ b/payments/db/options.go @@ -10,6 +10,14 @@ type StoreOptions struct { KeepFailedPaymentAttempts bool } +// DefaultOptions returns a StoreOptions populated with default values. +func DefaultOptions() *StoreOptions { + return &StoreOptions{ + KeepFailedPaymentAttempts: false, + NoMigration: false, + } +} + // OptionModifier is a function signature for modifying the default // StoreOptions. type OptionModifier func(*StoreOptions)