From 1096b1633609fba29941792d78f2adfbff5cdeeb Mon Sep 17 00:00:00 2001 From: Omar Basem Date: Wed, 6 Dec 2023 14:47:38 +0400 Subject: [PATCH] feat: wallet - emoji and color (#4322) * feat: init wallet with emoji --- api/backend_test.go | 3 +++ api/create_account_and_login_test.go | 1 + api/geth_backend.go | 3 ++- protocol/requests/create_account.go | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/api/backend_test.go b/api/backend_test.go index 40991933a..471c1a12f 100644 --- a/api/backend_test.go +++ b/api/backend_test.go @@ -759,6 +759,7 @@ func TestLoginAccount(t *testing.T) { createAccountRequest := &requests.CreateAccount{ DisplayName: "some-display-name", CustomizationColor: "#ffffff", + Emoji: "some", Password: password, BackupDisabledDataDir: tmpdir, NetworkID: 1, @@ -1303,6 +1304,7 @@ func TestCreateWallet(t *testing.T) { createAccountRequest := &requests.CreateAccount{ DisplayName: "some-display-name", CustomizationColor: "#ffffff", + Emoji: "emoji", Password: password, BackupDisabledDataDir: tmpdir, NetworkID: 1, @@ -1366,6 +1368,7 @@ func TestSetFleet(t *testing.T) { BackupDisabledDataDir: tmpdir, NetworkID: 1, LogFilePath: tmpdir + "/log", + Emoji: "some", } c := make(chan interface{}, 10) signal.SetMobileSignalHandler(func(data []byte) { diff --git a/api/create_account_and_login_test.go b/api/create_account_and_login_test.go index d5e91b406..381bdfc36 100644 --- a/api/create_account_and_login_test.go +++ b/api/create_account_and_login_test.go @@ -29,6 +29,7 @@ func TestCreateAccountAndLogin(t *testing.T) { "verifyTransactionChainID":1, "currentNetwork":"mainnet_rpc", "customizationColor":"blue", + "emoji": "some", "previewPrivacy":true, "verifyTransactionURL":"https://eth-archival.gateway.pokt.network/v1/lb/3ef2018191814b7e1009b8d9", "imagePath":null, diff --git a/api/geth_backend.go b/api/geth_backend.go index 97f6b5894..219903d1e 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -1372,7 +1372,8 @@ func (b *GethStatusBackend) generateOrImportAccount(mnemonic string, customizati PublicKey: types.Hex2Bytes(walletDerivedAccount.PublicKey), KeyUID: info.KeyUID, Address: types.HexToAddress(walletDerivedAccount.Address), - ColorID: "", + ColorID: multiacccommon.CustomizationColor(request.CustomizationColor), + Emoji: request.Emoji, Wallet: true, Path: pathDefaultWallet, Name: walletAccountDefaultName, diff --git a/protocol/requests/create_account.go b/protocol/requests/create_account.go index 4066f8ee0..b01ab399a 100644 --- a/protocol/requests/create_account.go +++ b/protocol/requests/create_account.go @@ -20,6 +20,7 @@ type CreateAccount struct { Password string `json:"password"` ImagePath string `json:"imagePath"` CustomizationColor string `json:"customizationColor"` + Emoji string `json:"emoji"` WakuV2Nameserver *string `json:"wakuV2Nameserver"` WakuV2LightClient bool `json:"wakuV2LightClient"`