From 7da1ed38d4da3c6f9f5bd6fb32657b4183e8fa74 Mon Sep 17 00:00:00 2001 From: frank Date: Wed, 21 Jun 2023 21:24:53 +0800 Subject: [PATCH] chore: remove checking color id (#3651) * remove checking color id * bump version --- VERSION | 2 +- api/backend_test.go | 1 - api/geth_backend.go | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/VERSION b/VERSION index 7a75fe22b..2ec35cc88 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.159.3 +0.159.4 diff --git a/api/backend_test.go b/api/backend_test.go index 76e999988..4774094f4 100644 --- a/api/backend_test.go +++ b/api/backend_test.go @@ -700,7 +700,6 @@ func TestLoginWithKey(t *testing.T) { activeAccount, err := b.GetActiveAccount() require.NoError(t, err) require.NotNil(t, activeAccount.ColorHash) - require.NotZero(t, activeAccount.ColorID) } func TestVerifyDatabasePassword(t *testing.T) { diff --git a/api/geth_backend.go b/api/geth_backend.go index 859fcdb64..08fb2e8ca 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -399,7 +399,7 @@ func (b *GethStatusBackend) startNodeWithKey(acc multiaccounts.Account, password return err } - if acc.ColorHash == nil || acc.ColorID == 0 { + if acc.ColorHash == nil { multiAccount, err := b.updateAccountColorHashAndColorID(acc.KeyUID, accountsDB) if err != nil { return err @@ -475,7 +475,7 @@ func (b *GethStatusBackend) updateAccountColorHashAndColorID(keyUID string, acco if err != nil { return nil, err } - if multiAccount.ColorHash == nil || multiAccount.ColorID == 0 { + if multiAccount.ColorHash == nil { keypair, err := accountsDB.GetKeypairByKeyUID(keyUID) if err != nil { return nil, err @@ -612,7 +612,7 @@ func (b *GethStatusBackend) startNodeWithAccount(acc multiaccounts.Account, pass return err } - if acc.ColorHash == nil || acc.ColorID == 0 { + if acc.ColorHash == nil { multiAccount, err := b.updateAccountColorHashAndColorID(acc.KeyUID, accountsDB) if err != nil { return err