Skip to content

Commit 91bc912

Browse files
authored
Merge pull request #941 from ellemouton/sql4Accounts4
[sql-4] accounts: remove last usages of `UpdateAccount`
2 parents 2724161 + ef78bc4 commit 91bc912

File tree

5 files changed

+233
-228
lines changed

5 files changed

+233
-228
lines changed

accounts/interface.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -207,11 +207,6 @@ type Store interface {
207207
expirationDate time.Time, label string) (
208208
*OffChainBalanceAccount, error)
209209

210-
// UpdateAccount writes an account to the database, overwriting the
211-
// existing one if it exists.
212-
UpdateAccount(ctx context.Context,
213-
account *OffChainBalanceAccount) error
214-
215210
// Account retrieves an account from the Store and un-marshals it. If
216211
// the account cannot be found, then ErrAccNotFound is returned.
217212
Account(ctx context.Context, id AccountID) (*OffChainBalanceAccount,
@@ -223,7 +218,7 @@ type Store interface {
223218
// UpdateAccountBalanceAndExpiry updates the balance and/or expiry of an
224219
// account.
225220
UpdateAccountBalanceAndExpiry(ctx context.Context, id AccountID,
226-
newBalance fn.Option[lnwire.MilliSatoshi],
221+
newBalance fn.Option[int64],
227222
newExpiry fn.Option[time.Time]) error
228223

229224
// AddAccountInvoice adds an invoice hash to an account.

accounts/service.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ func (s *InterceptorService) UpdateAccount(ctx context.Context,
328328

329329
// If the new account balance was set, parse it as millisatoshis. A
330330
// value of -1 signals "don't update the balance".
331-
var balance fn.Option[lnwire.MilliSatoshi]
331+
var balance fn.Option[int64]
332332
if accountBalance >= 0 {
333333
// Convert from satoshis to millisatoshis for storage.
334-
balance = fn.Some(lnwire.MilliSatoshi(accountBalance) * 1000)
334+
balance = fn.Some(int64(accountBalance) * 1000)
335335
}
336336

337337
// Create the actual account in the macaroon account store.

0 commit comments

Comments
 (0)