@@ -47,16 +47,20 @@ const (
4747 regtestDisabled = false
4848)
4949
50- func checkShownAccountsLen (t * testing.T , b * Backend , expectedLoaded int , expectedPersisted int ) {
50+ func checkShownLoadedAccountsLen (t * testing.T , accounts AccountsList , expectedLoaded int ) {
5151 t .Helper ()
5252 cntLoaded := 0
53- for _ , acct := range b . Accounts () {
53+ for _ , acct := range accounts {
5454 if ! acct .Config ().Config .HiddenBecauseUnused {
5555 cntLoaded ++
5656 }
5757 }
5858 require .Equal (t , expectedLoaded , cntLoaded )
59+ }
5960
61+ func checkShownAccountsLen (t * testing.T , b * Backend , expectedLoaded int , expectedPersisted int ) {
62+ t .Helper ()
63+ checkShownLoadedAccountsLen (t , b .Accounts (), expectedLoaded )
6064 cntPersisted := 0
6165 for _ , acct := range b .Config ().AccountsConfig ().Accounts {
6266 if ! acct .HiddenBecauseUnused {
@@ -1430,15 +1434,15 @@ func TestAccountsByKeystore(t *testing.T) {
14301434 require .NoError (t , err )
14311435
14321436 require .NotNil (t , accountsMap [hex .EncodeToString (ks1Fingerprint )])
1433- require . Len (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1437+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
14341438 require .NotNil (t , accountsMap [hex .EncodeToString (ks2Fingerprint )])
1435- require . Len (t , accountsMap [hex .EncodeToString (ks2Fingerprint )], 3 )
1439+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks2Fingerprint )], 3 )
14361440
14371441 b .DeregisterKeystore ()
14381442 accountsMap , err = b .AccountsByKeystore ()
14391443 require .NoError (t , err )
14401444 require .NotNil (t , accountsMap [hex .EncodeToString (ks1Fingerprint )])
1441- require . Len (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
1445+ checkShownLoadedAccountsLen (t , accountsMap [hex .EncodeToString (ks1Fingerprint )], 3 )
14421446 require .Nil (t , accountsMap [hex .EncodeToString (ks2Fingerprint )])
14431447}
14441448
0 commit comments