@@ -47,16 +47,20 @@ const (
47
47
regtestDisabled = false
48
48
)
49
49
50
- func checkShownAccountsLen (t * testing.T , b * Backend , expectedLoaded int , expectedPersisted int ) {
50
+ func checkShownLoadedAccountsLen (t * testing.T , accounts AccountsList , expectedLoaded int ) {
51
51
t .Helper ()
52
52
cntLoaded := 0
53
- for _ , acct := range b . Accounts () {
53
+ for _ , acct := range accounts {
54
54
if ! acct .Config ().Config .HiddenBecauseUnused {
55
55
cntLoaded ++
56
56
}
57
57
}
58
58
require .Equal (t , expectedLoaded , cntLoaded )
59
+ }
59
60
61
+ func checkShownAccountsLen (t * testing.T , b * Backend , expectedLoaded int , expectedPersisted int ) {
62
+ t .Helper ()
63
+ checkShownLoadedAccountsLen (t , b .Accounts (), expectedLoaded )
60
64
cntPersisted := 0
61
65
for _ , acct := range b .Config ().AccountsConfig ().Accounts {
62
66
if ! acct .HiddenBecauseUnused {
@@ -1430,15 +1434,15 @@ func TestAccountsByKeystore(t *testing.T) {
1430
1434
require .NoError (t , err )
1431
1435
1432
1436
require .NotNil (t , accountsMap [hex .EncodeToString (ks1Fingerprint )])
1433
- require . Len (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1437
+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1434
1438
require .NotNil (t , accountsMap [hex .EncodeToString (ks2Fingerprint )])
1435
- require . Len (t , accountsMap [hex .EncodeToString (ks2Fingerprint )], 3 )
1439
+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks2Fingerprint )], 3 )
1436
1440
1437
1441
b .DeregisterKeystore ()
1438
1442
accountsMap , err = b .AccountsByKeystore ()
1439
1443
require .NoError (t , err )
1440
1444
require .NotNil (t , accountsMap [hex .EncodeToString (ks1Fingerprint )])
1441
- require . Len (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1445
+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1442
1446
require .Nil (t , accountsMap [hex .EncodeToString (ks2Fingerprint )])
1443
1447
}
1444
1448
0 commit comments