mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
refactor: handle unsub when t.Fatalf
This commit is contained in:
parent
71fa1fe0b6
commit
fe4870e911
1 changed files with 4 additions and 0 deletions
|
|
@ -314,6 +314,8 @@ func TestWalletNotifications(t *testing.T) {
|
||||||
// Add a new account and ensure wallet notifications arrives
|
// Add a new account and ensure wallet notifications arrives
|
||||||
account, err := ks.NewAccount("")
|
account, err := ks.NewAccount("")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
// Shut down the event collector and check events.
|
||||||
|
sub.Unsubscribe()
|
||||||
t.Fatalf("failed to create test account: %v", err)
|
t.Fatalf("failed to create test account: %v", err)
|
||||||
}
|
}
|
||||||
live[account.Address] = account
|
live[account.Address] = account
|
||||||
|
|
@ -326,6 +328,8 @@ func TestWalletNotifications(t *testing.T) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
if err := ks.Delete(account, ""); err != nil {
|
if err := ks.Delete(account, ""); err != nil {
|
||||||
|
// Shut down the event collector and check events.
|
||||||
|
sub.Unsubscribe()
|
||||||
t.Fatalf("failed to delete test account: %v", err)
|
t.Fatalf("failed to delete test account: %v", err)
|
||||||
}
|
}
|
||||||
delete(live, account.Address)
|
delete(live, account.Address)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue