@@ -193,11 +193,12 @@ func TestGetAccountAssetsLocalWithCHFBalance(t *testing.T) {
193193 })
194194 require .NoError (t , err )
195195
196- err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
196+ curr , err : = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
197197 AccountID : accountID ,
198198 Currency : stellar1 .OutsideCurrencyCode ("CHF" ),
199199 })
200200 require .NoError (t , err )
201+ require .Equal (t , stellar1 .OutsideCurrencyCode ("CHF" ), curr .Code )
201202
202203 tcs [0 ].Backend .ImportAccountsForUser (tcs [0 ])
203204
@@ -351,11 +352,12 @@ func TestChangeWalletName(t *testing.T) {
351352 chk ("" , "name required" )
352353 chk ("office lunch money" , "" )
353354 chk ("savings" , "" )
354- err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
355+ res , err : = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
355356 AccountID : accs [0 ].AccountID ,
356357 NewName : "office lunch money" ,
357358 })
358359 require .NoError (t , err )
360+ require .Equal (t , "office lunch money" , res .Name )
359361 chk ("office lunch money" , "you already have an account with that name" )
360362 chk ("career debter" , "" )
361363
@@ -371,7 +373,7 @@ func TestChangeWalletName(t *testing.T) {
371373
372374 // Try invalid argument
373375 invalidAccID , _ := randomStellarKeypair ()
374- err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
376+ _ , err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
375377 AccountID : invalidAccID ,
376378 NewName : "savings" ,
377379 })
@@ -398,10 +400,11 @@ func TestSetAccountAsDefault(t *testing.T) {
398400
399401 // Should work for accounts that are already primary and not post
400402 // a bundle.
401- err = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
403+ res , err : = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
402404 AccountID : accs [0 ].AccountID ,
403405 })
404406 require .NoError (t , err )
407+ require .Equal (t , accs [0 ].AccountID , res [0 ].AccountID )
405408
406409 mctx := libkb .NewMetaContextBackground (tcs [0 ].G )
407410 bundle , err := remote .FetchSecretlessBundle (mctx )
@@ -410,12 +413,12 @@ func TestSetAccountAsDefault(t *testing.T) {
410413
411414 // Test invalid arguments
412415 invalidAccID , _ := randomStellarKeypair ()
413- err = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
416+ _ , err = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
414417 AccountID : invalidAccID ,
415418 })
416419 require .Error (t , err )
417420
418- err = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
421+ _ , err = tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), stellar1.SetWalletAccountAsDefaultLocalArg {
419422 AccountID : stellar1 .AccountID ("" ),
420423 })
421424 require .Error (t , err )
@@ -439,7 +442,7 @@ func TestSetAccountAsDefault(t *testing.T) {
439442 arg := stellar1.SetWalletAccountAsDefaultLocalArg {
440443 AccountID : v ,
441444 }
442- err := tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), arg )
445+ _ , err := tcs [0 ].Srv .SetWalletAccountAsDefaultLocal (context .Background (), arg )
443446 require .NoError (t , err )
444447
445448 accs , err := tcs [0 ].Srv .WalletGetAccountsCLILocal (context .Background ())
@@ -575,22 +578,22 @@ func TestChangeDisplayCurrency(t *testing.T) {
575578 accID := getPrimaryAccountID (tcs [0 ])
576579
577580 // Try invalid currency first.
578- err := tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
581+ _ , err := tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
579582 AccountID : accID ,
580583 Currency : stellar1 .OutsideCurrencyCode ("ZZZ" ),
581584 })
582585 require .Error (t , err )
583586
584587 // Try empty account id.
585- err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
588+ _ , err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
586589 AccountID : stellar1 .AccountID ("" ),
587590 Currency : stellar1 .OutsideCurrencyCode ("USD" ),
588591 })
589592 require .Error (t , err )
590593
591594 // Try non-existant account id.
592595 invalidAccID , _ := randomStellarKeypair ()
593- err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
596+ _ , err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
594597 AccountID : invalidAccID ,
595598 Currency : stellar1 .OutsideCurrencyCode ("USD" ),
596599 })
@@ -601,18 +604,19 @@ func TestChangeDisplayCurrency(t *testing.T) {
601604 acceptDisclaimer (tcs [1 ])
602605 tcs [1 ].Backend .ImportAccountsForUser (tcs [1 ])
603606 accID2 := getPrimaryAccountID (tcs [1 ])
604- err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
607+ _ , err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
605608 AccountID : accID2 ,
606609 Currency : stellar1 .OutsideCurrencyCode ("EUR" ),
607610 })
608611 require .Error (t , err )
609612
610613 // Finally, a happy path.
611- err = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
614+ res , err : = tcs [0 ].Srv .ChangeDisplayCurrencyLocal (context .Background (), stellar1.ChangeDisplayCurrencyLocalArg {
612615 AccountID : accID ,
613616 Currency : stellar1 .OutsideCurrencyCode ("EUR" ),
614617 })
615618 require .NoError (t , err )
619+ require .Equal (t , stellar1 .OutsideCurrencyCode ("EUR" ), res .Code )
616620
617621 // Check both CLI and Frontend RPCs.
618622 accs , err := tcs [0 ].Srv .WalletGetAccountsCLILocal (context .Background ())
@@ -737,7 +741,7 @@ func TestGetPaymentsLocal(t *testing.T) {
737741 })
738742 require .NoError (t , err )
739743
740- err = srvSender .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
744+ _ , err = srvSender .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
741745 AccountID : accountIDSender ,
742746 NewName : "office lunch money" ,
743747 })
@@ -1064,7 +1068,7 @@ func TestSendToSelf(t *testing.T) {
10641068 })
10651069 require .NoError (t , err )
10661070
1067- err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
1071+ _ , err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
10681072 AccountID : accountID1 ,
10691073 NewName : "office lunch money" ,
10701074 })
@@ -1076,7 +1080,7 @@ func TestSendToSelf(t *testing.T) {
10761080 })
10771081 require .NoError (t , err )
10781082
1079- err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
1083+ _ , err = tcs [0 ].Srv .ChangeWalletAccountNameLocal (context .Background (), stellar1.ChangeWalletAccountNameLocalArg {
10801084 AccountID : accountID2 ,
10811085 NewName : "savings" ,
10821086 })
0 commit comments