Skip to content

Commit b7e6400

Browse files
committed
multi: fix lll linter errors
1 parent 3f64df5 commit b7e6400

10 files changed

Lines changed: 131 additions & 64 deletions

File tree

rpc/rpcserver/server.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,10 @@ func (s *walletServer) Accounts(ctx context.Context, req *pb.AccountsRequest) (
188188
func (s *walletServer) RenameAccount(ctx context.Context, req *pb.RenameAccountRequest) (
189189
*pb.RenameAccountResponse, error) {
190190

191-
err := s.wallet.RenameAccountDeprecated(waddrmgr.KeyScopeBIP0044, req.GetAccountNumber(), req.GetNewName())
191+
err := s.wallet.RenameAccountDeprecated(
192+
waddrmgr.KeyScopeBIP0044, req.GetAccountNumber(),
193+
req.GetNewName(),
194+
)
192195
if err != nil {
193196
return nil, translateError(err)
194197
}

waddrmgr/scoped_manager.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,9 @@ func (s *ScopedKeyManager) CanAddAccount() error {
15661566
// differs from the NewAccount method in that this method takes the account
15671567
// number *directly*, rather than taking a string name for the account, then
15681568
// mapping that to the next highest account number.
1569-
func (s *ScopedKeyManager) NewRawAccount(ns walletdb.ReadWriteBucket, number uint32) error {
1569+
func (s *ScopedKeyManager) NewRawAccount(
1570+
ns walletdb.ReadWriteBucket, number uint32) error {
1571+
15701572
s.mtx.Lock()
15711573
defer s.mtx.Unlock()
15721574

wallet/account_manager.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,8 @@ func (w *Wallet) ListAccounts(_ context.Context) (*AccountsResult, error) {
196196
return err
197197
}
198198

199-
// Now, iterate through each key scope to assemble the final list
200-
// of accounts with their properties and balances.
199+
// Now, iterate through all key scopes to assemble the final
200+
// list of accounts with their properties and balances.
201201
for _, scopeMgr := range scopes {
202202
scope := scopeMgr.Scope()
203203
accountBalances := scopedBalances[scope]

wallet/account_manager_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ func TestNewAccount(t *testing.T) {
4141
)
4242
require.NoError(t, err, "unable to create new account")
4343

44-
// The new account should be the first account created, so it should have
45-
// an index of 1.
44+
// The new account should be the first account created, so it should
45+
// have an index of 1.
4646
require.Equal(t, uint32(1), account.AccountNumber, "expected account 1")
4747

4848
// We should be able to retrieve the account by its name.
@@ -251,7 +251,9 @@ func TestGetAccount(t *testing.T) {
251251
require.NoError(t, err)
252252

253253
// We should be able to get the new account.
254-
account, err := w.GetAccount(context.Background(), scope, testAccountName)
254+
account, err := w.GetAccount(
255+
context.Background(), scope, testAccountName,
256+
)
255257
require.NoError(t, err)
256258
require.Equal(t, testAccountName, account.AccountName)
257259
require.Equal(t, uint32(1), account.AccountNumber)
@@ -664,10 +666,13 @@ func TestFetchAccountBalances(t *testing.T) {
664666
// Add UTXOs.
665667
addTestUTXOForBalance(t, w, waddrmgr.KeyScopeBIP0084, 0, 100)
666668
addTestUTXOForBalance(t, w, waddrmgr.KeyScopeBIP0084, 1, 200)
667-
addTestUTXOForBalance(t, w, waddrmgr.KeyScopeBIP0049Plus, 1, 300)
669+
addTestUTXOForBalance(
670+
t, w, waddrmgr.KeyScopeBIP0049Plus, 1, 300,
671+
)
668672

669673
// Update sync state.
670-
err = walletdb.Update(w.db, func(tx walletdb.ReadWriteTx) error {
674+
err = walletdb.Update(
675+
w.db, func(tx walletdb.ReadWriteTx) error {
671676
addrmgrNs := tx.ReadWriteBucket(waddrmgrNamespaceKey)
672677
bs := &waddrmgr.BlockStamp{Height: 1}
673678

@@ -733,7 +738,8 @@ func TestFetchAccountBalances(t *testing.T) {
733738

734739
var balances scopedBalances
735740

736-
err := walletdb.View(w.db, func(tx walletdb.ReadTx) error {
741+
err := walletdb.View(
742+
w.db, func(tx walletdb.ReadTx) error {
737743
var err error
738744

739745
balances, err = w.fetchAccountBalances(

wallet/createtx.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,9 @@ func (w *Wallet) findEligibleOutputs(dbtx walletdb.ReadTx,
400400
continue
401401
}
402402

403-
scopedMgr, addrAcct, err := w.addrStore.AddrAccount(addrmgrNs, addrs[0])
403+
scopedMgr, addrAcct, err := w.addrStore.AddrAccount(
404+
addrmgrNs, addrs[0],
405+
)
404406
if err != nil {
405407
continue
406408
}

wallet/import.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,8 @@ func (w *Wallet) validateExtendedPubKey(pubKey *hdkeychain.ExtendedKey,
189189
return nil
190190
}
191191

192-
// ImportAccountDeprecated imports an account backed by an account extended public key.
192+
// ImportAccountDeprecated imports an account backed by an account extended
193+
// public key.
193194
// The master key fingerprint denotes the fingerprint of the root key
194195
// corresponding to the account public key (also known as the key with
195196
// derivation path m/). This may be required by some hardware wallets for proper
@@ -208,7 +209,8 @@ func (w *Wallet) validateExtendedPubKey(pubKey *hdkeychain.ExtendedKey,
208209
// distinction between the traditional BIP-0049 address schema (nested witness
209210
// pubkeys everywhere) and our own BIP-0049Plus address schema (nested
210211
// externally, witness internally).
211-
func (w *Wallet) ImportAccountDeprecated(name string, accountPubKey *hdkeychain.ExtendedKey,
212+
func (w *Wallet) ImportAccountDeprecated(
213+
name string, accountPubKey *hdkeychain.ExtendedKey,
212214
masterKeyFingerprint uint32, addrType *waddrmgr.AddressType) (
213215
*waddrmgr.AccountProperties, error) {
214216

wallet/interface.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,14 @@ type Interface interface {
120120
RenameAccountDeprecated(scope waddrmgr.KeyScope, account uint32,
121121
newName string) error
122122

123-
// ImportAccountDeprecated imports an account backed by an extended public key.
123+
// ImportAccountDeprecated imports an account backed by an extended
124+
// public key.
125+
//
124126
// This creates a watch-only account.
125127
//
126128
// Deprecated: Use AccountManager.ImportAccount instead.
127-
ImportAccountDeprecated(name string, accountPubKey *hdkeychain.ExtendedKey,
129+
ImportAccountDeprecated(name string,
130+
accountPubKey *hdkeychain.ExtendedKey,
128131
masterKeyFingerprint uint32, addrType *waddrmgr.AddressType,
129132
) (*waddrmgr.AccountProperties, error)
130133

wallet/notifications.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ func makeTxSummary(dbtx walletdb.ReadTx, w *Wallet, details *wtxmgr.TxDetails) T
157157
func totalBalances(dbtx walletdb.ReadTx, w *Wallet, m map[uint32]btcutil.Amount) error {
158158
addrmgrNs := dbtx.ReadBucket(waddrmgrNamespaceKey)
159159

160-
unspent, err := w.txStore.UnspentOutputs(dbtx.ReadBucket(wtxmgrNamespaceKey))
160+
unspent, err := w.txStore.UnspentOutputs(
161+
dbtx.ReadBucket(wtxmgrNamespaceKey),
162+
)
161163
if err != nil {
162164
return err
163165
}
@@ -167,7 +169,9 @@ func totalBalances(dbtx walletdb.ReadTx, w *Wallet, m map[uint32]btcutil.Amount)
167169
_, addrs, _, err := txscript.ExtractPkScriptAddrs(
168170
output.PkScript, w.chainParams)
169171
if err == nil && len(addrs) > 0 {
170-
_, outputAcct, err = w.addrStore.AddrAccount(addrmgrNs, addrs[0])
172+
_, outputAcct, err = w.addrStore.AddrAccount(
173+
addrmgrNs, addrs[0],
174+
)
171175
}
172176
if err == nil {
173177
_, ok := m[outputAcct]
@@ -234,7 +238,9 @@ func (s *NotificationServer) notifyUnminedTransaction(dbtx walletdb.ReadTx,
234238

235239
unminedTxs := []TransactionSummary{makeTxSummary(dbtx, s.wallet, details)}
236240

237-
unminedHashes, err := s.wallet.txStore.UnminedTxHashes(dbtx.ReadBucket(wtxmgrNamespaceKey))
241+
unminedHashes, err := s.wallet.txStore.UnminedTxHashes(
242+
dbtx.ReadBucket(wtxmgrNamespaceKey),
243+
)
238244
if err != nil {
239245
log.Errorf("Cannot fetch unmined transaction hashes: %v", err)
240246
return

wallet/utxos.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,9 @@ func (w *Wallet) UnspentOutputs(policy OutputSelectionPolicy) ([]*TransactionOut
7171
continue
7272
}
7373

74-
_, outputAcct, err := w.addrStore.AddrAccount(addrmgrNs, addrs[0])
74+
_, outputAcct, err := w.addrStore.AddrAccount(
75+
addrmgrNs, addrs[0],
76+
)
7577
if err != nil {
7678
return err
7779
}

0 commit comments

Comments
 (0)