From 7063ad11aabf5f6ccb1db4b12e55b69292fd9707 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Wed, 5 Jul 2023 14:41:58 +0200 Subject: [PATCH] chore: synchronization improvements applied to keycards This is the second step of improvements over keypairs/keycards/accounts. - `SyncKeycardAction` protobuf removed - `SyncKeypair` protobuf is used for syncing keycards state as well as for all keycards related changes - `last_update_clock` column removed from `keypairs` table cause as well as for accounts, any keycard related change is actually a change made on a related keypair, thus a keypair's clock keeps the clock of the last change - `position` column added to `keypairs` table, needed to display keycards in the same order accross devices --- VERSION | 2 +- api/backend_test.go | 6 +- api/geth_backend.go | 22 +- appdatabase/migrations/bindata.go | 587 +++++++++------- ...36552_keycards_table_columns_update.up.sql | 35 + multiaccounts/accounts/database.go | 34 +- multiaccounts/accounts/keycard_database.go | 648 +++++++----------- .../accounts/keycard_database_test.go | 351 ++++------ multiaccounts/accounts/test_helper.go | 26 +- protocol/messenger.go | 14 - protocol/messenger_backup_test.go | 27 +- protocol/messenger_handler.go | 17 +- protocol/messenger_keycard.go | 247 ++----- protocol/messenger_response.go | 17 - .../messenger_sync_keycard_change_test.go | 386 +++-------- .../messenger_sync_keycards_state_test.go | 462 ++++--------- protocol/messenger_wallet.go | 19 +- .../application_metadata_message.pb.go | 165 +++-- .../application_metadata_message.proto | 13 +- protocol/protobuf/pairing.pb.go | 541 ++++++--------- protocol/protobuf/pairing.proto | 19 +- protocol/v1/status_message.go | 2 - services/accounts/accounts.go | 79 +-- 23 files changed, 1463 insertions(+), 2256 deletions(-) create mode 100644 appdatabase/migrations/sql/1688636552_keycards_table_columns_update.up.sql diff --git a/VERSION b/VERSION index 606922a25..f528a360f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.161.4 +0.161.5 \ No newline at end of file diff --git a/api/backend_test.go b/api/backend_test.go index 4774094f4..14b95a83d 100644 --- a/api/backend_test.go +++ b/api/backend_test.go @@ -999,7 +999,7 @@ func TestConvertAccount(t *testing.T) { require.NoError(t, err) // Check that there is no registered keycards - keycards, err := db.GetKeycardByKeyUID(genAccInfo.KeyUID) + keycards, err := db.GetKeycardsWithSameKeyUID(genAccInfo.KeyUID) require.NoError(t, err) require.Equal(t, 0, len(keycards)) @@ -1026,7 +1026,7 @@ func TestConvertAccount(t *testing.T) { require.NoError(t, err) // Check that there is a registered keycard - keycards, err = db1.GetKeycardByKeyUID(genAccInfo.KeyUID) + keycards, err = db1.GetKeycardsWithSameKeyUID(genAccInfo.KeyUID) require.NoError(t, err) require.Equal(t, 1, len(keycards)) @@ -1059,7 +1059,7 @@ func TestConvertAccount(t *testing.T) { require.NoError(t, err) // Check that there is no registered keycards - keycards, err = db2.GetKeycardByKeyUID(genAccInfo.KeyUID) + keycards, err = db2.GetKeycardsWithSameKeyUID(genAccInfo.KeyUID) require.NoError(t, err) require.Equal(t, 0, len(keycards)) diff --git a/api/geth_backend.go b/api/geth_backend.go index a79a076a5..a37b17cd6 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -923,24 +923,26 @@ func (b *GethStatusBackend) ConvertToKeycardAccount(account multiaccounts.Accoun return err } + position, err := accountDB.GetPositionForNextNewKeycard() + if err != nil { + return err + } + kc := accounts.Keycard{ - KeycardUID: keycardUID, - KeycardName: displayName, - KeycardLocked: false, - KeyUID: account.KeyUID, - LastUpdateClock: uint64(time.Now().Unix()), + KeycardUID: keycardUID, + KeycardName: displayName, + KeycardLocked: false, + KeyUID: account.KeyUID, + Position: position, } for _, acc := range keypair.Accounts { kc.AccountsAddresses = append(kc.AccountsAddresses, acc.Address) } - addedKc, _, err := accountDB.AddKeycardOrAddAccountsIfKeycardIsAdded(kc) + err = accountDB.SaveOrUpdateKeycard(kc, uint64(time.Now().Unix()), true) if err != nil { return err } - if !addedKc { - return errors.New("couldn't register a keycard to keycards table") - } } masterAddress, err := accountDB.GetMasterAddress() @@ -1191,7 +1193,7 @@ func (b *GethStatusBackend) ConvertToRegularAccount(mnemonic string, currPasswor return err } - err = db.DeleteAllKeycardsWithKeyUID(accountInfo.KeyUID) + err = db.DeleteAllKeycardsWithKeyUID(accountInfo.KeyUID, uint64(time.Now().Unix())) if err != nil { return err } diff --git a/appdatabase/migrations/bindata.go b/appdatabase/migrations/bindata.go index efdd5985f..4a5e1a819 100644 --- a/appdatabase/migrations/bindata.go +++ b/appdatabase/migrations/bindata.go @@ -77,6 +77,7 @@ // 1687506642_include_watch_only_account_setting.up.sql (81B) // 1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql (98B) // 1688054680_add_columns_to_multitransaction.up.sql (342B) +// 1688636552_keycards_table_columns_update.up.sql (1.051kB) // doc.go (74B) package migrations @@ -87,6 +88,7 @@ import ( "crypto/sha256" "fmt" "io" + "io/ioutil" "os" "path/filepath" "strings" @@ -96,7 +98,7 @@ import ( func bindataRead(data []byte, name string) ([]byte, error) { gz, err := gzip.NewReader(bytes.NewBuffer(data)) if err != nil { - return nil, fmt.Errorf("read %q: %w", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } var buf bytes.Buffer @@ -104,7 +106,7 @@ func bindataRead(data []byte, name string) ([]byte, error) { clErr := gz.Close() if err != nil { - return nil, fmt.Errorf("read %q: %w", name, err) + return nil, fmt.Errorf("read %q: %v", name, err) } if clErr != nil { return nil, err @@ -160,7 +162,7 @@ func _1640111208_dummyUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1640111208_dummy.up.sql", size: 258, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xf0, 0xae, 0x20, 0x6e, 0x75, 0xd1, 0x36, 0x14, 0xf2, 0x40, 0xe5, 0xd6, 0x7a, 0xc4, 0xa5, 0x72, 0xaa, 0xb5, 0x4d, 0x71, 0x97, 0xb8, 0xe8, 0x95, 0x22, 0x95, 0xa2, 0xac, 0xaf, 0x48, 0x58}} return a, nil } @@ -180,7 +182,7 @@ func _1642666031_add_removed_clock_to_bookmarksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1642666031_add_removed_clock_to_bookmarks.up.sql", size: 117, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x4e, 0x38, 0x99, 0x7a, 0xc, 0x90, 0x13, 0xec, 0xfe, 0x2f, 0x55, 0xff, 0xb7, 0xb6, 0xaa, 0x96, 0xc6, 0x92, 0x79, 0xcc, 0xee, 0x4e, 0x99, 0x53, 0xfe, 0x1c, 0xbb, 0x32, 0x2, 0xa4, 0x27}} return a, nil } @@ -200,7 +202,7 @@ func _1643644541_gif_api_key_settingUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1643644541_gif_api_key_setting.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1b, 0x94, 0x28, 0xfb, 0x66, 0xd1, 0x7c, 0xb8, 0x89, 0xe2, 0xb4, 0x71, 0x65, 0x24, 0x57, 0x22, 0x95, 0x38, 0x97, 0x3, 0x9b, 0xc6, 0xa4, 0x41, 0x7b, 0xba, 0xf7, 0xdb, 0x70, 0xf7, 0x20, 0x3a}} return a, nil } @@ -220,7 +222,7 @@ func _1644188994_recent_stickersUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1644188994_recent_stickers.up.sql", size: 79, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1e, 0xad, 0xaa, 0x30, 0xbf, 0x4, 0x7, 0xf8, 0xc3, 0x3, 0xb8, 0x97, 0x23, 0x2b, 0xbd, 0x1c, 0x60, 0x69, 0xb0, 0x42, 0x5e, 0x6b, 0xd, 0xa7, 0xa3, 0x6b, 0x2e, 0xdc, 0x70, 0x13, 0x72, 0x7}} return a, nil } @@ -240,7 +242,7 @@ func _1646659233_add_address_to_dapp_permisssionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1646659233_add_address_to_dapp_permisssion.up.sql", size: 700, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0xb0, 0x35, 0xcc, 0x2e, 0x16, 0xe6, 0x15, 0x86, 0x2c, 0x37, 0x80, 0xae, 0xa3, 0xc5, 0x31, 0x78, 0x5, 0x9d, 0xcd, 0x7b, 0xeb, 0x5f, 0xf2, 0xb3, 0x74, 0x72, 0xdf, 0xcf, 0x88, 0xb, 0x40}} return a, nil } @@ -260,7 +262,7 @@ func _1646841105_add_emoji_accountUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1646841105_add_emoji_account.up.sql", size: 96, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe6, 0x77, 0x29, 0x95, 0x18, 0x64, 0x82, 0x63, 0xe7, 0xaf, 0x6c, 0xa9, 0x15, 0x7d, 0x46, 0xa6, 0xbc, 0xdf, 0xa7, 0xd, 0x2b, 0xd2, 0x2d, 0x97, 0x4d, 0xa, 0x6b, 0xd, 0x6e, 0x90, 0x42, 0x5c}} return a, nil } @@ -280,7 +282,7 @@ func _1647278782_display_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647278782_display_name.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xa1, 0x1f, 0x3e, 0x61, 0x65, 0x8d, 0xff, 0xee, 0xde, 0xc5, 0x91, 0xd9, 0x5c, 0xb5, 0xe2, 0xf0, 0xb7, 0xe7, 0x5c, 0x5c, 0x16, 0x25, 0x89, 0xee, 0x78, 0x12, 0xea, 0x3e, 0x48, 0x41, 0xa6}} return a, nil } @@ -300,7 +302,7 @@ func _1647862838_reset_last_backupUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647862838_reset_last_backup.up.sql", size: 37, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xe3, 0xd5, 0xf6, 0x5f, 0xfe, 0x65, 0xfa, 0x1d, 0x88, 0xf8, 0x5f, 0x24, 0x71, 0x34, 0x68, 0x96, 0x2a, 0x60, 0x87, 0x15, 0x82, 0x4d, 0x8a, 0x59, 0x3d, 0x1f, 0xd8, 0x56, 0xd4, 0xfb, 0xda}} return a, nil } @@ -320,7 +322,7 @@ func _1647871652_add_settings_sync_clock_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647871652_add_settings_sync_clock_table.up.sql", size: 1044, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd8, 0x58, 0xec, 0x85, 0x90, 0xfa, 0x30, 0x98, 0x98, 0x9a, 0xa6, 0xa8, 0x96, 0x2b, 0x38, 0x93, 0xf3, 0xae, 0x46, 0x74, 0xa4, 0x41, 0x62, 0x9b, 0x2, 0x86, 0xbf, 0xe5, 0x2a, 0xce, 0xe2, 0xc0}} return a, nil } @@ -340,7 +342,7 @@ func _1647880168_add_torrent_configUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647880168_add_torrent_config.up.sql", size: 211, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1, 0x92, 0x22, 0x37, 0x96, 0xf3, 0xb5, 0x5b, 0x27, 0xd0, 0x7d, 0x43, 0x5, 0x4e, 0x9d, 0xe2, 0x49, 0xbe, 0x86, 0x31, 0xa1, 0x89, 0xff, 0xd6, 0x51, 0xe0, 0x9c, 0xb, 0xda, 0xfc, 0xf2, 0x93}} return a, nil } @@ -360,7 +362,7 @@ func _1647882837_add_communities_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647882837_add_communities_settings_table.up.sql", size: 206, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xbd, 0x87, 0x78, 0x99, 0xd9, 0x5d, 0xbd, 0xf7, 0x57, 0x9c, 0xca, 0x97, 0xbd, 0xb3, 0xe9, 0xb5, 0x89, 0x31, 0x3f, 0xf6, 0x5c, 0x13, 0xb, 0xc3, 0x54, 0x93, 0x18, 0x40, 0x7, 0x82, 0xfe, 0x7e}} return a, nil } @@ -380,7 +382,7 @@ func _1647956635_add_waku_messages_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1647956635_add_waku_messages_table.up.sql", size: 266, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0xe, 0xe1, 0xdc, 0xda, 0x2e, 0x89, 0x8d, 0xdc, 0x2a, 0x1c, 0x13, 0xa1, 0xfc, 0xfe, 0xf, 0xb2, 0xb9, 0x85, 0xc8, 0x45, 0xd6, 0xd1, 0x7, 0x5c, 0xa3, 0x8, 0x47, 0x44, 0x6d, 0x96, 0xe0}} return a, nil } @@ -400,7 +402,7 @@ func _1648554928_network_testUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1648554928_network_test.up.sql", size: 132, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9a, 0xc5, 0x7f, 0x87, 0xf3, 0x2c, 0xf7, 0xbb, 0xd3, 0x3a, 0x4e, 0x76, 0x88, 0xca, 0xaf, 0x73, 0xce, 0x8f, 0xa1, 0xf6, 0x3d, 0x4d, 0xed, 0x6f, 0x49, 0xf2, 0xfe, 0x56, 0x2a, 0x60, 0x68, 0xca}} return a, nil } @@ -420,7 +422,7 @@ func _1649174829_add_visitble_tokenUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1649174829_add_visitble_token.up.sql", size: 84, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa3, 0x22, 0xc0, 0x2b, 0x3f, 0x4f, 0x3d, 0x5e, 0x4c, 0x68, 0x7c, 0xd0, 0x15, 0x36, 0x9f, 0xec, 0xa1, 0x2a, 0x7b, 0xb4, 0xe3, 0xc6, 0xc9, 0xb4, 0x81, 0x50, 0x4a, 0x11, 0x3b, 0x35, 0x7, 0xcf}} return a, nil } @@ -440,7 +442,7 @@ func _1649882262_add_derived_from_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1649882262_add_derived_from_accounts.up.sql", size: 110, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x11, 0xb9, 0x44, 0x4d, 0x85, 0x8d, 0x7f, 0xb4, 0xae, 0x4f, 0x5c, 0x66, 0x64, 0xb6, 0xe2, 0xe, 0x3d, 0xad, 0x9d, 0x8, 0x4f, 0xab, 0x6e, 0xa8, 0x7d, 0x76, 0x3, 0xad, 0x96, 0x1, 0xee, 0x5c}} return a, nil } @@ -460,7 +462,7 @@ func _1650612625_add_community_message_archive_hashes_tableUpSql() (*asset, erro return nil, err } - info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1650612625_add_community_message_archive_hashes_table.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x48, 0x31, 0xb3, 0x75, 0x23, 0xe2, 0x45, 0xe, 0x47, 0x1b, 0x35, 0xa5, 0x6e, 0x83, 0x4e, 0x64, 0x7d, 0xd7, 0xa2, 0xda, 0xe9, 0x53, 0xf1, 0x16, 0x86, 0x2c, 0x57, 0xad, 0xfa, 0xca, 0x39, 0xde}} return a, nil } @@ -480,7 +482,7 @@ func _1650616788_add_communities_archives_info_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1650616788_add_communities_archives_info_table.up.sql", size: 208, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd1, 0x4f, 0x80, 0x45, 0xb9, 0xd9, 0x15, 0xe2, 0x78, 0xd0, 0xcb, 0x71, 0xc1, 0x1b, 0xb7, 0x1b, 0x1b, 0x97, 0xfe, 0x47, 0x53, 0x3c, 0x62, 0xbc, 0xdd, 0x3a, 0x94, 0x1a, 0xc, 0x48, 0x76, 0xe}} return a, nil } @@ -500,7 +502,7 @@ func _1652715604_add_clock_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1652715604_add_clock_accounts.up.sql", size: 62, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb6, 0xd9, 0x8d, 0x73, 0xc9, 0xef, 0xfa, 0xb1, 0x4b, 0xa5, 0xf3, 0x5, 0x19, 0x26, 0x46, 0xf8, 0x47, 0x93, 0xdb, 0xac, 0x2, 0xef, 0xf9, 0x71, 0x56, 0x83, 0xe6, 0x2d, 0xb0, 0xd7, 0x83, 0x5c}} return a, nil } @@ -520,7 +522,7 @@ func _1653037334_add_notifications_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1653037334_add_notifications_settings_table.up.sql", size: 1276, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4b, 0xc4, 0x65, 0xac, 0xa, 0xf2, 0xef, 0xb6, 0x39, 0x3c, 0xc5, 0xb1, 0xb2, 0x9c, 0x86, 0x58, 0xe0, 0x38, 0xcb, 0x57, 0x3c, 0x76, 0x73, 0x87, 0x79, 0x4e, 0xf6, 0xed, 0xb0, 0x8e, 0x9e, 0xa}} return a, nil } @@ -540,7 +542,7 @@ func _1654702119_add_mutual_contact_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1654702119_add_mutual_contact_settings.up.sql", size: 78, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x26, 0x66, 0x67, 0x50, 0xfe, 0xd7, 0xe3, 0x29, 0x8b, 0xff, 0x9d, 0x5a, 0x87, 0xa7, 0x99, 0x6e, 0xd6, 0xcd, 0x2e, 0xbb, 0x17, 0xdf, 0x7f, 0xf7, 0xa3, 0xfa, 0x32, 0x7c, 0x2d, 0x92, 0xc8, 0x74}} return a, nil } @@ -560,7 +562,7 @@ func _1655375270_add_clock_field_to_communities_settings_tableUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1655375270_add_clock_field_to_communities_settings_table.up.sql", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x19, 0xc5, 0xc0, 0xf9, 0x84, 0x53, 0xdf, 0x83, 0xcf, 0xb6, 0x40, 0x6d, 0xf5, 0xdc, 0x77, 0x37, 0xb7, 0xe3, 0xa, 0x75, 0xe7, 0x6, 0x11, 0xca, 0x2b, 0x51, 0x92, 0xdd, 0x7d, 0xdb, 0xc3, 0xf5}} return a, nil } @@ -580,7 +582,7 @@ func _1655385721_drop_networks_configUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1655385721_drop_networks_config.up.sql", size: 27, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfc, 0xa7, 0x20, 0xbb, 0x67, 0x21, 0xe, 0xc6, 0xc8, 0x21, 0x74, 0xe0, 0xce, 0xc8, 0xe2, 0x2, 0xb4, 0xea, 0xf0, 0xe5, 0xc4, 0x4d, 0xdd, 0xd4, 0x52, 0x31, 0xa9, 0x3d, 0xcd, 0xd8, 0x9b, 0xab}} return a, nil } @@ -600,7 +602,7 @@ func _1655385724_networks_chaincolor_shortnameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1655385724_networks_chainColor_shortName.up.sql", size: 220, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd9, 0xe7, 0x84, 0xbb, 0x5f, 0xd2, 0x2c, 0x42, 0x88, 0x62, 0x52, 0xb6, 0x58, 0x31, 0xac, 0xc, 0x96, 0x2b, 0x1b, 0xe5, 0x4e, 0x9a, 0x3a, 0xf6, 0xf6, 0xfc, 0xa9, 0x1a, 0x35, 0x62, 0x28, 0x88}} return a, nil } @@ -620,7 +622,7 @@ func _1655456688_add_deleted_at_field_to_bookmarks_tableUpSql() (*asset, error) return nil, err } - info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql", size: 69, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe7, 0x9a, 0xbd, 0x9a, 0xc9, 0xf, 0xdf, 0x90, 0x0, 0x5d, 0xea, 0x6e, 0x7d, 0x51, 0x95, 0xcd, 0x90, 0xd3, 0x1a, 0x36, 0x6c, 0xf4, 0xbd, 0xa7, 0x6b, 0xbf, 0xe5, 0xdb, 0xa3, 0x88, 0xe3, 0x50}} return a, nil } @@ -640,7 +642,7 @@ func _1655462032_create_bookmarks_deleted_at_indexUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1655462032_create_bookmarks_deleted_at_index.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf, 0x8e, 0x20, 0x6b, 0x14, 0x9e, 0xcd, 0x97, 0xd3, 0xfe, 0x62, 0x3, 0x26, 0x59, 0x1, 0x6c, 0x99, 0xef, 0x6d, 0x21, 0xd4, 0xb5, 0xa3, 0xf4, 0x39, 0x40, 0x54, 0x6, 0xd, 0x60, 0x13, 0x38}} return a, nil } @@ -660,7 +662,7 @@ func _1657617291_add_multi_transactions_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1657617291_add_multi_transactions_table.up.sql", size: 412, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x86, 0xb0, 0x4e, 0x8c, 0x4, 0x82, 0xb4, 0x43, 0xaa, 0xd0, 0x16, 0xdd, 0xcb, 0x88, 0x81, 0xac, 0x4, 0x34, 0x1a, 0x8f, 0x2e, 0xc5, 0x69, 0xb, 0xf0, 0x17, 0xf7, 0xe3, 0x9, 0xe, 0x54, 0xe0}} return a, nil } @@ -680,7 +682,7 @@ func _1660134042_add_social_links_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1660134042_add_social_links_settings_table.up.sql", size: 334, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x84, 0x73, 0xb6, 0xe7, 0x3f, 0xaa, 0x39, 0x9a, 0x56, 0x56, 0x31, 0xf1, 0x8e, 0x26, 0x23, 0x1, 0xe4, 0xfa, 0x98, 0xfe, 0x78, 0x87, 0x20, 0xcb, 0x52, 0xf4, 0x38, 0x7f, 0xc4, 0x1c, 0x4, 0x22}} return a, nil } @@ -700,7 +702,7 @@ func _1660134060_settings_bioUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1660134060_settings_bio.up.sql", size: 91, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x46, 0x25, 0xa0, 0xa6, 0x47, 0xff, 0xbc, 0x2a, 0x0, 0xff, 0x59, 0x4b, 0xb0, 0xc9, 0x4e, 0x15, 0xe4, 0xd9, 0xda, 0xeb, 0xfe, 0x55, 0x98, 0xc3, 0x9d, 0x96, 0xe7, 0xf, 0xd1, 0x5c, 0x93, 0x73}} return a, nil } @@ -720,7 +722,7 @@ func _1660134070_add_wakuv2_storeUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1660134070_add_wakuv2_store.up.sql", size: 269, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x1d, 0xe6, 0xc3, 0x9, 0xef, 0xdc, 0xae, 0x49, 0x30, 0x78, 0x54, 0xd6, 0xdb, 0xbf, 0xc0, 0x8e, 0x25, 0x8f, 0xfc, 0x67, 0x80, 0x39, 0x37, 0xd4, 0x86, 0xc1, 0x85, 0xc8, 0x99, 0xc4, 0x59, 0xd4}} return a, nil } @@ -740,7 +742,7 @@ func _1660134072_waku2_store_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1660134072_waku2_store_messages.up.sql", size: 497, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xeb, 0xb4, 0xa0, 0xa1, 0x2b, 0xcb, 0x4c, 0x3c, 0xc6, 0xd0, 0xe8, 0x96, 0xe3, 0x96, 0xf1, 0x4f, 0x1f, 0xe0, 0xe7, 0x1f, 0x85, 0xa3, 0xe, 0xf7, 0x52, 0x56, 0x63, 0x2b, 0xb0, 0x87, 0x7b}} return a, nil } @@ -760,7 +762,7 @@ func _1662365868_add_key_uid_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1662365868_add_key_uid_accounts.up.sql", size: 68, mode: os.FileMode(0644), modTime: time.Unix(1687770677, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc6, 0xd8, 0x2f, 0x2f, 0x3b, 0xa8, 0xbd, 0x6d, 0xf6, 0x87, 0x7e, 0xd2, 0xf1, 0xa2, 0xf7, 0x81, 0x6a, 0x23, 0x10, 0xbc, 0xbf, 0x5b, 0xe7, 0x2b, 0x9c, 0xa9, 0x8a, 0x18, 0xbb, 0xd0, 0x86, 0x91}} return a, nil } @@ -780,7 +782,7 @@ func _1662447680_add_keypairs_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1662447680_add_keypairs_table.up.sql", size: 218, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xdc, 0x25, 0xa9, 0xc7, 0x63, 0x27, 0x97, 0x35, 0x5f, 0x6b, 0xab, 0x26, 0xcb, 0xf9, 0xbd, 0x5e, 0xac, 0x3, 0xa0, 0x5e, 0xb9, 0x71, 0xa3, 0x1f, 0xb3, 0x4f, 0x7f, 0x79, 0x28, 0x48, 0xbe, 0xc}} return a, nil } @@ -800,7 +802,7 @@ func _1662460056_move_favourites_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1662460056_move_favourites_to_saved_addresses.up.sql", size: 233, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0xa2, 0x8c, 0xa3, 0xec, 0xad, 0xdf, 0xc3, 0x48, 0x5, 0x9b, 0x50, 0x25, 0x59, 0xae, 0x7d, 0xee, 0x58, 0xd2, 0x41, 0x27, 0xf2, 0x22, 0x2e, 0x9a, 0xb9, 0x4a, 0xcc, 0x38, 0x6e, 0x3a, 0xb2}} return a, nil } @@ -820,7 +822,7 @@ func _1662738097_add_base_fee_transactionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1662738097_add_base_fee_transaction.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6b, 0xfb, 0x10, 0xae, 0xfc, 0x77, 0x70, 0x98, 0x6f, 0xec, 0xaa, 0xcd, 0x7, 0xc7, 0x74, 0x23, 0xc, 0xd5, 0x1e, 0x82, 0xdd, 0xfe, 0xff, 0x3b, 0xd2, 0x49, 0x10, 0x5b, 0x30, 0xc, 0x2d, 0xb0}} return a, nil } @@ -840,7 +842,7 @@ func _1662972194_add_keypairs_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1662972194_add_keypairs_table.up.sql", size: 345, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0x76, 0xf2, 0x86, 0xe1, 0x7e, 0xe9, 0x47, 0x32, 0x48, 0xd5, 0x6b, 0xe5, 0xd, 0xab, 0xb7, 0xf1, 0xd4, 0xf1, 0xad, 0x38, 0xa6, 0x11, 0xe7, 0xce, 0x5c, 0x11, 0x11, 0xf, 0x47, 0xb2, 0x4}} return a, nil } @@ -860,7 +862,7 @@ func _1664392661_add_third_party_id_to_waku_messagesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1664392661_add_third_party_id_to_waku_messages.up.sql", size: 70, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfd, 0x67, 0x66, 0x9e, 0x66, 0x74, 0xce, 0x1c, 0xb, 0x1b, 0x9d, 0xd5, 0xfc, 0x65, 0xe, 0x83, 0x90, 0x4c, 0x61, 0x4e, 0x6b, 0xe7, 0x86, 0xbe, 0x36, 0x4f, 0x91, 0x36, 0x4, 0x47, 0x7b, 0x82}} return a, nil } @@ -880,7 +882,7 @@ func _1664783660_add_sync_info_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1664783660_add_sync_info_to_saved_addresses.up.sql", size: 388, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x67, 0x7c, 0x3a, 0x95, 0x4e, 0x55, 0xb2, 0xbd, 0xb4, 0x18, 0x93, 0xc1, 0xcf, 0x9f, 0x12, 0xbb, 0x49, 0x8a, 0x2a, 0x6a, 0x2a, 0x7f, 0xad, 0x44, 0xc3, 0xf, 0x3a, 0x79, 0x18, 0xb9, 0x4c, 0x64}} return a, nil } @@ -900,7 +902,7 @@ func _1668109917_wakunodesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1668109917_wakunodes.up.sql", size: 99, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x29, 0xaa, 0x9e, 0x2, 0x66, 0x85, 0x69, 0xa8, 0xd9, 0xe2, 0x4b, 0x8d, 0x2a, 0x9c, 0xdf, 0xd2, 0xef, 0x64, 0x58, 0xe3, 0xa6, 0xe7, 0xc1, 0xd1, 0xc8, 0x9c, 0xc0, 0x2c, 0x1, 0xa8, 0x7b, 0x81}} return a, nil } @@ -920,7 +922,7 @@ func _1670249678_display_name_to_settings_sync_clock_tableUpSql() (*asset, error return nil, err } - info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1670249678_display_name_to_settings_sync_clock_table.up.sql", size: 83, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0x18, 0xdc, 0xc4, 0x1f, 0x79, 0x22, 0x16, 0x4d, 0xdf, 0x6c, 0x66, 0xd5, 0xa4, 0x88, 0x5d, 0x5, 0x37, 0xa7, 0x41, 0x5, 0x50, 0xae, 0x12, 0xfa, 0x7e, 0x89, 0x24, 0x5c, 0xae, 0x30, 0xfc}} return a, nil } @@ -940,7 +942,7 @@ func _1670836810_add_imported_flag_to_community_archive_hashesUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1670836810_add_imported_flag_to_community_archive_hashes.up.sql", size: 144, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x6f, 0xf, 0xf0, 0xbd, 0xfe, 0x63, 0x25, 0x8f, 0x5e, 0x46, 0x4b, 0x45, 0x31, 0x8b, 0x3e, 0xd8, 0x6b, 0x5d, 0x9d, 0x6d, 0x10, 0x9a, 0x87, 0x4b, 0x18, 0xc6, 0x39, 0x81, 0x6e, 0xe4, 0x75, 0xfb}} return a, nil } @@ -960,7 +962,7 @@ func _1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql() (*asset, return nil, err } - info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql", size: 86, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xda, 0x8b, 0x4b, 0xd6, 0xd8, 0xe2, 0x3d, 0xf7, 0x6b, 0xcd, 0x1e, 0x70, 0x9, 0x2e, 0x35, 0x4, 0x61, 0xc3, 0xb5, 0x9d, 0xc5, 0x27, 0x21, 0xa, 0x5a, 0xd6, 0x3e, 0xa6, 0x24, 0xa2, 0x12, 0xdf}} return a, nil } @@ -980,7 +982,7 @@ func _1672933930_switcher_cardUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1672933930_switcher_card.up.sql", size: 162, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x39, 0xba, 0xdc, 0xbb, 0x40, 0x4, 0xf2, 0x10, 0xdf, 0xb4, 0xd2, 0x80, 0x8a, 0x74, 0x4d, 0xf6, 0xbc, 0x50, 0x7, 0xd, 0x22, 0x7f, 0xc4, 0xaf, 0xaa, 0xde, 0xdc, 0x71, 0xe9, 0x42, 0x98, 0x36}} return a, nil } @@ -1000,7 +1002,7 @@ func _1674056187_add_price_cacheUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1674056187_add_price_cache.up.sql", size: 255, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb7, 0x79, 0x6a, 0x9b, 0x28, 0xd1, 0x22, 0xf0, 0x84, 0x76, 0x40, 0x39, 0x49, 0x15, 0x5d, 0xaa, 0xfd, 0x11, 0xff, 0x13, 0x27, 0x42, 0x12, 0xfa, 0x82, 0xe6, 0x7a, 0xf0, 0x5e, 0x1f, 0xe3, 0xba}} return a, nil } @@ -1020,7 +1022,7 @@ func _1674136690_ens_usernamesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1674136690_ens_usernames.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x7a, 0xf3, 0xa8, 0x88, 0x99, 0xd6, 0x9c, 0x69, 0x48, 0x3c, 0x10, 0xda, 0x72, 0xdc, 0x14, 0xd, 0x6e, 0x8c, 0x82, 0x92, 0x2d, 0x2c, 0xee, 0x4c, 0x70, 0xa4, 0xdc, 0x5c, 0x5, 0x2, 0xc3}} return a, nil } @@ -1040,7 +1042,7 @@ func _1674232431_add_balance_historyUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1674232431_add_balance_history.up.sql", size: 698, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf7, 0xb5, 0x18, 0xca, 0x4a, 0x93, 0xbb, 0x6f, 0xa4, 0xee, 0xe4, 0x3e, 0xff, 0x6a, 0x4b, 0xe2, 0xe1, 0x61, 0x28, 0xee, 0xc5, 0x26, 0x57, 0x61, 0x5e, 0x6d, 0x44, 0x1e, 0x85, 0x43, 0x70, 0xa2}} return a, nil } @@ -1060,7 +1062,7 @@ func _1676368933_keypairs_to_keycardsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1676368933_keypairs_to_keycards.up.sql", size: 639, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x81, 0x93, 0x27, 0x2, 0xf0, 0x37, 0x81, 0x65, 0xa4, 0xb3, 0x5b, 0x60, 0x36, 0x95, 0xfc, 0x81, 0xf0, 0x3b, 0x7c, 0xc3, 0x2c, 0x85, 0xbd, 0x38, 0x46, 0xa4, 0x95, 0x4a, 0x6, 0x3e, 0x74, 0xd5}} return a, nil } @@ -1080,7 +1082,7 @@ func _1676951398_add_currency_format_cacheUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1676951398_add_currency_format_cache.up.sql", size: 291, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf9, 0xa3, 0x76, 0x35, 0xca, 0xf, 0xe8, 0xdf, 0xd9, 0x61, 0xf9, 0xed, 0xfc, 0x6d, 0xf5, 0xe, 0x11, 0x88, 0xbd, 0x14, 0x92, 0xc6, 0x57, 0x53, 0xe, 0xcd, 0x52, 0xf4, 0xa9, 0xb1, 0xdd, 0xfd}} return a, nil } @@ -1100,7 +1102,7 @@ func _1676968196_keycards_add_clock_columnUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1676968196_keycards_add_clock_column.up.sql", size: 73, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xf, 0x1c, 0x28, 0x41, 0x57, 0x57, 0x6c, 0xe, 0x75, 0x6b, 0x75, 0x12, 0x0, 0x18, 0x1e, 0x88, 0x1e, 0x45, 0xe0, 0x32, 0xb9, 0xd4, 0xd9, 0x2e, 0xc8, 0xb, 0x80, 0x6, 0x51, 0x3d, 0x28}} return a, nil } @@ -1120,7 +1122,7 @@ func _1676968197_add_fallback_rpc_to_networksUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1676968197_add_fallback_rpc_to_networks.up.sql", size: 112, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x77, 0x6a, 0xc6, 0x45, 0xfa, 0x62, 0x84, 0x74, 0x6d, 0x7c, 0xd7, 0x1d, 0x79, 0xb6, 0x38, 0x43, 0xa8, 0x8, 0x6b, 0x75, 0x3d, 0x9, 0x2, 0xc5, 0x9f, 0xbb, 0x45, 0x56, 0x4c, 0x4e, 0x17, 0x89}} return a, nil } @@ -1140,7 +1142,7 @@ func _1677674090_add_chains_ens_istest_to_saved_addressesUpSql() (*asset, error) return nil, err } - info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql", size: 638, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xa8, 0x2d, 0xa4, 0x1b, 0xf6, 0x6a, 0x13, 0x7b, 0xe, 0x59, 0xcd, 0xe2, 0x4e, 0x81, 0x99, 0xc4, 0x33, 0x84, 0xde, 0x66, 0xca, 0xac, 0x2f, 0x5, 0x90, 0xac, 0xfd, 0x4e, 0xfc, 0x55, 0x44, 0xe5}} return a, nil } @@ -1160,7 +1162,7 @@ func _1677681143_accounts_table_type_column_updateUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1677681143_accounts_table_type_column_update.up.sql", size: 135, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd2, 0xc4, 0x6, 0x42, 0x50, 0x1d, 0xf4, 0x48, 0x55, 0xbc, 0xa2, 0x19, 0xdd, 0xad, 0xc8, 0xc, 0xa7, 0x30, 0xb6, 0xaf, 0xe, 0x2b, 0xaa, 0x2a, 0xa4, 0xe1, 0xb9, 0x41, 0x23, 0x66, 0xd3, 0x3}} return a, nil } @@ -1180,7 +1182,7 @@ func _1678264207_accounts_table_new_columns_addedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1678264207_accounts_table_new_columns_added.up.sql", size: 130, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf4, 0xd4, 0xf3, 0x35, 0xef, 0x5c, 0x19, 0x3c, 0x15, 0x90, 0x60, 0xbd, 0x1f, 0x81, 0xf0, 0x86, 0x73, 0x89, 0xa0, 0x70, 0xf2, 0x46, 0xae, 0xea, 0xd0, 0xc6, 0x9e, 0x55, 0x4a, 0x54, 0x62, 0xbb}} return a, nil } @@ -1200,7 +1202,7 @@ func _1680770368_add_bio_to_settings_sync_clock_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1680770368_add_bio_to_settings_sync_clock_table.up.sql", size: 75, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4a, 0x52, 0xf6, 0x3f, 0xaa, 0xd, 0xa0, 0xee, 0xe8, 0xe6, 0x16, 0x21, 0x80, 0x61, 0xe4, 0x7a, 0x4e, 0x37, 0x8d, 0x30, 0x51, 0x20, 0x4d, 0x15, 0x47, 0xfb, 0x6, 0xa1, 0xce, 0xc8, 0x27, 0x5a}} return a, nil } @@ -1220,7 +1222,7 @@ func _1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql() (*asset, error return nil, err } - info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql", size: 311, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3d, 0x74, 0x81, 0x7d, 0x9e, 0x77, 0xb6, 0xfe, 0xe3, 0xcb, 0x48, 0xe5, 0x5f, 0x39, 0x23, 0xa1, 0x7d, 0x53, 0x22, 0xe8, 0x96, 0x15, 0x8a, 0x1e, 0x8e, 0xbc, 0xe2, 0x1d, 0xc4, 0xc2, 0x56, 0x34}} return a, nil } @@ -1240,7 +1242,7 @@ func _1681392602_9d_sync_periodUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1681392602_9d_sync_period.up.sql", size: 60, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xc9, 0xa, 0x90, 0x29, 0x7f, 0x76, 0x98, 0xa7, 0x71, 0x80, 0x5a, 0x2f, 0xbe, 0x23, 0x9a, 0xd4, 0xf4, 0x39, 0x19, 0xd3, 0xa5, 0x34, 0x6e, 0x67, 0x6a, 0xbe, 0x8a, 0xad, 0x21, 0xc7, 0xba, 0x88}} return a, nil } @@ -1260,7 +1262,7 @@ func _1681762078_default_sync_period_9dUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1681762078_default_sync_period_9d.up.sql", size: 3002, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x3e, 0xd9, 0x26, 0xfc, 0xa9, 0x45, 0xc1, 0x81, 0xa8, 0xe2, 0x2c, 0xe9, 0x3c, 0xea, 0x1d, 0x37, 0x11, 0x45, 0x8c, 0x6c, 0xbc, 0xc2, 0x6, 0x69, 0x2, 0x75, 0x29, 0x40, 0x9f, 0xc5, 0xbb, 0x36}} return a, nil } @@ -1280,7 +1282,7 @@ func _1681780680_add_clock_to_social_links_settingsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1681780680_add_clock_to_social_links_settings.up.sql", size: 137, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x63, 0x11, 0xf5, 0x41, 0xe5, 0x5a, 0xf4, 0xe3, 0xf3, 0x14, 0x87, 0x28, 0xd8, 0xf0, 0x52, 0x31, 0x8, 0xd5, 0xbb, 0xf4, 0xff, 0x55, 0x5f, 0x42, 0x90, 0xcb, 0xf7, 0x46, 0x2, 0x6, 0xbe, 0x42}} return a, nil } @@ -1300,7 +1302,7 @@ func _1682073779_settings_table_remove_latest_derived_path_columnUpSql() (*asset return nil, err } - info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1682073779_settings_table_remove_latest_derived_path_column.up.sql", size: 4470, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x7a, 0x36, 0x2, 0x41, 0xd, 0x5c, 0xd1, 0x92, 0x85, 0x6d, 0x84, 0xff, 0x67, 0xa7, 0x4c, 0x67, 0xa4, 0xef, 0x52, 0x69, 0x1f, 0x22, 0x25, 0x92, 0xc, 0xb3, 0x89, 0x50, 0x91, 0xc, 0x49, 0xf9}} return a, nil } @@ -1320,7 +1322,7 @@ func _1682146075_add_created_at_to_saved_addressesUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1682146075_add_created_at_to_saved_addresses.up.sql", size: 107, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x88, 0xfe, 0x35, 0x9c, 0x6b, 0xdf, 0x67, 0x18, 0x16, 0xe4, 0xc9, 0xd4, 0x77, 0x7c, 0x4, 0xe2, 0x6c, 0x41, 0xd9, 0x53, 0x97, 0xfe, 0x5, 0xa3, 0x23, 0xce, 0x82, 0xad, 0x92, 0x5e, 0xd7, 0x7d}} return a, nil } @@ -1340,7 +1342,7 @@ func _1682393575_sync_ens_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1682393575_sync_ens_name.up.sql", size: 713, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfb, 0xea, 0xcb, 0x4d, 0x71, 0x5a, 0x49, 0x19, 0x8b, 0xef, 0x66, 0x27, 0x33, 0x89, 0xb0, 0xe, 0x37, 0x1b, 0x41, 0x8, 0x12, 0xcc, 0x56, 0xd8, 0x1b, 0xf, 0xf8, 0x50, 0x4b, 0x93, 0xf1, 0x29}} return a, nil } @@ -1360,7 +1362,7 @@ func _1683457503_add_blocks_ranges_sequential_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1683457503_add_blocks_ranges_sequential_table.up.sql", size: 263, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xfe, 0x57, 0x2e, 0x0, 0x6a, 0x6e, 0xd7, 0xeb, 0xe6, 0x66, 0x79, 0x32, 0x22, 0x82, 0x92, 0xf4, 0xc9, 0xf1, 0x58, 0x1a, 0x45, 0x60, 0x77, 0x50, 0xe7, 0x54, 0x4a, 0xc0, 0x42, 0x3a, 0x4f, 0x35}} return a, nil } @@ -1380,7 +1382,7 @@ func _1683627613_accounts_and_keycards_improvementsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1683627613_accounts_and_keycards_improvements.up.sql", size: 3640, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x8e, 0xbe, 0x62, 0xf5, 0x9, 0x42, 0x8c, 0x8f, 0xa8, 0x45, 0xe7, 0x36, 0xc9, 0xde, 0xf4, 0xe2, 0xfd, 0xc4, 0x8, 0xd0, 0xa3, 0x8, 0x64, 0xe2, 0x56, 0xcc, 0xa7, 0x6d, 0xc5, 0xcc, 0x82, 0x2c}} return a, nil } @@ -1400,7 +1402,7 @@ func _1685041348_settings_table_add_latest_derived_path_columnUpSql() (*asset, e return nil, err } - info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1685041348_settings_table_add_latest_derived_path_column.up.sql", size: 115, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x21, 0xd4, 0x1b, 0xbf, 0x8, 0xf9, 0xd4, 0xb0, 0xa0, 0x6, 0x5b, 0xfb, 0x7e, 0xff, 0xfa, 0xbf, 0xcc, 0x64, 0x47, 0x81, 0x8b, 0x5e, 0x17, 0x6a, 0xa7, 0xa4, 0x35, 0x8f, 0x30, 0x4f, 0xd9, 0xd}} return a, nil } @@ -1420,7 +1422,7 @@ func _1685440989_update_color_id_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1685440989_update_color_id_accounts.up.sql", size: 918, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x10, 0x2e, 0x51, 0x1d, 0x2d, 0x16, 0x84, 0xd6, 0xe8, 0xbc, 0x20, 0x53, 0x47, 0xb8, 0x40, 0x21, 0x52, 0x5c, 0xd9, 0xbb, 0xea, 0xe2, 0xa5, 0x77, 0xc8, 0x35, 0x4c, 0xe0, 0x9d, 0x42, 0x44, 0x50}} return a, nil } @@ -1440,7 +1442,7 @@ func _1685463947_add_to_asset_to_multitransactionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1685463947_add_to_asset_to_multitransaction.up.sql", size: 61, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xd3, 0x66, 0x15, 0x10, 0xfa, 0x66, 0x81, 0x68, 0xd9, 0xb4, 0x93, 0x9e, 0x11, 0xed, 0x1d, 0x16, 0x9d, 0x5a, 0xf8, 0xd7, 0x8, 0xea, 0x7a, 0xaf, 0xe4, 0xb3, 0x22, 0x19, 0xca, 0xff, 0x75, 0x7c}} return a, nil } @@ -1460,7 +1462,7 @@ func _1685880973_add_profile_links_settings_tableUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1685880973_add_profile_links_settings_table.up.sql", size: 1656, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x13, 0x23, 0x7b, 0x1e, 0x82, 0x61, 0xcc, 0x76, 0xd6, 0xc7, 0x42, 0x6e, 0x69, 0x21, 0x1b, 0xfd, 0x7d, 0xda, 0xd7, 0xb7, 0xc7, 0xd3, 0x22, 0x63, 0xfe, 0xc6, 0xd3, 0xdf, 0xc8, 0x5f, 0x50, 0xcc}} return a, nil } @@ -1480,7 +1482,7 @@ func _1686041510_add_idx_transfers_blkno_loadedUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1686041510_add_idx_transfers_blkno_loaded.up.sql", size: 71, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xe2, 0x5d, 0x7e, 0x43, 0x14, 0x3c, 0x50, 0x44, 0x25, 0xd0, 0xe1, 0x75, 0xba, 0x61, 0x7b, 0x68, 0x2e, 0x43, 0x74, 0x1d, 0x10, 0x61, 0x8e, 0x45, 0xe6, 0x25, 0x78, 0x81, 0x68, 0x6, 0x24, 0x5b}} return a, nil } @@ -1500,7 +1502,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x6c, 0xd9, 0x76, 0x83, 0x64, 0xf0, 0xf2, 0x74, 0x97, 0xca, 0xd7, 0xaa, 0x4, 0x74, 0x7c, 0x34, 0x56, 0x88, 0x10, 0xa9, 0x4d, 0x1d, 0x8e, 0x85, 0xc3, 0x66, 0x1, 0x2b, 0x30, 0x90, 0xf4}} return a, nil } @@ -1520,7 +1522,7 @@ func _1686048341_transfers_receipt_json_blob_outUpSqlUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql", size: 1500, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x49, 0xcd, 0xe3, 0xa6, 0x8c, 0x53, 0x51, 0xe6, 0x3c, 0x64, 0xcb, 0x3, 0x3, 0xb, 0x4d, 0x52, 0xa5, 0x1c, 0xcc, 0xe1, 0x23, 0x94, 0x14, 0x79, 0xd7, 0x56, 0x58, 0xef, 0xcc, 0x1a, 0x6, 0xa4}} return a, nil } @@ -1540,7 +1542,7 @@ func _1686825075_cleanup_token_addressUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1686825075_cleanup_token_address.up.sql", size: 273, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1686825075_cleanup_token_address.up.sql", size: 273, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x14, 0x72, 0x10, 0xec, 0x97, 0xc9, 0x3a, 0xdb, 0x39, 0x33, 0xc9, 0x6, 0x92, 0xbe, 0xe4, 0xc2, 0x5c, 0xb6, 0xaa, 0xe5, 0x25, 0x21, 0x4d, 0x74, 0x18, 0x94, 0xc, 0x33, 0x2f, 0xa4, 0x9, 0x99}} return a, nil } @@ -1560,7 +1562,7 @@ func _1687193315_transfers_extract_from_to_addressDownSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.down.sql", size: 104, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x9f, 0x6c, 0xd9, 0x76, 0x83, 0x64, 0xf0, 0xf2, 0x74, 0x97, 0xca, 0xd7, 0xaa, 0x4, 0x74, 0x7c, 0x34, 0x56, 0x88, 0x10, 0xa9, 0x4d, 0x1d, 0x8e, 0x85, 0xc3, 0x66, 0x1, 0x2b, 0x30, 0x90, 0xf4}} return a, nil } @@ -1580,7 +1582,7 @@ func _1687193315_transfers_extract_from_to_addressUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.up.sql", size: 499, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "1687193315_transfers_extract_from_to_address.up.sql", size: 499, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x4c, 0xef, 0xf4, 0x66, 0xac, 0x3a, 0xa6, 0xe3, 0x26, 0x43, 0x53, 0xe, 0xd8, 0xfe, 0xf2, 0xaa, 0x20, 0x8, 0x4e, 0x52, 0x49, 0x37, 0xbf, 0x46, 0xbf, 0x53, 0xa7, 0xcf, 0x27, 0x23, 0xab, 0x99}} return a, nil } @@ -1600,7 +1602,7 @@ func _1687249080_add_position_accountsUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1687249080_add_position_accounts.up..sql", size: 2053, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)} + info := bindataFileInfo{name: "1687249080_add_position_accounts.up..sql", size: 2053, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xf3, 0x47, 0x9f, 0xb4, 0xe3, 0xc, 0x35, 0x15, 0x74, 0xc3, 0x72, 0x57, 0x9f, 0x3b, 0xc9, 0xd5, 0x9b, 0x31, 0xef, 0xd6, 0x21, 0xc4, 0x27, 0x8e, 0x37, 0xd5, 0x5, 0xdb, 0x3d, 0xcf, 0x37, 0xbb}} return a, nil } @@ -1620,7 +1622,7 @@ func _1687269871_add_device_nameUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1687269871_add_device_name.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)} + info := bindataFileInfo{name: "1687269871_add_device_name.up.sql", size: 108, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xed, 0x61, 0xf2, 0xf9, 0x78, 0x57, 0xc3, 0x57, 0xdb, 0x37, 0xe, 0x7, 0x15, 0xde, 0x5a, 0x2a, 0xb5, 0x86, 0xb8, 0x5, 0x48, 0x68, 0x2a, 0xb, 0x7c, 0xd, 0x60, 0xba, 0x67, 0x30, 0x2d, 0xa3}} return a, nil } @@ -1640,7 +1642,7 @@ func _1687506642_include_watch_only_account_settingUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1687506642_include_watch_only_account_setting.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1687962760, 0)} + info := bindataFileInfo{name: "1687506642_include_watch_only_account_setting.up.sql", size: 81, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xaa, 0xa0, 0x61, 0xf8, 0xb9, 0x15, 0x22, 0x9a, 0xca, 0x9b, 0x89, 0x96, 0x90, 0x47, 0x56, 0xf3, 0x21, 0xf6, 0xbd, 0xd1, 0xa1, 0x8f, 0xa8, 0x34, 0xc3, 0x54, 0x86, 0x69, 0x14, 0x96, 0xdb, 0xbb}} return a, nil } @@ -1660,7 +1662,7 @@ func _1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql() (* return nil, err } - info := bindataFileInfo{name: "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1688054623, 0)} + info := bindataFileInfo{name: "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql", size: 98, mode: os.FileMode(0644), modTime: time.Unix(1689055096, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xab, 0xa2, 0x31, 0xcc, 0x3d, 0x59, 0x1b, 0x26, 0x5b, 0x78, 0xd, 0x6a, 0x75, 0x2a, 0xe0, 0x2, 0x21, 0x28, 0x8c, 0x92, 0x24, 0x98, 0x86, 0xdd, 0x2, 0x53, 0xe8, 0xf6, 0xc2, 0x7d, 0x57, 0x13}} return a, nil } @@ -1680,11 +1682,31 @@ func _1688054680_add_columns_to_multitransactionUpSql() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "1688054680_add_columns_to_multitransaction.up.sql", size: 342, mode: os.FileMode(0644), modTime: time.Unix(1688054624, 0)} + info := bindataFileInfo{name: "1688054680_add_columns_to_multitransaction.up.sql", size: 342, mode: os.FileMode(0644), modTime: time.Unix(1689055194, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xb5, 0xbb, 0x88, 0xde, 0x98, 0x9e, 0xa8, 0xc0, 0xf7, 0x2b, 0xc4, 0x33, 0x77, 0xf5, 0x58, 0x46, 0x52, 0xc6, 0xc2, 0x27, 0x1d, 0x8, 0xc9, 0x83, 0xb6, 0x16, 0x31, 0x99, 0x15, 0xcb, 0xb1, 0x40}} return a, nil } +var __1688636552_keycards_table_columns_updateUpSql = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x8c\x93\x4f\x0f\x9b\x30\x0c\xc5\xef\xf9\x14\xef\xd8\x4a\x4c\xda\xce\xd5\x0e\x29\x98\x0d\x2d\x4d\xaa\x90\x4e\xeb\x09\x21\xc2\x01\xb5\x2b\x15\x50\x4d\xfb\xf6\x13\xff\xff\x14\xb6\x1d\xc1\x3f\x3b\xcf\xcf\x36\x17\x86\x34\x0c\x3f\x0a\xc2\x2d\xfd\x9d\xc4\x85\x2d\xa1\x49\xf2\x13\xc1\xa8\xe1\x57\x94\xdf\xed\x81\xad\xc1\x51\x9c\x24\xf9\xeb\x51\xad\x66\xf5\xb1\x36\x9d\xb9\x9a\xb8\xa1\xae\x40\xe0\x43\x2a\x03\xfa\x11\x84\x26\x1c\xdf\xde\x31\x00\xfd\x67\xf4\xca\x2c\xbe\x73\xed\x7e\xe5\xba\xa1\xe5\x45\x08\x9c\x75\x70\xe2\xfa\x8a\x6f\x74\x75\x66\xf4\x23\xfe\x99\xbe\xe1\x73\xe4\x9e\x27\xb7\xd4\xe2\xa8\x94\x20\x2e\xe1\x91\xcf\x2f\xc2\xc0\xe7\x22\xa4\x81\x5c\x7d\xb6\x8d\x3e\xf3\x32\xab\xb2\xfc\x81\x40\x9a\x51\x51\x5f\xe6\x63\x0b\xf9\x4a\x53\xf0\x45\xd6\x02\x77\x5d\xb9\x3d\x34\xf9\xa4\x49\xba\xd4\x34\xfb\x8c\xb3\xa2\x1c\x82\x4d\x16\xa0\x6a\x41\x82\x0c\xc1\xe5\xa1\xcb\x3d\x62\xfb\xff\x73\x6d\x1c\xc2\xbf\xed\x6b\x25\x76\x09\x51\x6c\x6d\x91\x96\xe5\x06\x35\x71\x1a\xbb\x49\x51\x67\x99\xbf\x5f\x6d\xbc\xc7\x97\xcd\x37\x9a\x67\xc0\x68\xc0\xe5\xec\xf1\x89\x01\x7f\x33\x26\x90\x21\x69\x53\x4f\x62\x5c\x39\x06\x84\x24\xc8\x35\x98\xc9\x9d\x6e\x88\xb3\x58\x06\xa7\x1f\xb9\x83\x7b\x5c\x56\xd1\xeb\x69\xe3\x2a\x8d\x92\x3a\xca\x00\x5f\xab\xd3\xec\x0e\x18\xa0\xb4\x47\x1a\xc7\xeb\x7b\xc2\x86\xac\x61\x40\x1b\xfa\x16\x76\xbe\x3d\xbb\x38\xa4\xce\xa4\xe1\x68\x42\x32\xe3\x66\x7e\x46\x91\xff\xca\x2c\x3e\xe0\xd3\x81\x31\x4f\xab\xf3\xd6\xc9\xb6\xd5\xd6\x88\x3a\xf0\x27\x00\x00\xff\xff\x9d\x4a\x6f\x9a\x1b\x04\x00\x00") + +func _1688636552_keycards_table_columns_updateUpSqlBytes() ([]byte, error) { + return bindataRead( + __1688636552_keycards_table_columns_updateUpSql, + "1688636552_keycards_table_columns_update.up.sql", + ) +} + +func _1688636552_keycards_table_columns_updateUpSql() (*asset, error) { + bytes, err := _1688636552_keycards_table_columns_updateUpSqlBytes() + if err != nil { + return nil, err + } + + info := bindataFileInfo{name: "1688636552_keycards_table_columns_update.up.sql", size: 1051, mode: os.FileMode(0644), modTime: time.Unix(1689055194, 0)} + a := &asset{bytes: bytes, info: info, digest: [32]uint8{0x2f, 0x82, 0x37, 0x82, 0xae, 0x44, 0x7f, 0x4d, 0xb5, 0x50, 0x1b, 0x5f, 0x2b, 0xaa, 0xb1, 0x3, 0x97, 0xba, 0x8b, 0xea, 0x30, 0x5, 0xa4, 0x1a, 0x2c, 0x7, 0x63, 0x89, 0x43, 0x12, 0xb6, 0xb7}} + return a, nil +} + var _docGo = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x2c\xc9\xb1\x0d\xc4\x20\x0c\x05\xd0\x9e\x29\xfe\x02\xd8\xfd\x6d\xe3\x4b\xac\x2f\x44\x82\x09\x78\x7f\xa5\x49\xfd\xa6\x1d\xdd\xe8\xd8\xcf\x55\x8a\x2a\xe3\x47\x1f\xbe\x2c\x1d\x8c\xfa\x6f\xe3\xb4\x34\xd4\xd9\x89\xbb\x71\x59\xb6\x18\x1b\x35\x20\xa2\x9f\x0a\x03\xa2\xe5\x0d\x00\x00\xff\xff\x60\xcd\x06\xbe\x4a\x00\x00\x00") func docGoBytes() ([]byte, error) { @@ -1700,7 +1722,7 @@ func docGo() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687956345, 0)} + info := bindataFileInfo{name: "doc.go", size: 74, mode: os.FileMode(0644), modTime: time.Unix(1687723683, 0)} a := &asset{bytes: bytes, info: info, digest: [32]uint8{0xde, 0x7c, 0x28, 0xcd, 0x47, 0xf2, 0xfa, 0x7c, 0x51, 0x2d, 0xd8, 0x38, 0xb, 0xb0, 0x34, 0x9d, 0x4c, 0x62, 0xa, 0x9e, 0x28, 0xc3, 0x31, 0x23, 0xd9, 0xbb, 0x89, 0x9f, 0xa0, 0x89, 0x1f, 0xe8}} return a, nil } @@ -1796,100 +1818,174 @@ func AssetNames() []string { // _bindata is a table, holding each asset generator, mapped to its name. var _bindata = map[string]func() (*asset, error){ - "1640111208_dummy.up.sql": _1640111208_dummyUpSql, - "1642666031_add_removed_clock_to_bookmarks.up.sql": _1642666031_add_removed_clock_to_bookmarksUpSql, - "1643644541_gif_api_key_setting.up.sql": _1643644541_gif_api_key_settingUpSql, - "1644188994_recent_stickers.up.sql": _1644188994_recent_stickersUpSql, - "1646659233_add_address_to_dapp_permisssion.up.sql": _1646659233_add_address_to_dapp_permisssionUpSql, - "1646841105_add_emoji_account.up.sql": _1646841105_add_emoji_accountUpSql, - "1647278782_display_name.up.sql": _1647278782_display_nameUpSql, - "1647862838_reset_last_backup.up.sql": _1647862838_reset_last_backupUpSql, - "1647871652_add_settings_sync_clock_table.up.sql": _1647871652_add_settings_sync_clock_tableUpSql, - "1647880168_add_torrent_config.up.sql": _1647880168_add_torrent_configUpSql, - "1647882837_add_communities_settings_table.up.sql": _1647882837_add_communities_settings_tableUpSql, - "1647956635_add_waku_messages_table.up.sql": _1647956635_add_waku_messages_tableUpSql, - "1648554928_network_test.up.sql": _1648554928_network_testUpSql, - "1649174829_add_visitble_token.up.sql": _1649174829_add_visitble_tokenUpSql, - "1649882262_add_derived_from_accounts.up.sql": _1649882262_add_derived_from_accountsUpSql, - "1650612625_add_community_message_archive_hashes_table.up.sql": _1650612625_add_community_message_archive_hashes_tableUpSql, - "1650616788_add_communities_archives_info_table.up.sql": _1650616788_add_communities_archives_info_tableUpSql, - "1652715604_add_clock_accounts.up.sql": _1652715604_add_clock_accountsUpSql, - "1653037334_add_notifications_settings_table.up.sql": _1653037334_add_notifications_settings_tableUpSql, - "1654702119_add_mutual_contact_settings.up.sql": _1654702119_add_mutual_contact_settingsUpSql, - "1655375270_add_clock_field_to_communities_settings_table.up.sql": _1655375270_add_clock_field_to_communities_settings_tableUpSql, - "1655385721_drop_networks_config.up.sql": _1655385721_drop_networks_configUpSql, - "1655385724_networks_chainColor_shortName.up.sql": _1655385724_networks_chaincolor_shortnameUpSql, - "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql": _1655456688_add_deleted_at_field_to_bookmarks_tableUpSql, - "1655462032_create_bookmarks_deleted_at_index.up.sql": _1655462032_create_bookmarks_deleted_at_indexUpSql, - "1657617291_add_multi_transactions_table.up.sql": _1657617291_add_multi_transactions_tableUpSql, - "1660134042_add_social_links_settings_table.up.sql": _1660134042_add_social_links_settings_tableUpSql, - "1660134060_settings_bio.up.sql": _1660134060_settings_bioUpSql, - "1660134070_add_wakuv2_store.up.sql": _1660134070_add_wakuv2_storeUpSql, - "1660134072_waku2_store_messages.up.sql": _1660134072_waku2_store_messagesUpSql, - "1662365868_add_key_uid_accounts.up.sql": _1662365868_add_key_uid_accountsUpSql, - "1662447680_add_keypairs_table.up.sql": _1662447680_add_keypairs_tableUpSql, - "1662460056_move_favourites_to_saved_addresses.up.sql": _1662460056_move_favourites_to_saved_addressesUpSql, - "1662738097_add_base_fee_transaction.up.sql": _1662738097_add_base_fee_transactionUpSql, - "1662972194_add_keypairs_table.up.sql": _1662972194_add_keypairs_tableUpSql, - "1664392661_add_third_party_id_to_waku_messages.up.sql": _1664392661_add_third_party_id_to_waku_messagesUpSql, - "1664783660_add_sync_info_to_saved_addresses.up.sql": _1664783660_add_sync_info_to_saved_addressesUpSql, - "1668109917_wakunodes.up.sql": _1668109917_wakunodesUpSql, - "1670249678_display_name_to_settings_sync_clock_table.up.sql": _1670249678_display_name_to_settings_sync_clock_tableUpSql, - "1670836810_add_imported_flag_to_community_archive_hashes.up.sql": _1670836810_add_imported_flag_to_community_archive_hashesUpSql, - "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql": _1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql, - "1672933930_switcher_card.up.sql": _1672933930_switcher_cardUpSql, - "1674056187_add_price_cache.up.sql": _1674056187_add_price_cacheUpSql, - "1674136690_ens_usernames.up.sql": _1674136690_ens_usernamesUpSql, - "1674232431_add_balance_history.up.sql": _1674232431_add_balance_historyUpSql, - "1676368933_keypairs_to_keycards.up.sql": _1676368933_keypairs_to_keycardsUpSql, - "1676951398_add_currency_format_cache.up.sql": _1676951398_add_currency_format_cacheUpSql, - "1676968196_keycards_add_clock_column.up.sql": _1676968196_keycards_add_clock_columnUpSql, - "1676968197_add_fallback_rpc_to_networks.up.sql": _1676968197_add_fallback_rpc_to_networksUpSql, - "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql": _1677674090_add_chains_ens_istest_to_saved_addressesUpSql, - "1677681143_accounts_table_type_column_update.up.sql": _1677681143_accounts_table_type_column_updateUpSql, - "1678264207_accounts_table_new_columns_added.up.sql": _1678264207_accounts_table_new_columns_addedUpSql, - "1680770368_add_bio_to_settings_sync_clock_table.up.sql": _1680770368_add_bio_to_settings_sync_clock_tableUpSql, - "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql": _1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql, - "1681392602_9d_sync_period.up.sql": _1681392602_9d_sync_periodUpSql, - "1681762078_default_sync_period_9d.up.sql": _1681762078_default_sync_period_9dUpSql, - "1681780680_add_clock_to_social_links_settings.up.sql": _1681780680_add_clock_to_social_links_settingsUpSql, - "1682073779_settings_table_remove_latest_derived_path_column.up.sql": _1682073779_settings_table_remove_latest_derived_path_columnUpSql, - "1682146075_add_created_at_to_saved_addresses.up.sql": _1682146075_add_created_at_to_saved_addressesUpSql, - "1682393575_sync_ens_name.up.sql": _1682393575_sync_ens_nameUpSql, - "1683457503_add_blocks_ranges_sequential_table.up.sql": _1683457503_add_blocks_ranges_sequential_tableUpSql, - "1683627613_accounts_and_keycards_improvements.up.sql": _1683627613_accounts_and_keycards_improvementsUpSql, - "1685041348_settings_table_add_latest_derived_path_column.up.sql": _1685041348_settings_table_add_latest_derived_path_columnUpSql, - "1685440989_update_color_id_accounts.up.sql": _1685440989_update_color_id_accountsUpSql, - "1685463947_add_to_asset_to_multitransaction.up.sql": _1685463947_add_to_asset_to_multitransactionUpSql, - "1685880973_add_profile_links_settings_table.up.sql": _1685880973_add_profile_links_settings_tableUpSql, - "1686041510_add_idx_transfers_blkno_loaded.up.sql": _1686041510_add_idx_transfers_blkno_loadedUpSql, - "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql": _1686048341_transfers_receipt_json_blob_outUpSqlDownSql, - "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql": _1686048341_transfers_receipt_json_blob_outUpSqlUpSql, - "1686825075_cleanup_token_address.up.sql": _1686825075_cleanup_token_addressUpSql, - "1687193315_transfers_extract_from_to_address.down.sql": _1687193315_transfers_extract_from_to_addressDownSql, - "1687193315_transfers_extract_from_to_address.up.sql": _1687193315_transfers_extract_from_to_addressUpSql, - "1687249080_add_position_accounts.up..sql": _1687249080_add_position_accountsUpSql, - "1687269871_add_device_name.up.sql": _1687269871_add_device_nameUpSql, - "1687506642_include_watch_only_account_setting.up.sql": _1687506642_include_watch_only_account_settingUpSql, + "1640111208_dummy.up.sql": _1640111208_dummyUpSql, + + "1642666031_add_removed_clock_to_bookmarks.up.sql": _1642666031_add_removed_clock_to_bookmarksUpSql, + + "1643644541_gif_api_key_setting.up.sql": _1643644541_gif_api_key_settingUpSql, + + "1644188994_recent_stickers.up.sql": _1644188994_recent_stickersUpSql, + + "1646659233_add_address_to_dapp_permisssion.up.sql": _1646659233_add_address_to_dapp_permisssionUpSql, + + "1646841105_add_emoji_account.up.sql": _1646841105_add_emoji_accountUpSql, + + "1647278782_display_name.up.sql": _1647278782_display_nameUpSql, + + "1647862838_reset_last_backup.up.sql": _1647862838_reset_last_backupUpSql, + + "1647871652_add_settings_sync_clock_table.up.sql": _1647871652_add_settings_sync_clock_tableUpSql, + + "1647880168_add_torrent_config.up.sql": _1647880168_add_torrent_configUpSql, + + "1647882837_add_communities_settings_table.up.sql": _1647882837_add_communities_settings_tableUpSql, + + "1647956635_add_waku_messages_table.up.sql": _1647956635_add_waku_messages_tableUpSql, + + "1648554928_network_test.up.sql": _1648554928_network_testUpSql, + + "1649174829_add_visitble_token.up.sql": _1649174829_add_visitble_tokenUpSql, + + "1649882262_add_derived_from_accounts.up.sql": _1649882262_add_derived_from_accountsUpSql, + + "1650612625_add_community_message_archive_hashes_table.up.sql": _1650612625_add_community_message_archive_hashes_tableUpSql, + + "1650616788_add_communities_archives_info_table.up.sql": _1650616788_add_communities_archives_info_tableUpSql, + + "1652715604_add_clock_accounts.up.sql": _1652715604_add_clock_accountsUpSql, + + "1653037334_add_notifications_settings_table.up.sql": _1653037334_add_notifications_settings_tableUpSql, + + "1654702119_add_mutual_contact_settings.up.sql": _1654702119_add_mutual_contact_settingsUpSql, + + "1655375270_add_clock_field_to_communities_settings_table.up.sql": _1655375270_add_clock_field_to_communities_settings_tableUpSql, + + "1655385721_drop_networks_config.up.sql": _1655385721_drop_networks_configUpSql, + + "1655385724_networks_chainColor_shortName.up.sql": _1655385724_networks_chaincolor_shortnameUpSql, + + "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql": _1655456688_add_deleted_at_field_to_bookmarks_tableUpSql, + + "1655462032_create_bookmarks_deleted_at_index.up.sql": _1655462032_create_bookmarks_deleted_at_indexUpSql, + + "1657617291_add_multi_transactions_table.up.sql": _1657617291_add_multi_transactions_tableUpSql, + + "1660134042_add_social_links_settings_table.up.sql": _1660134042_add_social_links_settings_tableUpSql, + + "1660134060_settings_bio.up.sql": _1660134060_settings_bioUpSql, + + "1660134070_add_wakuv2_store.up.sql": _1660134070_add_wakuv2_storeUpSql, + + "1660134072_waku2_store_messages.up.sql": _1660134072_waku2_store_messagesUpSql, + + "1662365868_add_key_uid_accounts.up.sql": _1662365868_add_key_uid_accountsUpSql, + + "1662447680_add_keypairs_table.up.sql": _1662447680_add_keypairs_tableUpSql, + + "1662460056_move_favourites_to_saved_addresses.up.sql": _1662460056_move_favourites_to_saved_addressesUpSql, + + "1662738097_add_base_fee_transaction.up.sql": _1662738097_add_base_fee_transactionUpSql, + + "1662972194_add_keypairs_table.up.sql": _1662972194_add_keypairs_tableUpSql, + + "1664392661_add_third_party_id_to_waku_messages.up.sql": _1664392661_add_third_party_id_to_waku_messagesUpSql, + + "1664783660_add_sync_info_to_saved_addresses.up.sql": _1664783660_add_sync_info_to_saved_addressesUpSql, + + "1668109917_wakunodes.up.sql": _1668109917_wakunodesUpSql, + + "1670249678_display_name_to_settings_sync_clock_table.up.sql": _1670249678_display_name_to_settings_sync_clock_tableUpSql, + + "1670836810_add_imported_flag_to_community_archive_hashes.up.sql": _1670836810_add_imported_flag_to_community_archive_hashesUpSql, + + "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql": _1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql, + + "1672933930_switcher_card.up.sql": _1672933930_switcher_cardUpSql, + + "1674056187_add_price_cache.up.sql": _1674056187_add_price_cacheUpSql, + + "1674136690_ens_usernames.up.sql": _1674136690_ens_usernamesUpSql, + + "1674232431_add_balance_history.up.sql": _1674232431_add_balance_historyUpSql, + + "1676368933_keypairs_to_keycards.up.sql": _1676368933_keypairs_to_keycardsUpSql, + + "1676951398_add_currency_format_cache.up.sql": _1676951398_add_currency_format_cacheUpSql, + + "1676968196_keycards_add_clock_column.up.sql": _1676968196_keycards_add_clock_columnUpSql, + + "1676968197_add_fallback_rpc_to_networks.up.sql": _1676968197_add_fallback_rpc_to_networksUpSql, + + "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql": _1677674090_add_chains_ens_istest_to_saved_addressesUpSql, + + "1677681143_accounts_table_type_column_update.up.sql": _1677681143_accounts_table_type_column_updateUpSql, + + "1678264207_accounts_table_new_columns_added.up.sql": _1678264207_accounts_table_new_columns_addedUpSql, + + "1680770368_add_bio_to_settings_sync_clock_table.up.sql": _1680770368_add_bio_to_settings_sync_clock_tableUpSql, + + "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql": _1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql, + + "1681392602_9d_sync_period.up.sql": _1681392602_9d_sync_periodUpSql, + + "1681762078_default_sync_period_9d.up.sql": _1681762078_default_sync_period_9dUpSql, + + "1681780680_add_clock_to_social_links_settings.up.sql": _1681780680_add_clock_to_social_links_settingsUpSql, + + "1682073779_settings_table_remove_latest_derived_path_column.up.sql": _1682073779_settings_table_remove_latest_derived_path_columnUpSql, + + "1682146075_add_created_at_to_saved_addresses.up.sql": _1682146075_add_created_at_to_saved_addressesUpSql, + + "1682393575_sync_ens_name.up.sql": _1682393575_sync_ens_nameUpSql, + + "1683457503_add_blocks_ranges_sequential_table.up.sql": _1683457503_add_blocks_ranges_sequential_tableUpSql, + + "1683627613_accounts_and_keycards_improvements.up.sql": _1683627613_accounts_and_keycards_improvementsUpSql, + + "1685041348_settings_table_add_latest_derived_path_column.up.sql": _1685041348_settings_table_add_latest_derived_path_columnUpSql, + + "1685440989_update_color_id_accounts.up.sql": _1685440989_update_color_id_accountsUpSql, + + "1685463947_add_to_asset_to_multitransaction.up.sql": _1685463947_add_to_asset_to_multitransactionUpSql, + + "1685880973_add_profile_links_settings_table.up.sql": _1685880973_add_profile_links_settings_tableUpSql, + + "1686041510_add_idx_transfers_blkno_loaded.up.sql": _1686041510_add_idx_transfers_blkno_loadedUpSql, + + "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql": _1686048341_transfers_receipt_json_blob_outUpSqlDownSql, + + "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql": _1686048341_transfers_receipt_json_blob_outUpSqlUpSql, + + "1686825075_cleanup_token_address.up.sql": _1686825075_cleanup_token_addressUpSql, + + "1687193315_transfers_extract_from_to_address.down.sql": _1687193315_transfers_extract_from_to_addressDownSql, + + "1687193315_transfers_extract_from_to_address.up.sql": _1687193315_transfers_extract_from_to_addressUpSql, + + "1687249080_add_position_accounts.up..sql": _1687249080_add_position_accountsUpSql, + + "1687269871_add_device_name.up.sql": _1687269871_add_device_nameUpSql, + + "1687506642_include_watch_only_account_setting.up.sql": _1687506642_include_watch_only_account_settingUpSql, + "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql": _1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql, - "1688054680_add_columns_to_multitransaction.up.sql": _1688054680_add_columns_to_multitransactionUpSql, + + "1688054680_add_columns_to_multitransaction.up.sql": _1688054680_add_columns_to_multitransactionUpSql, + + "1688636552_keycards_table_columns_update.up.sql": _1688636552_keycards_table_columns_updateUpSql, + "doc.go": docGo, } -// AssetDebug is true if the assets were built with the debug flag enabled. -const AssetDebug = false - // AssetDir returns the file names below a certain // directory embedded in the file by go-bindata. // For example if you run go-bindata on data/... and data contains the // following hierarchy: -// -// data/ -// foo.txt -// img/ -// a.png -// b.png -// +// data/ +// foo.txt +// img/ +// a.png +// b.png // then AssetDir("data") would return []string{"foo.txt", "img"}, // AssetDir("data/img") would return []string{"a.png", "b.png"}, // AssetDir("foo.txt") and AssetDir("notexist") would return an error, and @@ -1922,84 +2018,85 @@ type bintree struct { } var _bintree = &bintree{nil, map[string]*bintree{ - "1640111208_dummy.up.sql": {_1640111208_dummyUpSql, map[string]*bintree{}}, - "1642666031_add_removed_clock_to_bookmarks.up.sql": {_1642666031_add_removed_clock_to_bookmarksUpSql, map[string]*bintree{}}, - "1643644541_gif_api_key_setting.up.sql": {_1643644541_gif_api_key_settingUpSql, map[string]*bintree{}}, - "1644188994_recent_stickers.up.sql": {_1644188994_recent_stickersUpSql, map[string]*bintree{}}, - "1646659233_add_address_to_dapp_permisssion.up.sql": {_1646659233_add_address_to_dapp_permisssionUpSql, map[string]*bintree{}}, - "1646841105_add_emoji_account.up.sql": {_1646841105_add_emoji_accountUpSql, map[string]*bintree{}}, - "1647278782_display_name.up.sql": {_1647278782_display_nameUpSql, map[string]*bintree{}}, - "1647862838_reset_last_backup.up.sql": {_1647862838_reset_last_backupUpSql, map[string]*bintree{}}, - "1647871652_add_settings_sync_clock_table.up.sql": {_1647871652_add_settings_sync_clock_tableUpSql, map[string]*bintree{}}, - "1647880168_add_torrent_config.up.sql": {_1647880168_add_torrent_configUpSql, map[string]*bintree{}}, - "1647882837_add_communities_settings_table.up.sql": {_1647882837_add_communities_settings_tableUpSql, map[string]*bintree{}}, - "1647956635_add_waku_messages_table.up.sql": {_1647956635_add_waku_messages_tableUpSql, map[string]*bintree{}}, - "1648554928_network_test.up.sql": {_1648554928_network_testUpSql, map[string]*bintree{}}, - "1649174829_add_visitble_token.up.sql": {_1649174829_add_visitble_tokenUpSql, map[string]*bintree{}}, - "1649882262_add_derived_from_accounts.up.sql": {_1649882262_add_derived_from_accountsUpSql, map[string]*bintree{}}, - "1650612625_add_community_message_archive_hashes_table.up.sql": {_1650612625_add_community_message_archive_hashes_tableUpSql, map[string]*bintree{}}, - "1650616788_add_communities_archives_info_table.up.sql": {_1650616788_add_communities_archives_info_tableUpSql, map[string]*bintree{}}, - "1652715604_add_clock_accounts.up.sql": {_1652715604_add_clock_accountsUpSql, map[string]*bintree{}}, - "1653037334_add_notifications_settings_table.up.sql": {_1653037334_add_notifications_settings_tableUpSql, map[string]*bintree{}}, - "1654702119_add_mutual_contact_settings.up.sql": {_1654702119_add_mutual_contact_settingsUpSql, map[string]*bintree{}}, - "1655375270_add_clock_field_to_communities_settings_table.up.sql": {_1655375270_add_clock_field_to_communities_settings_tableUpSql, map[string]*bintree{}}, - "1655385721_drop_networks_config.up.sql": {_1655385721_drop_networks_configUpSql, map[string]*bintree{}}, - "1655385724_networks_chainColor_shortName.up.sql": {_1655385724_networks_chaincolor_shortnameUpSql, map[string]*bintree{}}, - "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql": {_1655456688_add_deleted_at_field_to_bookmarks_tableUpSql, map[string]*bintree{}}, - "1655462032_create_bookmarks_deleted_at_index.up.sql": {_1655462032_create_bookmarks_deleted_at_indexUpSql, map[string]*bintree{}}, - "1657617291_add_multi_transactions_table.up.sql": {_1657617291_add_multi_transactions_tableUpSql, map[string]*bintree{}}, - "1660134042_add_social_links_settings_table.up.sql": {_1660134042_add_social_links_settings_tableUpSql, map[string]*bintree{}}, - "1660134060_settings_bio.up.sql": {_1660134060_settings_bioUpSql, map[string]*bintree{}}, - "1660134070_add_wakuv2_store.up.sql": {_1660134070_add_wakuv2_storeUpSql, map[string]*bintree{}}, - "1660134072_waku2_store_messages.up.sql": {_1660134072_waku2_store_messagesUpSql, map[string]*bintree{}}, - "1662365868_add_key_uid_accounts.up.sql": {_1662365868_add_key_uid_accountsUpSql, map[string]*bintree{}}, - "1662447680_add_keypairs_table.up.sql": {_1662447680_add_keypairs_tableUpSql, map[string]*bintree{}}, - "1662460056_move_favourites_to_saved_addresses.up.sql": {_1662460056_move_favourites_to_saved_addressesUpSql, map[string]*bintree{}}, - "1662738097_add_base_fee_transaction.up.sql": {_1662738097_add_base_fee_transactionUpSql, map[string]*bintree{}}, - "1662972194_add_keypairs_table.up.sql": {_1662972194_add_keypairs_tableUpSql, map[string]*bintree{}}, - "1664392661_add_third_party_id_to_waku_messages.up.sql": {_1664392661_add_third_party_id_to_waku_messagesUpSql, map[string]*bintree{}}, - "1664783660_add_sync_info_to_saved_addresses.up.sql": {_1664783660_add_sync_info_to_saved_addressesUpSql, map[string]*bintree{}}, - "1668109917_wakunodes.up.sql": {_1668109917_wakunodesUpSql, map[string]*bintree{}}, - "1670249678_display_name_to_settings_sync_clock_table.up.sql": {_1670249678_display_name_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, - "1670836810_add_imported_flag_to_community_archive_hashes.up.sql": {_1670836810_add_imported_flag_to_community_archive_hashesUpSql, map[string]*bintree{}}, - "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql": {_1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql, map[string]*bintree{}}, - "1672933930_switcher_card.up.sql": {_1672933930_switcher_cardUpSql, map[string]*bintree{}}, - "1674056187_add_price_cache.up.sql": {_1674056187_add_price_cacheUpSql, map[string]*bintree{}}, - "1674136690_ens_usernames.up.sql": {_1674136690_ens_usernamesUpSql, map[string]*bintree{}}, - "1674232431_add_balance_history.up.sql": {_1674232431_add_balance_historyUpSql, map[string]*bintree{}}, - "1676368933_keypairs_to_keycards.up.sql": {_1676368933_keypairs_to_keycardsUpSql, map[string]*bintree{}}, - "1676951398_add_currency_format_cache.up.sql": {_1676951398_add_currency_format_cacheUpSql, map[string]*bintree{}}, - "1676968196_keycards_add_clock_column.up.sql": {_1676968196_keycards_add_clock_columnUpSql, map[string]*bintree{}}, - "1676968197_add_fallback_rpc_to_networks.up.sql": {_1676968197_add_fallback_rpc_to_networksUpSql, map[string]*bintree{}}, - "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql": {_1677674090_add_chains_ens_istest_to_saved_addressesUpSql, map[string]*bintree{}}, - "1677681143_accounts_table_type_column_update.up.sql": {_1677681143_accounts_table_type_column_updateUpSql, map[string]*bintree{}}, - "1678264207_accounts_table_new_columns_added.up.sql": {_1678264207_accounts_table_new_columns_addedUpSql, map[string]*bintree{}}, - "1680770368_add_bio_to_settings_sync_clock_table.up.sql": {_1680770368_add_bio_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, - "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql": {_1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, - "1681392602_9d_sync_period.up.sql": {_1681392602_9d_sync_periodUpSql, map[string]*bintree{}}, - "1681762078_default_sync_period_9d.up.sql": {_1681762078_default_sync_period_9dUpSql, map[string]*bintree{}}, - "1681780680_add_clock_to_social_links_settings.up.sql": {_1681780680_add_clock_to_social_links_settingsUpSql, map[string]*bintree{}}, - "1682073779_settings_table_remove_latest_derived_path_column.up.sql": {_1682073779_settings_table_remove_latest_derived_path_columnUpSql, map[string]*bintree{}}, - "1682146075_add_created_at_to_saved_addresses.up.sql": {_1682146075_add_created_at_to_saved_addressesUpSql, map[string]*bintree{}}, - "1682393575_sync_ens_name.up.sql": {_1682393575_sync_ens_nameUpSql, map[string]*bintree{}}, - "1683457503_add_blocks_ranges_sequential_table.up.sql": {_1683457503_add_blocks_ranges_sequential_tableUpSql, map[string]*bintree{}}, - "1683627613_accounts_and_keycards_improvements.up.sql": {_1683627613_accounts_and_keycards_improvementsUpSql, map[string]*bintree{}}, - "1685041348_settings_table_add_latest_derived_path_column.up.sql": {_1685041348_settings_table_add_latest_derived_path_columnUpSql, map[string]*bintree{}}, - "1685440989_update_color_id_accounts.up.sql": {_1685440989_update_color_id_accountsUpSql, map[string]*bintree{}}, - "1685463947_add_to_asset_to_multitransaction.up.sql": {_1685463947_add_to_asset_to_multitransactionUpSql, map[string]*bintree{}}, - "1685880973_add_profile_links_settings_table.up.sql": {_1685880973_add_profile_links_settings_tableUpSql, map[string]*bintree{}}, - "1686041510_add_idx_transfers_blkno_loaded.up.sql": {_1686041510_add_idx_transfers_blkno_loadedUpSql, map[string]*bintree{}}, - "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql": {_1686048341_transfers_receipt_json_blob_outUpSqlDownSql, map[string]*bintree{}}, - "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql": {_1686048341_transfers_receipt_json_blob_outUpSqlUpSql, map[string]*bintree{}}, - "1686825075_cleanup_token_address.up.sql": {_1686825075_cleanup_token_addressUpSql, map[string]*bintree{}}, - "1687193315_transfers_extract_from_to_address.down.sql": {_1687193315_transfers_extract_from_to_addressDownSql, map[string]*bintree{}}, - "1687193315_transfers_extract_from_to_address.up.sql": {_1687193315_transfers_extract_from_to_addressUpSql, map[string]*bintree{}}, - "1687249080_add_position_accounts.up..sql": {_1687249080_add_position_accountsUpSql, map[string]*bintree{}}, - "1687269871_add_device_name.up.sql": {_1687269871_add_device_nameUpSql, map[string]*bintree{}}, - "1687506642_include_watch_only_account_setting.up.sql": {_1687506642_include_watch_only_account_settingUpSql, map[string]*bintree{}}, - "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql": {_1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql, map[string]*bintree{}}, - "1688054680_add_columns_to_multitransaction.up.sql": {_1688054680_add_columns_to_multitransactionUpSql, map[string]*bintree{}}, - "doc.go": {docGo, map[string]*bintree{}}, + "1640111208_dummy.up.sql": &bintree{_1640111208_dummyUpSql, map[string]*bintree{}}, + "1642666031_add_removed_clock_to_bookmarks.up.sql": &bintree{_1642666031_add_removed_clock_to_bookmarksUpSql, map[string]*bintree{}}, + "1643644541_gif_api_key_setting.up.sql": &bintree{_1643644541_gif_api_key_settingUpSql, map[string]*bintree{}}, + "1644188994_recent_stickers.up.sql": &bintree{_1644188994_recent_stickersUpSql, map[string]*bintree{}}, + "1646659233_add_address_to_dapp_permisssion.up.sql": &bintree{_1646659233_add_address_to_dapp_permisssionUpSql, map[string]*bintree{}}, + "1646841105_add_emoji_account.up.sql": &bintree{_1646841105_add_emoji_accountUpSql, map[string]*bintree{}}, + "1647278782_display_name.up.sql": &bintree{_1647278782_display_nameUpSql, map[string]*bintree{}}, + "1647862838_reset_last_backup.up.sql": &bintree{_1647862838_reset_last_backupUpSql, map[string]*bintree{}}, + "1647871652_add_settings_sync_clock_table.up.sql": &bintree{_1647871652_add_settings_sync_clock_tableUpSql, map[string]*bintree{}}, + "1647880168_add_torrent_config.up.sql": &bintree{_1647880168_add_torrent_configUpSql, map[string]*bintree{}}, + "1647882837_add_communities_settings_table.up.sql": &bintree{_1647882837_add_communities_settings_tableUpSql, map[string]*bintree{}}, + "1647956635_add_waku_messages_table.up.sql": &bintree{_1647956635_add_waku_messages_tableUpSql, map[string]*bintree{}}, + "1648554928_network_test.up.sql": &bintree{_1648554928_network_testUpSql, map[string]*bintree{}}, + "1649174829_add_visitble_token.up.sql": &bintree{_1649174829_add_visitble_tokenUpSql, map[string]*bintree{}}, + "1649882262_add_derived_from_accounts.up.sql": &bintree{_1649882262_add_derived_from_accountsUpSql, map[string]*bintree{}}, + "1650612625_add_community_message_archive_hashes_table.up.sql": &bintree{_1650612625_add_community_message_archive_hashes_tableUpSql, map[string]*bintree{}}, + "1650616788_add_communities_archives_info_table.up.sql": &bintree{_1650616788_add_communities_archives_info_tableUpSql, map[string]*bintree{}}, + "1652715604_add_clock_accounts.up.sql": &bintree{_1652715604_add_clock_accountsUpSql, map[string]*bintree{}}, + "1653037334_add_notifications_settings_table.up.sql": &bintree{_1653037334_add_notifications_settings_tableUpSql, map[string]*bintree{}}, + "1654702119_add_mutual_contact_settings.up.sql": &bintree{_1654702119_add_mutual_contact_settingsUpSql, map[string]*bintree{}}, + "1655375270_add_clock_field_to_communities_settings_table.up.sql": &bintree{_1655375270_add_clock_field_to_communities_settings_tableUpSql, map[string]*bintree{}}, + "1655385721_drop_networks_config.up.sql": &bintree{_1655385721_drop_networks_configUpSql, map[string]*bintree{}}, + "1655385724_networks_chainColor_shortName.up.sql": &bintree{_1655385724_networks_chaincolor_shortnameUpSql, map[string]*bintree{}}, + "1655456688_add_deleted_at_field_to_bookmarks_table.up.sql": &bintree{_1655456688_add_deleted_at_field_to_bookmarks_tableUpSql, map[string]*bintree{}}, + "1655462032_create_bookmarks_deleted_at_index.up.sql": &bintree{_1655462032_create_bookmarks_deleted_at_indexUpSql, map[string]*bintree{}}, + "1657617291_add_multi_transactions_table.up.sql": &bintree{_1657617291_add_multi_transactions_tableUpSql, map[string]*bintree{}}, + "1660134042_add_social_links_settings_table.up.sql": &bintree{_1660134042_add_social_links_settings_tableUpSql, map[string]*bintree{}}, + "1660134060_settings_bio.up.sql": &bintree{_1660134060_settings_bioUpSql, map[string]*bintree{}}, + "1660134070_add_wakuv2_store.up.sql": &bintree{_1660134070_add_wakuv2_storeUpSql, map[string]*bintree{}}, + "1660134072_waku2_store_messages.up.sql": &bintree{_1660134072_waku2_store_messagesUpSql, map[string]*bintree{}}, + "1662365868_add_key_uid_accounts.up.sql": &bintree{_1662365868_add_key_uid_accountsUpSql, map[string]*bintree{}}, + "1662447680_add_keypairs_table.up.sql": &bintree{_1662447680_add_keypairs_tableUpSql, map[string]*bintree{}}, + "1662460056_move_favourites_to_saved_addresses.up.sql": &bintree{_1662460056_move_favourites_to_saved_addressesUpSql, map[string]*bintree{}}, + "1662738097_add_base_fee_transaction.up.sql": &bintree{_1662738097_add_base_fee_transactionUpSql, map[string]*bintree{}}, + "1662972194_add_keypairs_table.up.sql": &bintree{_1662972194_add_keypairs_tableUpSql, map[string]*bintree{}}, + "1664392661_add_third_party_id_to_waku_messages.up.sql": &bintree{_1664392661_add_third_party_id_to_waku_messagesUpSql, map[string]*bintree{}}, + "1664783660_add_sync_info_to_saved_addresses.up.sql": &bintree{_1664783660_add_sync_info_to_saved_addressesUpSql, map[string]*bintree{}}, + "1668109917_wakunodes.up.sql": &bintree{_1668109917_wakunodesUpSql, map[string]*bintree{}}, + "1670249678_display_name_to_settings_sync_clock_table.up.sql": &bintree{_1670249678_display_name_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, + "1670836810_add_imported_flag_to_community_archive_hashes.up.sql": &bintree{_1670836810_add_imported_flag_to_community_archive_hashesUpSql, map[string]*bintree{}}, + "1671438731_add_magnetlink_uri_to_communities_archive_info.up.sql": &bintree{_1671438731_add_magnetlink_uri_to_communities_archive_infoUpSql, map[string]*bintree{}}, + "1672933930_switcher_card.up.sql": &bintree{_1672933930_switcher_cardUpSql, map[string]*bintree{}}, + "1674056187_add_price_cache.up.sql": &bintree{_1674056187_add_price_cacheUpSql, map[string]*bintree{}}, + "1674136690_ens_usernames.up.sql": &bintree{_1674136690_ens_usernamesUpSql, map[string]*bintree{}}, + "1674232431_add_balance_history.up.sql": &bintree{_1674232431_add_balance_historyUpSql, map[string]*bintree{}}, + "1676368933_keypairs_to_keycards.up.sql": &bintree{_1676368933_keypairs_to_keycardsUpSql, map[string]*bintree{}}, + "1676951398_add_currency_format_cache.up.sql": &bintree{_1676951398_add_currency_format_cacheUpSql, map[string]*bintree{}}, + "1676968196_keycards_add_clock_column.up.sql": &bintree{_1676968196_keycards_add_clock_columnUpSql, map[string]*bintree{}}, + "1676968197_add_fallback_rpc_to_networks.up.sql": &bintree{_1676968197_add_fallback_rpc_to_networksUpSql, map[string]*bintree{}}, + "1677674090_add_chains_ens_istest_to_saved_addresses.up.sql": &bintree{_1677674090_add_chains_ens_istest_to_saved_addressesUpSql, map[string]*bintree{}}, + "1677681143_accounts_table_type_column_update.up.sql": &bintree{_1677681143_accounts_table_type_column_updateUpSql, map[string]*bintree{}}, + "1678264207_accounts_table_new_columns_added.up.sql": &bintree{_1678264207_accounts_table_new_columns_addedUpSql, map[string]*bintree{}}, + "1680770368_add_bio_to_settings_sync_clock_table.up.sql": &bintree{_1680770368_add_bio_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, + "1681110436_add_mnemonic_to_settings_sync_clock_table.up.sql": &bintree{_1681110436_add_mnemonic_to_settings_sync_clock_tableUpSql, map[string]*bintree{}}, + "1681392602_9d_sync_period.up.sql": &bintree{_1681392602_9d_sync_periodUpSql, map[string]*bintree{}}, + "1681762078_default_sync_period_9d.up.sql": &bintree{_1681762078_default_sync_period_9dUpSql, map[string]*bintree{}}, + "1681780680_add_clock_to_social_links_settings.up.sql": &bintree{_1681780680_add_clock_to_social_links_settingsUpSql, map[string]*bintree{}}, + "1682073779_settings_table_remove_latest_derived_path_column.up.sql": &bintree{_1682073779_settings_table_remove_latest_derived_path_columnUpSql, map[string]*bintree{}}, + "1682146075_add_created_at_to_saved_addresses.up.sql": &bintree{_1682146075_add_created_at_to_saved_addressesUpSql, map[string]*bintree{}}, + "1682393575_sync_ens_name.up.sql": &bintree{_1682393575_sync_ens_nameUpSql, map[string]*bintree{}}, + "1683457503_add_blocks_ranges_sequential_table.up.sql": &bintree{_1683457503_add_blocks_ranges_sequential_tableUpSql, map[string]*bintree{}}, + "1683627613_accounts_and_keycards_improvements.up.sql": &bintree{_1683627613_accounts_and_keycards_improvementsUpSql, map[string]*bintree{}}, + "1685041348_settings_table_add_latest_derived_path_column.up.sql": &bintree{_1685041348_settings_table_add_latest_derived_path_columnUpSql, map[string]*bintree{}}, + "1685440989_update_color_id_accounts.up.sql": &bintree{_1685440989_update_color_id_accountsUpSql, map[string]*bintree{}}, + "1685463947_add_to_asset_to_multitransaction.up.sql": &bintree{_1685463947_add_to_asset_to_multitransactionUpSql, map[string]*bintree{}}, + "1685880973_add_profile_links_settings_table.up.sql": &bintree{_1685880973_add_profile_links_settings_tableUpSql, map[string]*bintree{}}, + "1686041510_add_idx_transfers_blkno_loaded.up.sql": &bintree{_1686041510_add_idx_transfers_blkno_loadedUpSql, map[string]*bintree{}}, + "1686048341_transfers_receipt_json_blob_out.up.sql.down.sql": &bintree{_1686048341_transfers_receipt_json_blob_outUpSqlDownSql, map[string]*bintree{}}, + "1686048341_transfers_receipt_json_blob_out.up.sql.up.sql": &bintree{_1686048341_transfers_receipt_json_blob_outUpSqlUpSql, map[string]*bintree{}}, + "1686825075_cleanup_token_address.up.sql": &bintree{_1686825075_cleanup_token_addressUpSql, map[string]*bintree{}}, + "1687193315_transfers_extract_from_to_address.down.sql": &bintree{_1687193315_transfers_extract_from_to_addressDownSql, map[string]*bintree{}}, + "1687193315_transfers_extract_from_to_address.up.sql": &bintree{_1687193315_transfers_extract_from_to_addressUpSql, map[string]*bintree{}}, + "1687249080_add_position_accounts.up..sql": &bintree{_1687249080_add_position_accountsUpSql, map[string]*bintree{}}, + "1687269871_add_device_name.up.sql": &bintree{_1687269871_add_device_nameUpSql, map[string]*bintree{}}, + "1687506642_include_watch_only_account_setting.up.sql": &bintree{_1687506642_include_watch_only_account_settingUpSql, map[string]*bintree{}}, + "1688022264_add_include_watch_only_account_to_settings_sync_clock.up.sql": &bintree{_1688022264_add_include_watch_only_account_to_settings_sync_clockUpSql, map[string]*bintree{}}, + "1688054680_add_columns_to_multitransaction.up.sql": &bintree{_1688054680_add_columns_to_multitransactionUpSql, map[string]*bintree{}}, + "1688636552_keycards_table_columns_update.up.sql": &bintree{_1688636552_keycards_table_columns_updateUpSql, map[string]*bintree{}}, + "doc.go": &bintree{docGo, map[string]*bintree{}}, }} // RestoreAsset restores an asset under the given directory. @@ -2016,7 +2113,7 @@ func RestoreAsset(dir, name string) error { if err != nil { return err } - err = os.WriteFile(_filePath(dir, name), data, info.Mode()) + err = ioutil.WriteFile(_filePath(dir, name), data, info.Mode()) if err != nil { return err } diff --git a/appdatabase/migrations/sql/1688636552_keycards_table_columns_update.up.sql b/appdatabase/migrations/sql/1688636552_keycards_table_columns_update.up.sql new file mode 100644 index 000000000..9257f84f8 --- /dev/null +++ b/appdatabase/migrations/sql/1688636552_keycards_table_columns_update.up.sql @@ -0,0 +1,35 @@ +ALTER TABLE keycards RENAME TO keycards_old; +ALTER TABLE keycards_accounts RENAME TO keycards_accounts_old; + +CREATE TABLE IF NOT EXISTS keycards ( + keycard_uid VARCHAR NOT NULL PRIMARY KEY, + keycard_name VARCHAR NOT NULL, + keycard_locked BOOLEAN DEFAULT FALSE, + key_uid VARCHAR NOT NULL, + position INT NOT NULL DEFAULT 0, + FOREIGN KEY(key_uid) REFERENCES keypairs(key_uid) + ON DELETE CASCADE +); + +CREATE TABLE IF NOT EXISTS keycards_accounts ( + keycard_uid VARCHAR NOT NULL, + account_address VARCHAR NOT NULL, + PRIMARY KEY (keycard_uid, account_address), + FOREIGN KEY(keycard_uid) REFERENCES keycards(keycard_uid) + ON UPDATE CASCADE + ON DELETE CASCADE +); + +INSERT INTO keycards + SELECT keycard_uid, keycard_name, keycard_locked, key_uid, last_update_clock + FROM keycards_old + ORDER BY last_update_clock; + +INSERT INTO keycards_accounts + SELECT keycard_uid, account_address + FROM keycards_accounts_old; + +UPDATE keycards SET position = rowid - 1; + +DROP TABLE keycards_accounts_old; +DROP TABLE keycards_old; \ No newline at end of file diff --git a/multiaccounts/accounts/database.go b/multiaccounts/accounts/database.go index 3a8f9bbfb..4f8ae8a03 100644 --- a/multiaccounts/accounts/database.go +++ b/multiaccounts/accounts/database.go @@ -220,7 +220,6 @@ func (a *Keypair) CopyKeypair() *Keypair { KeycardLocked: kc.KeycardLocked, AccountsAddresses: kc.AccountsAddresses, KeyUID: kc.KeyUID, - LastUpdateClock: kc.LastUpdateClock, } } @@ -242,7 +241,6 @@ type Database struct { *settings.Database *notificationssettings.NotificationsSettings *sociallinkssettings.SocialLinksSettings - *Keycards db *sql.DB } @@ -254,9 +252,8 @@ func NewDB(db *sql.DB) (*Database, error) { } sn := notificationssettings.NewNotificationsSettings(db) ssl := sociallinkssettings.NewSocialLinksSettings(db) - kc := NewKeycards(db) - return &Database{sDB, sn, ssl, kc, db}, nil + return &Database{sDB, sn, ssl, db}, nil } // DB Gets db sql.DB @@ -486,7 +483,7 @@ func (db *Database) getKeypairs(tx *sql.Tx, keyUID string) ([]*Keypair, error) { } for _, kp := range keypairs { - keycards, err := db.getAllRows(tx, true) + keycards, err := db.getKeycards(tx, kp.KeyUID, "") if err != nil { return nil, err } @@ -803,11 +800,6 @@ func (db *Database) saveOrUpdateAccounts(tx *sql.Tx, accounts []*Account, update } keyUID = &acc.KeyUID } - var exists bool - err = tx.QueryRow("SELECT EXISTS (SELECT 1 FROM keypairs_accounts WHERE address = ?)", acc.Address).Scan(&exists) - if err != nil { - return err - } _, err = tx.Exec(` INSERT OR IGNORE INTO @@ -882,6 +874,7 @@ func (db *Database) saveOrUpdateAccounts(tx *sql.Tx, accounts []*Account, update return nil } +// Saves accounts, if an account already exists, it will be updated. func (db *Database) SaveOrUpdateAccounts(accounts []*Account, updateKeypairClock bool) error { if len(accounts) == 0 { return errors.New("no provided accounts to save/update") @@ -902,6 +895,10 @@ func (db *Database) SaveOrUpdateAccounts(accounts []*Account, updateKeypairClock return err } +// Saves a keypair and its accounts, if a keypair with `key_uid` already exists, it will be updated, +// if any of its accounts exists it will be updated as well, otherwise it will be added. +// Since keypair type contains `Keycards` as well, they are excluded from the saving/updating this way regardless they +// are set or not. func (db *Database) SaveOrUpdateKeypair(keypair *Keypair) error { if keypair == nil { return errDbPassedParameterIsNil @@ -1063,6 +1060,23 @@ func (db *Database) GetAddresses() (rst []types.Address, err error) { return rst, nil } +func (db *Database) keypairExists(tx *sql.Tx, keyUID string) (exists bool, err error) { + query := `SELECT EXISTS (SELECT 1 FROM keypairs WHERE key_uid = ?)` + + if tx == nil { + err = db.db.QueryRow(query, keyUID).Scan(&exists) + } else { + err = tx.QueryRow(query, keyUID).Scan(&exists) + } + + return exists, err +} + +// KeypairExists returns true if given address is stored in database. +func (db *Database) KeypairExists(keyUID string) (exists bool, err error) { + return db.keypairExists(nil, keyUID) +} + // AddressExists returns true if given address is stored in database. func (db *Database) AddressExists(address types.Address) (exists bool, err error) { err = db.db.QueryRow("SELECT EXISTS (SELECT 1 FROM keypairs_accounts WHERE address = ?)", address).Scan(&exists) diff --git a/multiaccounts/accounts/keycard_database.go b/multiaccounts/accounts/keycard_database.go index fc1305ad3..f525396d4 100644 --- a/multiaccounts/accounts/keycard_database.go +++ b/multiaccounts/accounts/keycard_database.go @@ -10,7 +10,11 @@ import ( "github.com/status-im/status-go/protocol/protobuf" ) -var errKeycardDbTransactionIsNil = errors.New("keycard: database transaction is nil") +var ( + errKeycardDbTransactionIsNil = errors.New("keycard: database transaction is nil") + errCannotAddKeycardForUnknownKeypair = errors.New("keycard: cannot add keycard for an unknown keyapir") + ErrNoKeycardForPassedKeycardUID = errors.New("keycard: no keycard for the passed keycard uid") +) type Keycard struct { KeycardUID string `json:"keycard-uid"` @@ -18,22 +22,16 @@ type Keycard struct { KeycardLocked bool `json:"keycard-locked"` AccountsAddresses []types.Address `json:"accounts-addresses"` KeyUID string `json:"key-uid"` - LastUpdateClock uint64 -} - -type KeycardAction struct { - Action string `json:"action"` - OldKeycardUID string `json:"old-keycard-uid,omitempty"` - Keycard *Keycard `json:"keycard"` + Position uint64 } func (kp *Keycard) ToSyncKeycard() *protobuf.SyncKeycard { kc := &protobuf.SyncKeycard{ - Uid: kp.KeycardUID, - Name: kp.KeycardName, - Locked: kp.KeycardLocked, - KeyUid: kp.KeyUID, - Clock: kp.LastUpdateClock, + Uid: kp.KeycardUID, + Name: kp.KeycardName, + Locked: kp.KeycardLocked, + KeyUid: kp.KeyUID, + Position: kp.Position, } for _, addr := range kp.AccountsAddresses { @@ -48,30 +46,13 @@ func (kp *Keycard) FromSyncKeycard(kc *protobuf.SyncKeycard) { kp.KeycardName = kc.Name kp.KeycardLocked = kc.Locked kp.KeyUID = kc.KeyUid - kp.LastUpdateClock = kc.Clock + kp.Position = kc.Position for _, addr := range kc.Addresses { kp.AccountsAddresses = append(kp.AccountsAddresses, types.BytesToAddress(addr)) } } -func removeElementAtIndex[T any](s []T, index int) []T { - if index < 0 || index >= len(s) { - panic("keycard: index out of the range") - } - return append(s[:index], s[index+1:]...) -} - -type Keycards struct { - db *sql.DB -} - -func NewKeycards(db *sql.DB) *Keycards { - return &Keycards{ - db: db, - } -} - func containsAddress(addresses []types.Address, address types.Address) bool { for _, addr := range addresses { if addr == address { @@ -81,29 +62,27 @@ func containsAddress(addresses []types.Address, address types.Address) bool { return false } -func (kp *Keycards) processResult(rows *sql.Rows, groupByKeycard bool) ([]*Keycard, error) { +func (db *Database) processResult(rows *sql.Rows) ([]*Keycard, error) { keycards := []*Keycard{} for rows.Next() { keycard := &Keycard{} - addr := types.Address{} - err := rows.Scan(&keycard.KeycardUID, &keycard.KeycardName, &keycard.KeycardLocked, &addr, &keycard.KeyUID, - &keycard.LastUpdateClock) + var accAddress sql.NullString + err := rows.Scan(&keycard.KeycardUID, &keycard.KeycardName, &keycard.KeycardLocked, &accAddress, &keycard.KeyUID, + &keycard.Position) if err != nil { return nil, err } + addr := types.Address{} + if accAddress.Valid { + addr = types.BytesToAddress([]byte(accAddress.String)) + } + foundAtIndex := -1 for i := range keycards { - if groupByKeycard { - if keycards[i].KeycardUID == keycard.KeycardUID { - foundAtIndex = i - break - } - } else { - if keycards[i].KeyUID == keycard.KeyUID { - foundAtIndex = i - break - } + if keycards[i].KeycardUID == keycard.KeycardUID { + foundAtIndex = i + break } } if foundAtIndex == -1 { @@ -120,170 +99,113 @@ func (kp *Keycards) processResult(rows *sql.Rows, groupByKeycard bool) ([]*Keyca return keycards, nil } -func (kp *Keycards) getAllRows(tx *sql.Tx, groupByKeycard bool) ([]*Keycard, error) { +func (db *Database) getKeycards(tx *sql.Tx, keyUID string, keycardUID string) ([]*Keycard, error) { + query := ` + SELECT + kc.keycard_uid, + kc.keycard_name, + kc.keycard_locked, + ka.account_address, + kc.key_uid, + kc.position + FROM + keycards AS kc + LEFT JOIN + keycards_accounts AS ka + ON + kc.keycard_uid = ka.keycard_uid + LEFT JOIN + keypairs_accounts AS kpa + ON + ka.account_address = kpa.address + %s + ORDER BY + kc.position, kpa.position` + + var where string + var args []interface{} + + if keyUID != "" { + where = "WHERE kc.key_uid = ?" + args = append(args, keyUID) + if keycardUID != "" { + where += " AND kc.keycard_uid = ?" + args = append(args, keycardUID) + } + } else if keycardUID != "" { + where = "WHERE kc.keycard_uid = ?" + args = append(args, keycardUID) + } + + query = fmt.Sprintf(query, where) + var ( - rows *sql.Rows + stmt *sql.Stmt err error ) - query := // nolint: gosec - ` - SELECT - k.keycard_uid, - k.keycard_name, - k.keycard_locked, - ka.account_address, - k.key_uid, - k.last_update_clock - FROM - keycards AS k - LEFT JOIN - keycards_accounts AS ka - ON - k.keycard_uid = ka.keycard_uid - ORDER BY - key_uid` - if tx == nil { - rows, err = kp.db.Query(query) - if err != nil { - return nil, err - } + stmt, err = db.db.Prepare(query) } else { - stmt, err := tx.Prepare(query) - if err != nil { - return nil, err - } - defer stmt.Close() - - rows, err = stmt.Query() - if err != nil { - return nil, err - } + stmt, err = tx.Prepare(query) } - - defer rows.Close() - return kp.processResult(rows, groupByKeycard) -} - -func (kp *Keycards) GetAllKnownKeycards() ([]*Keycard, error) { - return kp.getAllRows(nil, true) -} - -func (kp *Keycards) GetAllKnownKeycardsGroupedByKeyUID() ([]*Keycard, error) { - return kp.getAllRows(nil, false) -} - -func (kp *Keycards) GetKeycardByKeyUID(keyUID string) ([]*Keycard, error) { - rows, err := kp.db.Query(` - SELECT - k.keycard_uid, - k.keycard_name, - k.keycard_locked, - ka.account_address, - k.key_uid, - k.last_update_clock - FROM - keycards AS k - LEFT JOIN - keycards_accounts AS ka - ON - k.keycard_uid = ka.keycard_uid - WHERE - k.key_uid = ? - ORDER BY - k.keycard_uid - `, keyUID) if err != nil { - if err == sql.ErrNoRows { - return []*Keycard{}, nil - } return nil, err } + defer stmt.Close() - defer rows.Close() - return kp.processResult(rows, false) -} - -func (kp *Keycards) startTransactionAndCheckIfNeedToProceed(kcUID string, clock uint64) (tx *sql.Tx, proceed bool, err error) { - tx, err = kp.db.Begin() - if err != nil { - return nil, false, err - } - var dbLastUpdateClock uint64 - err = tx.QueryRow(`SELECT last_update_clock FROM keycards WHERE keycard_uid = ?`, kcUID).Scan(&dbLastUpdateClock) - if err != nil { - return tx, err == sql.ErrNoRows, err - } - - return tx, dbLastUpdateClock <= clock, nil -} - -func (kp *Keycards) setLastUpdateClock(tx *sql.Tx, kcUID string, clock uint64) (err error) { - if tx == nil { - return errKeycardDbTransactionIsNil - } - - _, err = tx.Exec(` - UPDATE - keycards - SET - last_update_clock = ? - WHERE - keycard_uid = ?`, - clock, kcUID) - - return err -} - -func (kp *Keycards) getAccountsForKeycard(tx *sql.Tx, kcUID string) ([]types.Address, error) { - var accountAddresses []types.Address - if tx == nil { - return accountAddresses, errKeycardDbTransactionIsNil - } - - rows, err := tx.Query(`SELECT account_address FROM keycards_accounts WHERE keycard_uid = ?`, kcUID) + rows, err := stmt.Query(args...) if err != nil { return nil, err } defer rows.Close() - for rows.Next() { - var accAddress types.Address - err = rows.Scan(&accAddress) - if err != nil { - return nil, err - } - accountAddresses = append(accountAddresses, accAddress) - } - - return accountAddresses, nil + return db.processResult(rows) } -func (kp *Keycards) addAccounts(tx *sql.Tx, kcUID string, accountsAddresses []types.Address) (err error) { +func (db *Database) getKeycardByKeycardUID(tx *sql.Tx, keycardUID string) (*Keycard, error) { + keycards, err := db.getKeycards(tx, "", keycardUID) + if err != nil { + return nil, err + } + + if len(keycards) == 0 { + return nil, ErrNoKeycardForPassedKeycardUID + } + + return keycards[0], nil +} + +func (db *Database) GetAllKnownKeycards() ([]*Keycard, error) { + return db.getKeycards(nil, "", "") +} + +func (db *Database) GetKeycardsWithSameKeyUID(keyUID string) ([]*Keycard, error) { + return db.getKeycards(nil, keyUID, "") +} + +func (db *Database) GetKeycardByKeycardUID(keycardUID string) (*Keycard, error) { + return db.getKeycardByKeycardUID(nil, keycardUID) +} + +func (db *Database) saveOrUpdateKeycardAccounts(tx *sql.Tx, kcUID string, accountsAddresses []types.Address) (err error) { if tx == nil { return errKeycardDbTransactionIsNil } - insertKcAcc, err := tx.Prepare(` - INSERT INTO - keycards_accounts - ( - keycard_uid, - account_address - ) - VALUES - (?, ?); - `) - - if err != nil { - return err - } - defer insertKcAcc.Close() - for i := range accountsAddresses { addr := accountsAddresses[i] - _, err = insertKcAcc.Exec(kcUID, addr) + _, err = tx.Exec(` + INSERT OR IGNORE INTO + keycards_accounts + ( + keycard_uid, + account_address + ) + VALUES + (?, ?); + `, kcUID, addr) + if err != nil { return err } @@ -292,7 +214,7 @@ func (kp *Keycards) addAccounts(tx *sql.Tx, kcUID string, accountsAddresses []ty return nil } -func (kp *Keycards) deleteKeycard(tx *sql.Tx, kcUID string) (err error) { +func (db *Database) deleteKeycard(tx *sql.Tx, kcUID string) (err error) { if tx == nil { return errKeycardDbTransactionIsNil } @@ -314,145 +236,102 @@ func (kp *Keycards) deleteKeycard(tx *sql.Tx, kcUID string) (err error) { return err } -func (kp *Keycards) AddKeycardOrAddAccountsIfKeycardIsAdded(keycard Keycard) (addedKc bool, addedAccs bool, err error) { - tx, proceed, err := kp.startTransactionAndCheckIfNeedToProceed(keycard.KeycardUID, keycard.LastUpdateClock) - defer func() { - if err == nil { - err = tx.Commit() - return - } - _ = tx.Rollback() - }() - - if proceed { - // insert only if there is no such keycard, otherwise just add accounts - if err != nil && err == sql.ErrNoRows { - _, err = tx.Exec(` - INSERT INTO - keycards - ( - keycard_uid, - keycard_name, - keycard_locked, - key_uid, - last_update_clock - ) - VALUES - (?, ?, ?, ?, ?);`, - keycard.KeycardUID, keycard.KeycardName, keycard.KeycardLocked, keycard.KeyUID, keycard.LastUpdateClock) - - if err != nil { - return false, false, err - } - - err = kp.addAccounts(tx, keycard.KeycardUID, keycard.AccountsAddresses) - return err == nil, false, err - } - - err = kp.setLastUpdateClock(tx, keycard.KeycardUID, keycard.LastUpdateClock) - if err != nil { - return false, false, err - } - - err = kp.addAccounts(tx, keycard.KeycardUID, keycard.AccountsAddresses) - return false, err == nil, err +func (db *Database) deleteKeycardAccounts(tx *sql.Tx, kcUID string, accountAddresses []types.Address) (err error) { + if tx == nil { + return errKeycardDbTransactionIsNil } - return false, false, err -} + inVector := strings.Repeat(",?", len(accountAddresses)-1) + query := ` + DELETE + FROM + keycards_accounts + WHERE + keycard_uid = ? + AND + account_address IN (?` + inVector + `)` -func (kp *Keycards) ApplyKeycardsForKeypairWithKeyUID(keyUID string, keycardsToSync []*Keycard) (err error) { - tx, err := kp.db.Begin() + delete, err := tx.Prepare(query) if err != nil { - return - } - defer func() { - if err == nil { - err = tx.Commit() - return - } - _ = tx.Rollback() - }() - - rows, err := tx.Query(`SELECT * FROM keycards WHERE key_uid = ?`, keyUID) - if err != nil && err != sql.ErrNoRows { return err } - defer rows.Close() + defer delete.Close() - var dbKeycards []*Keycard - for rows.Next() { - keycard := &Keycard{} - err := rows.Scan(&keycard.KeycardUID, &keycard.KeycardName, &keycard.KeycardLocked, &keycard.KeyUID, - &keycard.LastUpdateClock) - if err != nil { - return err - } - - dbKeycards = append(dbKeycards, keycard) + args := make([]interface{}, len(accountAddresses)+1) + args[0] = kcUID + for i, addr := range accountAddresses { + args[i+1] = addr } - // apply those from `keycardsToSync` which are newer - for _, syncKc := range keycardsToSync { - foundAtIndex := -1 - for i := range dbKeycards { - if dbKeycards[i].KeycardUID == syncKc.KeycardUID { - foundAtIndex = i - break - } + _, err = delete.Exec(args...) + + return err +} + +func (db *Database) SaveOrUpdateKeycard(keycard Keycard, clock uint64, updateKeypairClock bool) error { + tx, err := db.db.Begin() + if err != nil { + return err + } + defer func() { + if err == nil { + err = tx.Commit() + return } + _ = tx.Rollback() + }() - if foundAtIndex > -1 { - dbClock := dbKeycards[foundAtIndex].LastUpdateClock - dbKeycards = removeElementAtIndex(dbKeycards, foundAtIndex) - - if dbClock > syncKc.LastUpdateClock { - continue - } - err = kp.deleteKeycard(tx, syncKc.KeycardUID) - if err != nil { - return err - } - } - - _, err = tx.Exec(` - INSERT OR REPLACE INTO - keycards - ( - keycard_uid, - keycard_name, - keycard_locked, - key_uid, - last_update_clock - ) - VALUES - (?, ?, ?, ?, ?);`, - syncKc.KeycardUID, syncKc.KeycardName, syncKc.KeycardLocked, syncKc.KeyUID, syncKc.LastUpdateClock) - - if err != nil { - return err - } - - err = kp.addAccounts(tx, syncKc.KeycardUID, syncKc.AccountsAddresses) - if err != nil { - return err - } + relatedKeypairExists, err := db.keypairExists(tx, keycard.KeyUID) + if err != nil { + return err } - // remove those from the db if they are not in `keycardsToSync` - for _, dbKp := range dbKeycards { - err = kp.deleteKeycard(tx, dbKp.KeycardUID) - if err != nil { - return err - } + if !relatedKeypairExists { + return errCannotAddKeycardForUnknownKeypair + } + + _, err = tx.Exec(` + INSERT OR IGNORE INTO + keycards + ( + keycard_uid, + keycard_name, + key_uid + ) + VALUES + (?, ?, ?); + + UPDATE + keycards + SET + keycard_name = ?, + keycard_locked = ?, + position = ? + WHERE + keycard_uid = ?; + `, keycard.KeycardUID, keycard.KeycardName, keycard.KeyUID, + keycard.KeycardName, keycard.KeycardLocked, keycard.Position, keycard.KeycardUID) + if err != nil { + return err + } + + err = db.saveOrUpdateKeycardAccounts(tx, keycard.KeycardUID, keycard.AccountsAddresses) + if err != nil { + return err + } + + if updateKeypairClock { + return db.updateKeypairClock(tx, keycard.KeyUID, clock) } return nil } -func (kp *Keycards) RemoveMigratedAccountsForKeycard(kcUID string, accountAddresses []types.Address, - clock uint64) (err error) { - tx, proceed, err := kp.startTransactionAndCheckIfNeedToProceed(kcUID, clock) +func (db *Database) execKeycardUpdateQuery(kcUID string, clock uint64, field string, value interface{}) (err error) { + tx, err := db.db.Begin() + if err != nil { + return err + } defer func() { if err == nil { err = tx.Commit() @@ -461,70 +340,41 @@ func (kp *Keycards) RemoveMigratedAccountsForKeycard(kcUID string, accountAddres _ = tx.Rollback() }() + keycard, err := db.getKeycardByKeycardUID(tx, kcUID) if err != nil { return err } - if proceed { - err = kp.setLastUpdateClock(tx, kcUID, clock) - if err != nil { - return err - } - - dbAccountAddresses, err := kp.getAccountsForKeycard(tx, kcUID) - if err != nil { - return err - } - deleteKeycard := true - for _, dbAddr := range dbAccountAddresses { - found := false - for _, addr := range accountAddresses { - if dbAddr == addr { - found = true - } - } - if !found { - deleteKeycard = false - } - } - - if deleteKeycard { - return kp.deleteKeycard(tx, kcUID) - } - - inVector := strings.Repeat(",?", len(accountAddresses)-1) - query := ` - DELETE - FROM - keycards_accounts - WHERE - keycard_uid = ? - AND - account_address IN (?` + inVector + `) - ` - delete, err := tx.Prepare(query) - if err != nil { - return err - } - - args := make([]interface{}, len(accountAddresses)+1) - args[0] = kcUID - for i, addr := range accountAddresses { - args[i+1] = addr - } - - defer delete.Close() - - _, err = delete.Exec(args...) - + sql := fmt.Sprintf(`UPDATE keycards SET %s = ? WHERE keycard_uid = ?`, field) // nolint: gosec + _, err = tx.Exec(sql, value, kcUID) + if err != nil { return err } - return err + return db.updateKeypairClock(tx, keycard.KeyUID, clock) } -func (kp *Keycards) execUpdateQuery(kcUID string, clock uint64, field string, value interface{}) (err error) { - tx, proceed, err := kp.startTransactionAndCheckIfNeedToProceed(kcUID, clock) +func (db *Database) KeycardLocked(kcUID string, clock uint64) (err error) { + return db.execKeycardUpdateQuery(kcUID, clock, "keycard_locked", true) +} + +func (db *Database) KeycardUnlocked(kcUID string, clock uint64) (err error) { + return db.execKeycardUpdateQuery(kcUID, clock, "keycard_locked", false) +} + +func (db *Database) UpdateKeycardUID(oldKcUID string, newKcUID string, clock uint64) (err error) { + return db.execKeycardUpdateQuery(oldKcUID, clock, "keycard_uid", newKcUID) +} + +func (db *Database) SetKeycardName(kcUID string, kpName string, clock uint64) (err error) { + return db.execKeycardUpdateQuery(kcUID, clock, "keycard_name", kpName) +} + +func (db *Database) DeleteKeycardAccounts(kcUID string, accountAddresses []types.Address, clock uint64) (err error) { + tx, err := db.db.Begin() + if err != nil { + return err + } defer func() { if err == nil { err = tx.Commit() @@ -533,37 +383,24 @@ func (kp *Keycards) execUpdateQuery(kcUID string, clock uint64, field string, va _ = tx.Rollback() }() + keycard, err := db.getKeycardByKeycardUID(tx, kcUID) if err != nil { return err } - if proceed { - sql := fmt.Sprintf(`UPDATE keycards SET %s = ?, last_update_clock = ? WHERE keycard_uid = ?`, field) // nolint: gosec - _, err = tx.Exec(sql, value, clock, kcUID) + err = db.deleteKeycardAccounts(tx, kcUID, accountAddresses) + if err != nil { return err } - return nil + return db.updateKeypairClock(tx, keycard.KeyUID, clock) } -func (kp *Keycards) KeycardLocked(kcUID string, clock uint64) (err error) { - return kp.execUpdateQuery(kcUID, clock, "keycard_locked", true) -} - -func (kp *Keycards) KeycardUnlocked(kcUID string, clock uint64) (err error) { - return kp.execUpdateQuery(kcUID, clock, "keycard_locked", false) -} - -func (kp *Keycards) UpdateKeycardUID(oldKcUID string, newKcUID string, clock uint64) (err error) { - return kp.execUpdateQuery(oldKcUID, clock, "keycard_uid", newKcUID) -} - -func (kp *Keycards) SetKeycardName(kcUID string, kpName string, clock uint64) (err error) { - return kp.execUpdateQuery(kcUID, clock, "keycard_name", kpName) -} - -func (kp *Keycards) DeleteKeycard(kcUID string, clock uint64) (err error) { - tx, proceed, err := kp.startTransactionAndCheckIfNeedToProceed(kcUID, clock) +func (db *Database) DeleteKeycard(kcUID string, clock uint64) (err error) { + tx, err := db.db.Begin() + if err != nil { + return err + } defer func() { if err == nil { err = tx.Commit() @@ -572,19 +409,33 @@ func (kp *Keycards) DeleteKeycard(kcUID string, clock uint64) (err error) { _ = tx.Rollback() }() + keycard, err := db.getKeycardByKeycardUID(tx, kcUID) if err != nil { return err } - if proceed { - return kp.deleteKeycard(tx, kcUID) + err = db.deleteKeycard(tx, kcUID) + if err != nil { + return err } - return err + return db.updateKeypairClock(tx, keycard.KeyUID, clock) } -func (kp *Keycards) DeleteAllKeycardsWithKeyUID(keyUID string) (err error) { - delete, err := kp.db.Prepare(` +func (db *Database) DeleteAllKeycardsWithKeyUID(keyUID string, clock uint64) (err error) { + tx, err := db.db.Begin() + if err != nil { + return err + } + defer func() { + if err == nil { + err = tx.Commit() + return + } + _ = tx.Rollback() + }() + + delete, err := tx.Prepare(` DELETE FROM keycards @@ -595,6 +446,23 @@ func (kp *Keycards) DeleteAllKeycardsWithKeyUID(keyUID string) (err error) { return err } defer delete.Close() + _, err = delete.Exec(keyUID) - return err + if err != nil { + return err + } + + return db.updateKeypairClock(tx, keyUID, clock) +} + +func (db *Database) GetPositionForNextNewKeycard() (uint64, error) { + var pos sql.NullInt64 + err := db.db.QueryRow("SELECT MAX(position) FROM keycards").Scan(&pos) + if err != nil { + return 0, err + } + if pos.Valid { + return uint64(pos.Int64) + 1, nil + } + return 0, nil } diff --git a/multiaccounts/accounts/keycard_database_test.go b/multiaccounts/accounts/keycard_database_test.go index e0647243c..8ad1aa4df 100644 --- a/multiaccounts/accounts/keycard_database_test.go +++ b/multiaccounts/accounts/keycard_database_test.go @@ -12,8 +12,6 @@ func TestKeycards(t *testing.T) { db, stop := setupTestDB(t) defer stop() - keycardUID := "00000000000000000000000000000000" - kp1 := GetProfileKeypairForTest(true, true, true) keycard1 := GetProfileKeycardForTest() @@ -23,266 +21,151 @@ func TestKeycards(t *testing.T) { keycard2Copy := GetKeycardForSeedImportedKeypair1ForTest() keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" - keycard2Copy.LastUpdateClock = keycard2Copy.LastUpdateClock + 1 - - kp3 := GetSeedImportedKeypair2ForTest() - keycard3 := GetKeycardForSeedImportedKeypair2ForTest() + keycard2Copy.Position = keycard2Copy.Position + 1 // Pre-condition err := db.SaveOrUpdateKeypair(kp1) require.NoError(t, err) err = db.SaveOrUpdateKeypair(kp2) require.NoError(t, err) - err = db.SaveOrUpdateKeypair(kp3) - require.NoError(t, err) dbKeypairs, err := db.GetKeypairs() require.NoError(t, err) - require.Equal(t, 3, len(dbKeypairs)) + require.Equal(t, 2, len(dbKeypairs)) - // Test adding key pairs - addedKc, addedAccs, err := db.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + // Test adding/reading keycards + err = db.SaveOrUpdateKeycard(*keycard1, 0, false) require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) + dbKeycard1, err := db.GetKeycardByKeycardUID(keycard1.KeycardUID) require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2Copy) - require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) - // this should be added - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(Keycard{ - KeycardUID: keycard2Copy.KeycardUID, - AccountsAddresses: []types.Address{{0x03}}, - LastUpdateClock: keycard2Copy.LastUpdateClock + 1, - }) - require.NoError(t, err) - require.Equal(t, false, addedKc) - require.Equal(t, true, addedAccs) - // this should not be added as it has clock value less than last updated clock value - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(Keycard{ - KeycardUID: keycard2Copy.KeycardUID, - AccountsAddresses: []types.Address{{0x04}}, - LastUpdateClock: keycard2Copy.LastUpdateClock, - }) - require.NoError(t, err) - require.Equal(t, false, addedKc) - require.Equal(t, false, addedAccs) - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard3) - require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) + require.True(t, SameKeycards(keycard1, dbKeycard1)) - // Test reading migrated key pairs - rows, err := db.GetAllKnownKeycardsGroupedByKeyUID() + err = db.SaveOrUpdateKeycard(*keycard2, 0, false) require.NoError(t, err) - require.Equal(t, 3, len(rows)) - for _, kp := range rows { - if kp.KeyUID == keycard1.KeyUID { - require.Equal(t, keycard1.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard1.KeycardName, kp.KeycardName) - require.Equal(t, keycard1.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard1.AccountsAddresses), len(kp.AccountsAddresses)) - } else if kp.KeyUID == keycard2.KeyUID { // keycard 2 and 3, cause 3 is a copy of 2 - require.Equal(t, keycard2.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard2.KeycardName, kp.KeycardName) - require.Equal(t, keycard2.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard2.AccountsAddresses)+1, len(kp.AccountsAddresses)) // Add 1, cause one account is additionally added for the same keycard. - } else { - require.Equal(t, keycard3.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard3.KeycardName, kp.KeycardName) - require.Equal(t, keycard3.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard3.AccountsAddresses), len(kp.AccountsAddresses)) - } - } + dbKeycard2, err := db.GetKeycardByKeycardUID(keycard2.KeycardUID) + require.NoError(t, err) + require.True(t, SameKeycards(keycard2, dbKeycard2)) - rows, err = db.GetKeycardByKeyUID(keycard1.KeyUID) + err = db.SaveOrUpdateKeycard(*keycard2Copy, 0, false) require.NoError(t, err) - require.Equal(t, 1, len(rows)) - require.Equal(t, keycard1.KeyUID, rows[0].KeyUID) - require.Equal(t, keycard1.KeycardUID, rows[0].KeycardUID) - require.Equal(t, keycard1.KeycardName, rows[0].KeycardName) - require.Equal(t, keycard1.KeycardLocked, rows[0].KeycardLocked) - require.Equal(t, len(keycard1.AccountsAddresses), len(rows[0].AccountsAddresses)) - require.Equal(t, keycard1.LastUpdateClock, rows[0].LastUpdateClock) + dbKeycard2Copy, err := db.GetKeycardByKeycardUID(keycard2Copy.KeycardUID) + require.NoError(t, err) + require.True(t, SameKeycards(keycard2Copy, dbKeycard2Copy)) - rows, err = db.GetAllKnownKeycards() + dbKeycards, err := db.GetKeycardsWithSameKeyUID(keycard2.KeyUID) require.NoError(t, err) - require.Equal(t, 4, len(rows)) - for _, kp := range rows { - if kp.KeycardUID == keycard1.KeycardUID { - require.Equal(t, keycard1.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard1.KeycardName, kp.KeycardName) - require.Equal(t, keycard1.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard1.AccountsAddresses), len(kp.AccountsAddresses)) - require.Equal(t, keycard1.LastUpdateClock, kp.LastUpdateClock) - } else if kp.KeycardUID == keycard2.KeycardUID { - require.Equal(t, keycard2.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard2.KeycardName, kp.KeycardName) - require.Equal(t, keycard2.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard2.AccountsAddresses), len(kp.AccountsAddresses)) - require.Equal(t, keycard2.LastUpdateClock, kp.LastUpdateClock) - } else if kp.KeycardUID == keycard2Copy.KeycardUID { - require.Equal(t, keycard2Copy.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard2Copy.KeycardName, kp.KeycardName) - require.Equal(t, keycard2Copy.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard2Copy.AccountsAddresses)+1, len(kp.AccountsAddresses)) // Add 1, cause one account is additionally added. - require.Equal(t, keycard2Copy.LastUpdateClock+1, kp.LastUpdateClock) - } else { - require.Equal(t, keycard3.KeycardUID, kp.KeycardUID) - require.Equal(t, keycard3.KeycardName, kp.KeycardName) - require.Equal(t, keycard3.KeycardLocked, kp.KeycardLocked) - require.Equal(t, len(keycard3.AccountsAddresses), len(kp.AccountsAddresses)) - require.Equal(t, keycard3.LastUpdateClock, kp.LastUpdateClock) - } - } + require.Equal(t, 2, len(dbKeycards)) + require.True(t, Contains(dbKeycards, keycard2, SameKeycards)) + require.True(t, Contains(dbKeycards, keycard2Copy, SameKeycards)) + + dbKeycards, err = db.GetAllKnownKeycards() + require.NoError(t, err) + require.Equal(t, 3, len(dbKeycards)) + require.True(t, Contains(dbKeycards, keycard1, SameKeycards)) + require.True(t, Contains(dbKeycards, keycard2, SameKeycards)) + require.True(t, Contains(dbKeycards, keycard2Copy, SameKeycards)) + + nextPosition, err := db.GetPositionForNextNewKeycard() + require.NoError(t, err) + require.Equal(t, uint64(len(dbKeycards)), nextPosition) + + // test adding additional accounts to keycard + keycard1.AccountsAddresses = append(keycard1.AccountsAddresses, types.Address{0x05}, types.Address{0x06}) + err = db.SaveOrUpdateKeycard(*keycard1, 0, false) + require.NoError(t, err) + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) + require.NoError(t, err) + require.Equal(t, len(keycard1.AccountsAddresses), len(dbKeycard1.AccountsAddresses)) + require.True(t, SameKeycards(keycard1, dbKeycard1)) // Test seting a new keycard name - err = db.SetKeycardName(keycard1.KeycardUID, "Card101", 1000) + keycard1.KeycardName = "Card101" + err = db.SetKeycardName(keycard1.KeycardUID, keycard1.KeycardName, 1000) require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) require.NoError(t, err) - newKeycardName := "" - for _, kp := range rows { - if kp.KeyUID == keycard1.KeyUID { - newKeycardName = kp.KeycardName - } - } - require.Equal(t, "Card101", newKeycardName) - - // Test seting a new keycard name with an old clock value - err = db.SetKeycardName(keycard1.KeycardUID, "Card102", 999) // clock is less than the last one - require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() - require.NoError(t, err) - newKeycardName = "" - for _, kp := range rows { - if kp.KeyUID == keycard1.KeyUID { - newKeycardName = kp.KeycardName - } - } - require.Equal(t, "Card101", newKeycardName) + require.True(t, SameKeycards(keycard1, dbKeycard1)) // Test locking a keycard + keycard1.KeycardLocked = true err = db.KeycardLocked(keycard1.KeycardUID, 1001) require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) require.NoError(t, err) - locked := false - for _, kp := range rows { - if kp.KeyUID == keycard1.KeyUID { - locked = kp.KeycardLocked - } - } - require.Equal(t, true, locked) + require.True(t, SameKeycards(keycard1, dbKeycard1)) + + // Test unlocking a keycard + keycard1.KeycardLocked = false + err = db.KeycardUnlocked(keycard1.KeycardUID, 1002) + require.NoError(t, err) + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) + require.NoError(t, err) + require.True(t, SameKeycards(keycard1, dbKeycard1)) + + // Test update keycard uid + oldKeycardUID := keycard1.KeycardUID + keycard1.KeycardUID = "00000000000000000000000000000000" + err = db.UpdateKeycardUID(oldKeycardUID, keycard1.KeycardUID, 1003) + require.NoError(t, err) + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) + require.NoError(t, err) + require.True(t, SameKeycards(keycard1, dbKeycard1)) // Test detleting accounts (addresses) for a certain keycard const numOfAccountsToRemove = 2 require.Greater(t, len(keycard1.AccountsAddresses), numOfAccountsToRemove) accountsToRemove := keycard1.AccountsAddresses[:numOfAccountsToRemove] - err = db.RemoveMigratedAccountsForKeycard(keycard1.KeycardUID, accountsToRemove, 1002) + keycard1.AccountsAddresses = keycard1.AccountsAddresses[numOfAccountsToRemove:] + err = db.DeleteKeycardAccounts(keycard1.KeycardUID, accountsToRemove, 1004) require.NoError(t, err) - rows, err = db.GetKeycardByKeyUID(keycard1.KeyUID) + dbKeycard1, err = db.GetKeycardByKeycardUID(keycard1.KeycardUID) require.NoError(t, err) - require.Equal(t, 1, len(rows)) - require.Equal(t, len(keycard1.AccountsAddresses)-numOfAccountsToRemove, len(rows[0].AccountsAddresses)) - - // Test deleting accounts one by one, with the last deleted account keycard should be delete as well - for i, addr := range keycard3.AccountsAddresses { - err = db.RemoveMigratedAccountsForKeycard(keycard3.KeycardUID, []types.Address{addr}, 1003+uint64(i)) - require.NoError(t, err) - } - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() - require.NoError(t, err) - // Test if correct keycard is deleted - deletedKeycard3 := true - for _, kp := range rows { - if kp.KeycardUID == keycard3.KeycardUID { - deletedKeycard3 = false - } - } - require.Equal(t, true, deletedKeycard3) - - // Test update keycard uid - err = db.UpdateKeycardUID(keycard1.KeycardUID, keycardUID, 1100) - require.NoError(t, err) - - // Test unlocking a locked keycard - err = db.KeycardUnlocked(keycardUID, 1101) - require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() - require.NoError(t, err) - locked = true - for _, kp := range rows { - if kp.KeycardUID == keycardUID { - locked = kp.KeycardLocked - } - } - require.Equal(t, false, locked) + require.True(t, SameKeycards(keycard1, dbKeycard1)) // Test detleting a keycard - err = db.DeleteKeycard(keycardUID, 1102) + err = db.DeleteKeycard(keycard1.KeycardUID, 1006) require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() + dbKeycards, err = db.GetAllKnownKeycards() require.NoError(t, err) - require.Equal(t, 1, len(rows)) - // Test if correct keycard is deleted - deletedKeyCard := true - for _, kp := range rows { - if kp.KeycardUID == keycardUID { - deletedKeyCard = false - } - } - require.Equal(t, true, deletedKeyCard) + require.Equal(t, 2, len(dbKeycards)) + dbKeycards, err = db.GetKeycardsWithSameKeyUID(keycard1.KeyUID) + require.NoError(t, err) + require.Equal(t, 0, len(dbKeycards)) + dbKeycard, err := db.GetKeycardByKeycardUID(keycard1.KeycardUID) + require.Error(t, err) + require.True(t, err == ErrNoKeycardForPassedKeycardUID) + require.Nil(t, dbKeycard) - // Test detleting a keycard - err = db.DeleteAllKeycardsWithKeyUID(keycard2.KeyUID) + // Test detleting all keycards for KeyUID + dbKeycards, err = db.GetKeycardsWithSameKeyUID(keycard2.KeyUID) require.NoError(t, err) - rows, err = db.GetAllKnownKeycardsGroupedByKeyUID() + require.Equal(t, 2, len(dbKeycards)) + err = db.DeleteAllKeycardsWithKeyUID(keycard2.KeyUID, 1007) require.NoError(t, err) - // Test if correct keycard is deleted - deletedKeycard2And3 := true - for _, kp := range rows { - if kp.KeyUID == keycard2.KeyUID { - deletedKeycard2And3 = false - } - } - require.Equal(t, true, deletedKeycard2And3) + dbKeycards, err = db.GetAllKnownKeycards() + require.NoError(t, err) + require.Equal(t, 0, len(dbKeycards)) + dbKeycards, err = db.GetKeycardsWithSameKeyUID(keycard2.KeyUID) + require.NoError(t, err) + require.Equal(t, 0, len(dbKeycards)) + dbKeycard, err = db.GetKeycardByKeycardUID(keycard2.KeycardUID) + require.Error(t, err) + require.True(t, err == ErrNoKeycardForPassedKeycardUID) + require.Nil(t, dbKeycard) } func TestKeycardsRemovalWhenDeletingKeypair(t *testing.T) { db, stop := setupTestDB(t) defer stop() - kp2 := &Keypair{ - KeyUID: "0000000000000000000000000000000000000000000000000000000000000002", - Name: "Keypair Name 2", - Type: KeypairTypeSeed, - DerivedFrom: "0x0001", - } - kp2.Accounts = append(kp2.Accounts, &Account{Address: types.Address{0x11}, KeyUID: kp2.KeyUID}) - kp2.Accounts = append(kp2.Accounts, &Account{Address: types.Address{0x12}, KeyUID: kp2.KeyUID}) + kp2 := GetSeedImportedKeypair1ForTest() + keycard2 := GetKeycardForSeedImportedKeypair1ForTest() - keycard2 := Keycard{ - KeycardUID: "00000000000000000000000000000002", - KeycardName: "Card02", - KeycardLocked: false, - AccountsAddresses: []types.Address{{0x11}, {0x12}}, - KeyUID: kp2.KeyUID, - LastUpdateClock: 200, - } - keycard3 := Keycard{ - KeycardUID: "00000000000000000000000000000003", - KeycardName: "Card02 Copy", - KeycardLocked: false, - AccountsAddresses: []types.Address{{0x11}, {0x12}}, - KeyUID: kp2.KeyUID, - LastUpdateClock: 300, - } + keycard2Copy := GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" + keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" + keycard2Copy.Position = keycard2Copy.Position + 1 - // Pre-condition - save keypair + // Pre-condition err := db.SaveOrUpdateKeypair(kp2) require.NoError(t, err) dbKeypairs, err := db.GetKeypairs() @@ -290,27 +173,24 @@ func TestKeycardsRemovalWhenDeletingKeypair(t *testing.T) { require.Equal(t, 1, len(dbKeypairs)) // Pre-condition - save keycards referring to previously added keypair - addedKc, addedAccs, err := db.AddKeycardOrAddAccountsIfKeycardIsAdded(keycard2) + err = db.SaveOrUpdateKeycard(*keycard2, 0, false) require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) - addedKc, addedAccs, err = db.AddKeycardOrAddAccountsIfKeycardIsAdded(keycard3) + dbKeycard2, err := db.GetKeycardByKeycardUID(keycard2.KeycardUID) require.NoError(t, err) - require.Equal(t, true, addedKc) - require.Equal(t, false, addedAccs) + require.True(t, SameKeycards(keycard2, dbKeycard2)) + + err = db.SaveOrUpdateKeycard(*keycard2Copy, 0, false) + require.NoError(t, err) + dbKeycard2Copy, err := db.GetKeycardByKeycardUID(keycard2Copy.KeycardUID) + require.NoError(t, err) + require.True(t, SameKeycards(keycard2Copy, dbKeycard2Copy)) // Check db state - keycardsWithSameKeyUID, err := db.GetAllKnownKeycards() + dbKeycards, err := db.GetKeycardsWithSameKeyUID(keycard2.KeyUID) require.NoError(t, err) - require.Equal(t, 2, len(keycardsWithSameKeyUID)) - - require.Equal(t, len(kp2.KeyUID), len(dbKeypairs[0].KeyUID)) - require.Equal(t, len(kp2.KeyUID), len(keycardsWithSameKeyUID[0].KeyUID)) - require.Equal(t, len(kp2.KeyUID), len(keycardsWithSameKeyUID[1].KeyUID)) - - require.Equal(t, len(kp2.Accounts), len(dbKeypairs[0].Accounts)) - require.Equal(t, len(kp2.Accounts), len(keycardsWithSameKeyUID[0].AccountsAddresses)) - require.Equal(t, len(kp2.Accounts), len(keycardsWithSameKeyUID[1].AccountsAddresses)) + require.Equal(t, 2, len(dbKeycards)) + require.True(t, Contains(dbKeycards, keycard2, SameKeycards)) + require.True(t, Contains(dbKeycards, keycard2Copy, SameKeycards)) // Remove keypair err = db.DeleteKeypair(kp2.KeyUID) @@ -321,7 +201,14 @@ func TestKeycardsRemovalWhenDeletingKeypair(t *testing.T) { require.NoError(t, err) require.Equal(t, 0, len(dbKeypairs)) - keycardsWithSameKeyUID, err = db.GetAllKnownKeycards() + dbKeycards, err = db.GetAllKnownKeycards() require.NoError(t, err) - require.Equal(t, 0, len(keycardsWithSameKeyUID)) + require.Equal(t, 0, len(dbKeycards)) + dbKeycards, err = db.GetKeycardsWithSameKeyUID(kp2.KeyUID) + require.NoError(t, err) + require.Equal(t, 0, len(dbKeycards)) + dbKeycard, err := db.GetKeycardByKeycardUID(keycard2.KeycardUID) + require.Error(t, err) + require.True(t, err == ErrNoKeycardForPassedKeycardUID) + require.Nil(t, dbKeycard) } diff --git a/multiaccounts/accounts/test_helper.go b/multiaccounts/accounts/test_helper.go index 006483390..fe6d19c47 100644 --- a/multiaccounts/accounts/test_helper.go +++ b/multiaccounts/accounts/test_helper.go @@ -257,7 +257,7 @@ func GetProfileKeycardForTest() *Keycard { KeycardLocked: false, AccountsAddresses: keycard1Addresses, KeyUID: profileKp.KeyUID, - LastUpdateClock: 100, + Position: 0, } } @@ -273,7 +273,7 @@ func GetKeycardForSeedImportedKeypair1ForTest() *Keycard { KeycardLocked: false, AccountsAddresses: keycard2Addresses, KeyUID: seed1Kp.KeyUID, - LastUpdateClock: 200, + Position: 1, } } @@ -289,10 +289,28 @@ func GetKeycardForSeedImportedKeypair2ForTest() *Keycard { KeycardLocked: false, AccountsAddresses: keycard4Addresses, KeyUID: seed2Kp.KeyUID, - LastUpdateClock: 300, + Position: 2, } } +func Contains[T comparable](container []T, element T, isEqual func(T, T) bool) bool { + for _, e := range container { + if isEqual(e, element) { + return true + } + } + return false +} + +func HaveSameElements[T comparable](a []T, b []T, isEqual func(T, T) bool) bool { + for _, v := range a { + if !Contains(b, v, isEqual) { + return false + } + } + return true +} + func SameAccounts(expected, real *Account) bool { return expected.Address == real.Address && expected.KeyUID == real.KeyUID && @@ -379,7 +397,7 @@ func SameKeycards(expected, real *Keycard) bool { expected.KeyUID == real.KeyUID && expected.KeycardName == real.KeycardName && expected.KeycardLocked == real.KeycardLocked && - expected.LastUpdateClock == real.LastUpdateClock && + expected.Position == real.Position && len(expected.AccountsAddresses) == len(real.AccountsAddresses) if same { diff --git a/protocol/messenger.go b/protocol/messenger.go index 81b7aebb7..3d8cf07f9 100644 --- a/protocol/messenger.go +++ b/protocol/messenger.go @@ -4315,20 +4315,6 @@ func (m *Messenger) handleRetrievedMessages(chatWithMessages map[transport.Filte allMessagesProcessed = false continue } - case protobuf.SyncKeycardAction: - if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) { - logger.Warn("not coming from us, ignoring") - continue - } - - p := msg.ParsedMessage.Interface().(protobuf.SyncKeycardAction) - m.outputToCSV(msg.TransportMessage.Timestamp, msg.ID, senderID, filter.Topic, filter.ChatID, msg.Type, p) - err = m.handleSyncKeycardActivity(messageState, p) - if err != nil { - logger.Warn("failed to handle SyncKeycardAction", zap.Error(err)) - allMessagesProcessed = false - continue - } case protobuf.SyncSocialLinks: if !common.IsPubKeyEqual(messageState.CurrentMessageState.PublicKey, &m.identity.PublicKey) { logger.Warn("not coming from us, ignoring") diff --git a/protocol/messenger_backup_test.go b/protocol/messenger_backup_test.go index e282f9017..e45d33147 100644 --- a/protocol/messenger_backup_test.go +++ b/protocol/messenger_backup_test.go @@ -757,7 +757,7 @@ func (s *MessengerBackupSuite) TestBackupKeypairs() { s.Require().Equal(accounts.SyncedFromBackup, dbProfileKp2.SyncedFrom) for _, acc := range profileKp.Accounts { - s.Require().True(contains(dbProfileKp2.Accounts, acc, accounts.SameAccounts)) + s.Require().True(accounts.Contains(dbProfileKp2.Accounts, acc, accounts.SameAccounts)) } dbSeedKp2, err := bob2.settings.GetKeypairByKeyUID(seedKp.KeyUID) @@ -778,7 +778,6 @@ func (s *MessengerBackupSuite) TestBackupKeycards() { keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" - keycard2Copy.LastUpdateClock = keycard2Copy.LastUpdateClock + 1 kp3 := accounts.GetSeedImportedKeypair2ForTest() keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() @@ -794,22 +793,14 @@ func (s *MessengerBackupSuite) TestBackupKeycards() { s.Require().NoError(err) s.Require().Equal(3, len(dbKeypairs)) - addedKc, addedAccs, err := bob1.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = bob1.settings.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - addedKc, addedAccs, err = bob1.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) + err = bob1.settings.SaveOrUpdateKeycard(*keycard2, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - addedKc, addedAccs, err = bob1.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2Copy) + err = bob1.settings.SaveOrUpdateKeycard(*keycard2Copy, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - addedKc, addedAccs, err = bob1.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard3) + err = bob1.settings.SaveOrUpdateKeycard(*keycard3, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Create bob2 bob2, err := newMessengerWithKey(s.shh, bob1.identity, s.logger, nil) @@ -835,10 +826,10 @@ func (s *MessengerBackupSuite) TestBackupKeycards() { syncedKeycards, err := bob2.settings.GetAllKnownKeycards() s.Require().NoError(err) s.Require().Equal(4, len(syncedKeycards)) - s.Require().True(contains(syncedKeycards, keycard1, accounts.SameKeycards)) - s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) - s.Require().True(contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) - s.Require().True(contains(syncedKeycards, keycard3, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard1, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard3, accounts.SameKeycards)) } func (s *MessengerBackupSuite) TestBackupWatchOnlyAccounts() { diff --git a/protocol/messenger_handler.go b/protocol/messenger_handler.go index 7119b19b9..6dacb6b8e 100644 --- a/protocol/messenger_handler.go +++ b/protocol/messenger_handler.go @@ -3036,13 +3036,13 @@ func (m *Messenger) resolveAccountOperability(syncAcc *protobuf.SyncAccount, syn // We're here when we receive a keypair from the paired device which is either: // 1. regular keypair or // 2. was just converted from keycard to a regular keypair. - dbKeycardsForKeyUID, err := m.settings.GetKeycardByKeyUID(syncAcc.KeyUid) - if err != nil && err != accounts.ErrDbKeypairNotFound { + dbKeycardsForKeyUID, err := m.settings.GetKeycardsWithSameKeyUID(syncAcc.KeyUid) + if err != nil { return accounts.AccountNonOperable, err } if len(dbKeycardsForKeyUID) > 0 { - // We're here in 2. case from above and in this case we need to mark all accounts for this keypair non operable + // We're here in case 2. from above and in this case we need to mark all accounts for this keypair non operable return accounts.AccountNonOperable, nil } } @@ -3174,7 +3174,7 @@ func (m *Messenger) handleSyncKeypair(message *protobuf.SyncKeypair) (*accounts. } } - err = m.settings.DeleteKeypair(message.KeyUid) + err = m.settings.DeleteKeypair(message.KeyUid) // deleting keypair will delete related keycards as well if err != nil && err != accounts.ErrDbKeypairNotFound { return nil, err } @@ -3192,14 +3192,13 @@ func (m *Messenger) handleSyncKeypair(message *protobuf.SyncKeypair) (*accounts. for _, sKc := range message.Keycards { kc := accounts.Keycard{} kc.FromSyncKeycard(sKc) + err = m.settings.SaveOrUpdateKeycard(kc, message.Clock, false) + if err != nil { + return nil, err + } kp.Keycards = append(kp.Keycards, &kc) } - err = m.settings.ApplyKeycardsForKeypairWithKeyUID(kp.KeyUID, kp.Keycards) - if err != nil { - return nil, err - } - return kp, nil } diff --git a/protocol/messenger_keycard.go b/protocol/messenger_keycard.go index 4ede8a978..0e63fe216 100644 --- a/protocol/messenger_keycard.go +++ b/protocol/messenger_keycard.go @@ -3,24 +3,18 @@ package protocol import ( "context" - "github.com/golang/protobuf/proto" - "github.com/status-im/status-go/eth-node/types" "github.com/status-im/status-go/multiaccounts/accounts" - "github.com/status-im/status-go/protocol/common" "github.com/status-im/status-go/protocol/protobuf" ) func (m *Messenger) prepareSyncKeycardsMessage(keyUID string) (message []*protobuf.SyncKeycard, err error) { - allKeycards, err := m.settings.GetAllKnownKeycards() + keycards, err := m.settings.GetKeycardsWithSameKeyUID(keyUID) if err != nil { - return message, err + return } - for _, kc := range allKeycards { - if kc.KeyUID != keyUID { - continue - } + for _, kc := range keycards { syncKeycard := kc.ToSyncKeycard() message = append(message, syncKeycard) } @@ -28,198 +22,91 @@ func (m *Messenger) prepareSyncKeycardsMessage(keyUID string) (message []*protob return } -func (m *Messenger) dispatchKeycardActivity(ctx context.Context, syncMessage protobuf.SyncKeycardAction) error { - if !m.hasPairedDevices() { - return nil +func (m *Messenger) dispatchKeycardActivity(keyUID string, keycardUID string, newKeycardUID string, accountAddresses []types.Address, + callback func(uint64) error) error { + clock, _ := m.getLastClockWithRelatedChat() + + finalKeyUID := keyUID + if finalKeyUID == "" { + dbKeycard, err := m.settings.GetKeycardByKeycardUID(keycardUID) + if err != nil { + return err + } + finalKeyUID = dbKeycard.KeyUID } - clock, chat := m.getLastClockWithRelatedChat() - - encodedMessage, err := proto.Marshal(&syncMessage) - if err != nil { + if err := callback(clock); err != nil { return err } - rawMessage := common.RawMessage{ - LocalChatID: chat.ID, - Payload: encodedMessage, - MessageType: protobuf.ApplicationMetadataMessage_SYNC_KEYCARD_ACTION, - ResendAutomatically: true, - } + return m.resolveAndSyncKeypairOrJustWalletAccount(finalKeyUID, types.Address{}, clock, m.dispatchMessage) +} - _, err = m.dispatchMessage(ctx, rawMessage) - if err != nil { +// This function stores keycard to db and notifies paired devices about that if keycard with `KeycardUID` is not already stored. +// Keycard position is fully maintained by the backend. +// If keycard is already stored, this function updates `KeycardName` and adds accounts which are not already added, in this case +// `KeycardLocked` and `Position` remains as they were, they won't be changed. +func (m *Messenger) SaveOrUpdateKeycard(ctx context.Context, keycard *accounts.Keycard) (err error) { + dbKeycard, err := m.settings.GetKeycardByKeycardUID(keycard.KeycardUID) + if err != nil && err != accounts.ErrNoKeycardForPassedKeycardUID { return err } - chat.LastClockValue = clock - return m.saveChat(chat) + if dbKeycard == nil { + position, err := m.settings.GetPositionForNextNewKeycard() + if err != nil { + return err + } + keycard.Position = position + keycard.KeycardLocked = false + } else { + keycard.Position = dbKeycard.Position + keycard.KeycardLocked = dbKeycard.KeycardLocked + } + + return m.dispatchKeycardActivity(keycard.KeyUID, "", "", []types.Address{}, func(clock uint64) error { + return m.settings.SaveOrUpdateKeycard(*keycard, clock, true) + }) } -func (m *Messenger) handleSyncKeycardActivity(state *ReceivedMessageState, syncMessage protobuf.SyncKeycardAction) (err error) { - - var kcAction = &accounts.KeycardAction{ - Action: protobuf.SyncKeycardAction_Action_name[int32(syncMessage.Action)], - OldKeycardUID: syncMessage.OldKeycardUid, - Keycard: &accounts.Keycard{}, - } - kcAction.Keycard.FromSyncKeycard(syncMessage.Keycard) - - switch syncMessage.Action { - case protobuf.SyncKeycardAction_KEYCARD_ADDED, - protobuf.SyncKeycardAction_ACCOUNTS_ADDED: - _, _, err = m.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*kcAction.Keycard) - case protobuf.SyncKeycardAction_KEYCARD_DELETED: - err = m.settings.DeleteKeycard(kcAction.Keycard.KeycardUID, kcAction.Keycard.LastUpdateClock) - case protobuf.SyncKeycardAction_ACCOUNTS_REMOVED: - err = m.settings.RemoveMigratedAccountsForKeycard(kcAction.Keycard.KeycardUID, kcAction.Keycard.AccountsAddresses, - kcAction.Keycard.LastUpdateClock) - case protobuf.SyncKeycardAction_LOCKED: - err = m.settings.KeycardLocked(kcAction.Keycard.KeycardUID, kcAction.Keycard.LastUpdateClock) - case protobuf.SyncKeycardAction_UNLOCKED: - err = m.settings.KeycardUnlocked(kcAction.Keycard.KeycardUID, kcAction.Keycard.LastUpdateClock) - case protobuf.SyncKeycardAction_UID_UPDATED: - err = m.settings.UpdateKeycardUID(kcAction.OldKeycardUID, kcAction.Keycard.KeycardUID, - kcAction.Keycard.LastUpdateClock) - case protobuf.SyncKeycardAction_NAME_CHANGED: - err = m.settings.SetKeycardName(kcAction.Keycard.KeycardUID, kcAction.Keycard.KeycardName, - kcAction.Keycard.LastUpdateClock) - default: - panic("unknown action for handling keycard activity") - } - - if err != nil { - return err - } - - state.Response.AddKeycardAction(kcAction) - - return nil +func (m *Messenger) SetKeycardName(ctx context.Context, keycardUID string, kpName string) error { + return m.dispatchKeycardActivity("", keycardUID, "", []types.Address{}, func(clock uint64) error { + return m.settings.SetKeycardName(keycardUID, kpName, clock) + }) } -func (m *Messenger) AddKeycardOrAddAccountsIfKeycardIsAdded(ctx context.Context, kp *accounts.Keycard) (added bool, err error) { - addedKc, addedAccs, err := m.settings.AddKeycardOrAddAccountsIfKeycardIsAdded(*kp) - if err != nil { - return addedKc || addedAccs, err - } - - activityMessage := protobuf.SyncKeycardAction{ - Keycard: kp.ToSyncKeycard(), - } - if addedKc { - activityMessage.Action = protobuf.SyncKeycardAction_KEYCARD_ADDED - } else if addedAccs { - activityMessage.Action = protobuf.SyncKeycardAction_ACCOUNTS_ADDED - } - - return addedKc || addedAccs, m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) KeycardLocked(ctx context.Context, keycardUID string) error { + return m.dispatchKeycardActivity("", keycardUID, "", []types.Address{}, func(clock uint64) error { + return m.settings.KeycardLocked(keycardUID, clock) + }) } -func (m *Messenger) RemoveMigratedAccountsForKeycard(ctx context.Context, kcUID string, addresses []types.Address, clock uint64) error { - - err := m.settings.RemoveMigratedAccountsForKeycard(kcUID, addresses, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_ACCOUNTS_REMOVED, - Keycard: &protobuf.SyncKeycard{ - Uid: kcUID, - Clock: clock, - }, - } - - for _, addr := range addresses { - activityMessage.Keycard.Addresses = append(activityMessage.Keycard.Addresses, addr.Bytes()) - } - - return m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) KeycardUnlocked(ctx context.Context, keycardUID string) error { + return m.dispatchKeycardActivity("", keycardUID, "", []types.Address{}, func(clock uint64) error { + return m.settings.KeycardUnlocked(keycardUID, clock) + }) } -func (m *Messenger) SetKeycardName(ctx context.Context, kcUID string, kpName string, clock uint64) error { - err := m.settings.SetKeycardName(kcUID, kpName, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_NAME_CHANGED, - Keycard: &protobuf.SyncKeycard{ - Uid: kcUID, - Name: kpName, - Clock: clock, - }, - } - - return m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) DeleteKeycardAccounts(ctx context.Context, keycardUID string, accountAddresses []types.Address) error { + return m.dispatchKeycardActivity("", keycardUID, "", accountAddresses, func(clock uint64) error { + return m.settings.DeleteKeycardAccounts(keycardUID, accountAddresses, clock) + }) } -func (m *Messenger) KeycardLocked(ctx context.Context, kcUID string, clock uint64) error { - err := m.settings.KeycardLocked(kcUID, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_LOCKED, - Keycard: &protobuf.SyncKeycard{ - Uid: kcUID, - Clock: clock, - }, - } - - return m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) DeleteKeycard(ctx context.Context, keycardUID string) error { + return m.dispatchKeycardActivity("", keycardUID, "", []types.Address{}, func(clock uint64) error { + return m.settings.DeleteKeycard(keycardUID, clock) + }) } -func (m *Messenger) KeycardUnlocked(ctx context.Context, kcUID string, clock uint64) error { - err := m.settings.KeycardUnlocked(kcUID, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_UNLOCKED, - Keycard: &protobuf.SyncKeycard{ - Uid: kcUID, - Clock: clock, - }, - } - - return m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) DeleteAllKeycardsWithKeyUID(ctx context.Context, keyUID string) error { + return m.dispatchKeycardActivity(keyUID, "", "", []types.Address{}, func(clock uint64) error { + return m.settings.DeleteAllKeycardsWithKeyUID(keyUID, clock) + }) } -func (m *Messenger) DeleteKeycard(ctx context.Context, kcUID string, clock uint64) error { - err := m.settings.DeleteKeycard(kcUID, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_KEYCARD_DELETED, - Keycard: &protobuf.SyncKeycard{ - Uid: kcUID, - Clock: clock, - }, - } - - return m.dispatchKeycardActivity(ctx, activityMessage) -} - -func (m *Messenger) UpdateKeycardUID(ctx context.Context, oldKcUID string, newKcUID string, clock uint64) error { - err := m.settings.UpdateKeycardUID(oldKcUID, newKcUID, clock) - if err != nil { - return err - } - - activityMessage := protobuf.SyncKeycardAction{ - Action: protobuf.SyncKeycardAction_UID_UPDATED, - OldKeycardUid: oldKcUID, - Keycard: &protobuf.SyncKeycard{ - Uid: newKcUID, - Clock: clock, - }, - } - - return m.dispatchKeycardActivity(ctx, activityMessage) +func (m *Messenger) UpdateKeycardUID(ctx context.Context, oldKeycardUID string, newKeycardUID string) error { + return m.dispatchKeycardActivity("", oldKeycardUID, newKeycardUID, []types.Address{}, func(clock uint64) error { + return m.settings.UpdateKeycardUID(oldKeycardUID, newKeycardUID, clock) + }) } diff --git a/protocol/messenger_response.go b/protocol/messenger_response.go index da8699b11..8d19660e1 100644 --- a/protocol/messenger_response.go +++ b/protocol/messenger_response.go @@ -74,7 +74,6 @@ type MessengerResponse struct { trustStatus map[string]verification.TrustStatus emojiReactions map[string]*EmojiReaction savedAddresses map[string]*wallet.SavedAddress - keycardActions []*accounts.KeycardAction SocialLinksInfo *identity.SocialLinksInfo ensUsernameDetails []*ensservice.UsernameDetail } @@ -116,7 +115,6 @@ func (r *MessengerResponse) MarshalJSON() ([]byte, error) { DiscordMessages []*protobuf.DiscordMessage `json:"discordMessages,omitempty"` DiscordMessageAttachments []*protobuf.DiscordMessageAttachment `json:"discordMessageAtachments,omitempty"` SavedAddresses []*wallet.SavedAddress `json:"savedAddresses,omitempty"` - KeycardActions []*accounts.KeycardAction `json:"keycardActions,omitempty"` SocialLinksInfo *identity.SocialLinksInfo `json:"socialLinksInfo,omitempty"` EnsUsernameDetails []*ensservice.UsernameDetail `json:"ensUsernameDetails,omitempty"` }{ @@ -151,7 +149,6 @@ func (r *MessengerResponse) MarshalJSON() ([]byte, error) { DiscordCategories: r.DiscordCategories, DiscordChannels: r.DiscordChannels, DiscordOldestMessageTimestamp: r.DiscordOldestMessageTimestamp, - KeycardActions: r.KeycardActions(), SocialLinksInfo: r.SocialLinksInfo, EnsUsernameDetails: r.EnsUsernameDetails(), } @@ -279,7 +276,6 @@ func (r *MessengerResponse) IsEmpty() bool { len(r.verificationRequests)+ len(r.RequestsToJoinCommunity)+ len(r.savedAddresses)+ - len(r.keycardActions) == 0 && len(r.ensUsernameDetails) == 0 && r.currentStatus == nil && r.activityCenterState == nil && @@ -312,7 +308,6 @@ func (r *MessengerResponse) Merge(response *MessengerResponse) error { r.AddEmojiReactions(response.EmojiReactions()) r.AddInstallations(response.Installations) r.AddSavedAddresses(response.SavedAddresses()) - r.AddKeycardActions(response.KeycardActions()) r.AddEnsUsernameDetails(response.EnsUsernameDetails()) r.AddRequestsToJoinCommunity(response.RequestsToJoinCommunity) r.AddBookmarks(response.GetBookmarks()) @@ -463,18 +458,6 @@ func (r *MessengerResponse) SavedAddresses() []*wallet.SavedAddress { return ers } -func (r *MessengerResponse) AddKeycardAction(keycardAction *accounts.KeycardAction) { - r.keycardActions = append(r.keycardActions, keycardAction) -} - -func (r *MessengerResponse) AddKeycardActions(keycardActions []*accounts.KeycardAction) { - r.keycardActions = append(r.keycardActions, keycardActions...) -} - -func (r *MessengerResponse) KeycardActions() []*accounts.KeycardAction { - return r.keycardActions -} - func (r *MessengerResponse) AddEnsUsernameDetail(detail *ensservice.UsernameDetail) { r.ensUsernameDetails = append(r.ensUsernameDetails, detail) } diff --git a/protocol/messenger_sync_keycard_change_test.go b/protocol/messenger_sync_keycard_change_test.go index fcce09480..9b558d85b 100644 --- a/protocol/messenger_sync_keycard_change_test.go +++ b/protocol/messenger_sync_keycard_change_test.go @@ -79,6 +79,9 @@ func (s *MessengerSyncKeycardChangeSuite) SetupTest() { kp1 := accounts.GetProfileKeypairForTest(true, true, true) kp2 := accounts.GetSeedImportedKeypair1ForTest() // kp3 := accounts.GetSeedImportedKeypair2ForTest() + kp1.Clock = 1 + kp2.Clock = 1 + // kp3.Clock = 1 err = s.main.settings.SaveOrUpdateKeypair(kp1) s.Require().NoError(err) @@ -90,11 +93,15 @@ func (s *MessengerSyncKeycardChangeSuite) SetupTest() { s.Require().NoError(err) s.Require().Equal(2, len(dbKeypairs)) - err = s.other.SaveOrUpdateKeypair(kp1) + kp1.Clock = 0 + kp2.Clock = 0 + // kp3.Clock = 0 + + err = s.other.settings.SaveOrUpdateKeypair(kp1) s.Require().NoError(err) - err = s.other.SaveOrUpdateKeypair(kp2) + err = s.other.settings.SaveOrUpdateKeypair(kp2) s.Require().NoError(err) - // err = s.other.SaveOrUpdateKeypair(kp3) + // err = s.other.settings.SaveOrUpdateKeypair(kp3) // s.Require().NoError(err) dbKeypairs, err = s.other.settings.GetKeypairs() s.Require().NoError(err) @@ -124,19 +131,16 @@ func (s *MessengerSyncKeycardChangeSuite) TestAddingNewKeycards() { keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() - added, err := s.main.AddKeycardOrAddAccountsIfKeycardIsAdded(context.Background(), keycard1) + err := s.main.SaveOrUpdateKeycard(context.Background(), keycard1) s.Require().NoError(err) - s.Require().Equal(true, added) - - added, err = s.main.AddKeycardOrAddAccountsIfKeycardIsAdded(context.Background(), keycard2) + err = s.main.SaveOrUpdateKeycard(context.Background(), keycard2) s.Require().NoError(err) - s.Require().Equal(true, added) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 2 + return len(r.Keypairs) == 2 }, "expected to receive keycard activities", ) @@ -145,14 +149,14 @@ func (s *MessengerSyncKeycardChangeSuite) TestAddingNewKeycards() { senderKeycards, err := s.main.settings.GetAllKnownKeycards() s.Require().NoError(err) s.Require().Equal(2, len(senderKeycards)) - s.Require().True(contains(senderKeycards, keycard1, accounts.SameKeycards)) - s.Require().True(contains(senderKeycards, keycard2, accounts.SameKeycards)) + s.Require().True(accounts.Contains(senderKeycards, keycard1, accounts.SameKeycards)) + s.Require().True(accounts.Contains(senderKeycards, keycard2, accounts.SameKeycards)) syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() s.Require().NoError(err) s.Require().Equal(2, len(syncedKeycards)) - s.Require().True(contains(syncedKeycards, keycard1, accounts.SameKeycards)) - s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard1, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2, accounts.SameKeycards)) } func (s *MessengerSyncKeycardChangeSuite) TestAddingAccountsToKeycard() { @@ -164,27 +168,22 @@ func (s *MessengerSyncKeycardChangeSuite) TestAddingAccountsToKeycard() { keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add additional accounts to sender - added, err := s.main.AddKeycardOrAddAccountsIfKeycardIsAdded(context.Background(), keycard2) + err = s.main.SaveOrUpdateKeycard(context.Background(), keycard2) s.Require().NoError(err) - s.Require().Equal(true, added) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) @@ -210,31 +209,26 @@ func (s *MessengerSyncKeycardChangeSuite) TestRemovingAccountsFromKeycard() { keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Prepare expected keycard for comparison updatedKeycard1 := accounts.GetProfileKeycardForTest() updatedKeycard1.AccountsAddresses = updatedKeycard1.AccountsAddresses[2:] // Remove accounts from sender - err = s.main.RemoveMigratedAccountsForKeycard(context.Background(), keycard1.KeycardUID, - keycard1.AccountsAddresses[:2], updatedKeycard1.LastUpdateClock) + err = s.main.DeleteKeycardAccounts(context.Background(), keycard1.KeycardUID, keycard1.AccountsAddresses[:2]) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) @@ -251,44 +245,39 @@ func (s *MessengerSyncKeycardChangeSuite) TestRemovingAccountsFromKeycard() { s.Require().True(contains(syncedKeycards, updatedKeycard1, accounts.SameKeycards)) } -func (s *MessengerSyncKeycardChangeSuite) TestRemovingAllAccountsFromKeycard() { +func (s *MessengerSyncKeycardChangeSuite) TestRemovingAllAccountsForKeyUID() { senderDb := s.main.settings dbOnReceiver := s.other.settings keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - // Remove all accounts from sender - err = s.main.RemoveMigratedAccountsForKeycard(context.Background(), keycard1.KeycardUID, - keycard1.AccountsAddresses, keycard1.LastUpdateClock) + // Remove all accounts from sender for KeyUID + err = s.main.DeleteAllKeycardsWithKeyUID(context.Background(), keycard1.KeyUID) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() + senderKeycards, err := senderDb.GetKeycardsWithSameKeyUID(keycard1.KeyUID) s.Require().NoError(err) s.Require().Equal(0, len(senderKeycards)) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + syncedKeycards, err := dbOnReceiver.GetKeycardsWithSameKeyUID(keycard1.KeyUID) s.Require().NoError(err) s.Require().Equal(0, len(syncedKeycards)) } @@ -300,38 +289,36 @@ func (s *MessengerSyncKeycardChangeSuite) TestDeleteKeycard() { keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Remove keycard from sender - err = s.main.DeleteKeycard(context.Background(), keycard1.KeycardUID, keycard1.LastUpdateClock) + err = s.main.DeleteKeycard(context.Background(), keycard1.KeycardUID) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(0, len(senderKeycards)) + senderKeycard, err := senderDb.GetKeycardByKeycardUID(keycard1.KeycardUID) + s.Require().Error(err) + s.Require().True(err == accounts.ErrNoKeycardForPassedKeycardUID) + s.Require().Nil(senderKeycard) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(0, len(syncedKeycards)) + syncedKeycard, err := dbOnReceiver.GetKeycardByKeycardUID(keycard1.KeycardUID) + s.Require().Error(err) + s.Require().True(err == accounts.ErrNoKeycardForPassedKeycardUID) + s.Require().Nil(syncedKeycard) } func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardName() { @@ -341,94 +328,38 @@ func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardName() { keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Prepare expected keycard for comparison updatedKeycard1 := accounts.GetProfileKeycardForTest() updatedKeycard1.KeycardName = "New Keycard Name" // Set new keycard name to sender - err = s.main.SetKeycardName(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.KeycardName, - updatedKeycard1.LastUpdateClock) + err = s.main.SetKeycardName(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.KeycardName) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() + senderKeycard, err := senderDb.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycard)) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + syncedKeycard, err := dbOnReceiver.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycards[0])) -} - -func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardNameWithOlderClock() { - senderDb := s.main.settings - dbOnReceiver := s.other.settings - - keycard1 := accounts.GetProfileKeycardForTest() - - // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Prepare expected keycard for comparison - updatedKeycard1 := accounts.GetProfileKeycardForTest() - updatedKeycard1.KeycardName = "New Keycard Name" - updatedKeycard1.LastUpdateClock = updatedKeycard1.LastUpdateClock - 1 - - // Set new keycard name to sender - err = s.main.SetKeycardName(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.KeycardName, - updatedKeycard1.LastUpdateClock) - s.Require().NoError(err) - - // Wait for the response - _, err = WaitOnMessengerResponse( - s.other, - func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 - }, - "expected to receive keycard activities", - ) - s.Require().NoError(err) - - senderKeycards, err := senderDb.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, senderKeycards[0])) - - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, syncedKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycard)) } func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardLocked() { @@ -438,90 +369,37 @@ func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardLocked() { keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Prepare expected keycard for comparison updatedKeycard1 := accounts.GetProfileKeycardForTest() updatedKeycard1.KeycardLocked = true - err = s.main.KeycardLocked(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.LastUpdateClock) + err = s.main.KeycardLocked(context.Background(), updatedKeycard1.KeycardUID) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() + senderKeycard, err := senderDb.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycard)) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + syncedKeycard, err := dbOnReceiver.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycards[0])) -} - -func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardLockedOlderClock() { - senderDb := s.main.settings - dbOnReceiver := s.other.settings - - keycard1 := accounts.GetProfileKeycardForTest() - - // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Prepare expected keycard for comparison - updatedKeycard1 := accounts.GetProfileKeycardForTest() - updatedKeycard1.KeycardLocked = true - updatedKeycard1.LastUpdateClock = updatedKeycard1.LastUpdateClock - 1 - - err = s.main.KeycardLocked(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.LastUpdateClock) - s.Require().NoError(err) - - // Wait for the response - _, err = WaitOnMessengerResponse( - s.other, - func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 - }, - "expected to receive keycard activities", - ) - s.Require().NoError(err) - - senderKeycards, err := senderDb.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, senderKeycards[0])) - - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, syncedKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycard)) } func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardUnlocked() { @@ -532,91 +410,37 @@ func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardUnlocked() { keycard1.KeycardLocked = true // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Prepare expected keycard for comparison updatedKeycard1 := accounts.GetProfileKeycardForTest() updatedKeycard1.KeycardLocked = false - err = s.main.KeycardUnlocked(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.LastUpdateClock) + err = s.main.KeycardUnlocked(context.Background(), updatedKeycard1.KeycardUID) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() + senderKeycard, err := senderDb.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycard)) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + syncedKeycard, err := dbOnReceiver.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycards[0])) -} - -func (s *MessengerSyncKeycardChangeSuite) TestSettingKeycardUnlockedOlderClock() { - senderDb := s.main.settings - dbOnReceiver := s.other.settings - - keycard1 := accounts.GetProfileKeycardForTest() - keycard1.KeycardLocked = true - - // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Prepare expected keycard for comparison - updatedKeycard1 := accounts.GetProfileKeycardForTest() - updatedKeycard1.KeycardLocked = false - updatedKeycard1.LastUpdateClock = updatedKeycard1.LastUpdateClock - 1 - - err = s.main.KeycardUnlocked(context.Background(), updatedKeycard1.KeycardUID, updatedKeycard1.LastUpdateClock) - s.Require().NoError(err) - - // Wait for the response - _, err = WaitOnMessengerResponse( - s.other, - func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 - }, - "expected to receive keycard activities", - ) - s.Require().NoError(err) - - senderKeycards, err := senderDb.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, senderKeycards[0])) - - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, syncedKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycard)) } func (s *MessengerSyncKeycardChangeSuite) TestUpdatingKeycardUid() { @@ -626,92 +450,36 @@ func (s *MessengerSyncKeycardChangeSuite) TestUpdatingKeycardUid() { keycard1 := accounts.GetProfileKeycardForTest() // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) // Prepare expected keycard for comparison updatedKeycard1 := accounts.GetProfileKeycardForTest() updatedKeycard1.KeycardUID = "00000000000000000000000000000000" // Update keycard uid on sender - err = s.main.UpdateKeycardUID(context.Background(), keycard1.KeycardUID, updatedKeycard1.KeycardUID, - updatedKeycard1.LastUpdateClock) + err = s.main.UpdateKeycardUID(context.Background(), keycard1.KeycardUID, updatedKeycard1.KeycardUID) s.Require().NoError(err) // Wait for the response _, err = WaitOnMessengerResponse( s.other, func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 + return len(r.Keypairs) == 1 }, "expected to receive keycard activities", ) s.Require().NoError(err) - senderKeycards, err := senderDb.GetAllKnownKeycards() + senderKeycard, err := senderDb.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, senderKeycard)) - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + syncedKeycard, err := dbOnReceiver.GetKeycardByKeycardUID(updatedKeycard1.KeycardUID) s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycards[0])) -} - -func (s *MessengerSyncKeycardChangeSuite) TestUpdatingKeycardUidOldClock() { - senderDb := s.main.settings - dbOnReceiver := s.other.settings - - keycard1 := accounts.GetProfileKeycardForTest() - - // Add keycard on sender - addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Add the same keycard on receiver - addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) - s.Require().NoError(err) - s.Require().Equal(true, addedKc) - s.Require().Equal(false, addedAccs) - - // Prepare expected keycard for comparison - updatedKeycard1 := accounts.GetProfileKeycardForTest() - updatedKeycard1.KeycardUID = "00000000000000000000000000000000" - updatedKeycard1.LastUpdateClock = updatedKeycard1.LastUpdateClock - 1 - - // Update keycard uid on sender - err = s.main.UpdateKeycardUID(context.Background(), keycard1.KeycardUID, updatedKeycard1.KeycardUID, - updatedKeycard1.LastUpdateClock) - s.Require().NoError(err) - - // Wait for the response - _, err = WaitOnMessengerResponse( - s.other, - func(r *MessengerResponse) bool { - return len(r.KeycardActions()) == 1 - }, - "expected to receive keycard activities", - ) - s.Require().NoError(err) - - senderKeycards, err := senderDb.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(senderKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, senderKeycards[0])) - - syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() - s.Require().NoError(err) - s.Require().Equal(1, len(syncedKeycards)) - s.Require().True(accounts.SameKeycards(keycard1, syncedKeycards[0])) + s.Require().True(accounts.SameKeycards(updatedKeycard1, syncedKeycard)) } diff --git a/protocol/messenger_sync_keycards_state_test.go b/protocol/messenger_sync_keycards_state_test.go index ac01b20d6..b98ac1461 100644 --- a/protocol/messenger_sync_keycards_state_test.go +++ b/protocol/messenger_sync_keycards_state_test.go @@ -79,6 +79,9 @@ func (s *MessengerSyncKeycardsStateSuite) SetupTest() { kp1 := accounts.GetProfileKeypairForTest(true, true, true) kp2 := accounts.GetSeedImportedKeypair1ForTest() kp3 := accounts.GetSeedImportedKeypair2ForTest() + kp1.Clock = 1 + kp2.Clock = 1 + kp3.Clock = 1 err = s.main.settings.SaveOrUpdateKeypair(kp1) s.Require().NoError(err) @@ -90,11 +93,15 @@ func (s *MessengerSyncKeycardsStateSuite) SetupTest() { s.Require().NoError(err) s.Require().Equal(3, len(dbKeypairs)) - err = s.other.SaveOrUpdateKeypair(kp1) + kp1.Clock = 0 + kp2.Clock = 0 + kp3.Clock = 0 + + err = s.other.settings.SaveOrUpdateKeypair(kp1) s.Require().NoError(err) - err = s.other.SaveOrUpdateKeypair(kp2) + err = s.other.settings.SaveOrUpdateKeypair(kp2) s.Require().NoError(err) - err = s.other.SaveOrUpdateKeypair(kp3) + err = s.other.settings.SaveOrUpdateKeypair(kp3) s.Require().NoError(err) dbKeypairs, err = s.other.settings.GetKeypairs() s.Require().NoError(err) @@ -116,338 +123,173 @@ func (s *MessengerSyncKeycardsStateSuite) newMessenger(shh types.Waku) *Messenge return messenger } -// TODO: commented tests below will be handled in the seocnd step of planned improvements +func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverHasNoKeycards() { + senderDb := s.main.settings + dbOnReceiver := s.other.settings -// func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverHasNoKeycards() { -// senderDb := s.main.settings -// dbOnReceiver := s.other.settings + keycard1 := accounts.GetProfileKeycardForTest() -// keycard1 := accounts.GetProfileKeycardForTest() + keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" + keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" -// keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// keycard2Copy.LastUpdateClock = keycard2Copy.LastUpdateClock + 1 + keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() -// keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() + // Add keycards on sender + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) + s.Require().NoError(err) + err = senderDb.SaveOrUpdateKeycard(*keycard2, 0, false) + s.Require().NoError(err) + err = senderDb.SaveOrUpdateKeycard(*keycard2Copy, 0, false) + s.Require().NoError(err) + err = senderDb.SaveOrUpdateKeycard(*keycard3, 0, false) + s.Require().NoError(err) -// // Add keycards on sender -// addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2Copy) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard3) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) + // Trigger's a sync between devices + err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) + s.Require().NoError(err) -// // Trigger's a sync between devices -// err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) -// s.Require().NoError(err) + // Wait for the response + _, err = WaitOnMessengerResponse( + s.other, + func(r *MessengerResponse) bool { + success := len(r.Keypairs) == 3 + for _, kp := range r.Keypairs { + if kp.KeyUID == keycard1.KeyUID { + success = success && len(kp.Keycards) == 1 + } else if kp.KeyUID == keycard2.KeyUID { + success = success && len(kp.Keycards) == 2 + } else if kp.KeyUID == keycard3.KeyUID { + success = success && len(kp.Keycards) == 1 + } + } + return success + }, + "expected to receive keycards", + ) + s.Require().NoError(err) -// // Wait for the response -// _, err = WaitOnMessengerResponse( -// s.other, -// func(r *MessengerResponse) bool { -// success := len(r.Keypairs) == 3 -// for _, kp := range r.Keypairs { -// if kp.KeyUID == keycard1.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } else if kp.KeyUID == keycard2.KeyUID { -// success = success && len(kp.Keycards) == 2 -// } else if kp.KeyUID == keycard3.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } -// } -// return success -// }, -// "expected to receive keycards", -// ) -// s.Require().NoError(err) + syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + s.Require().NoError(err) + s.Require().Equal(4, len(syncedKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard1, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard3, accounts.SameKeycards)) +} -// syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() -// s.Require().NoError(err) -// s.Require().Equal(4, len(syncedKeycards)) -// s.Require().True(contains(syncedKeycards, keycard1, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard3, accounts.SameKeycards)) -// } +func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfKeycardsWereDeletedOnSenderSide() { + senderDb := s.main.settings + dbOnReceiver := s.other.settings -// func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverHasKeycardsOlderThanSender() { -// senderDb := s.main.settings -// dbOnReceiver := s.other.settings + // Add keycards on sender + keycard1 := accounts.GetProfileKeycardForTest() -// keycard1 := accounts.GetProfileKeycardForTest() + keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" + keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// // Add keycards on sender -// addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) + keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() -// // Add keycards on receiver - partially -// keycardR1 := accounts.GetProfileKeycardForTest() -// keycardR1.KeycardName = "CardNameToBeChanged-0" -// keycardR1.AccountsAddresses = keycardR1.AccountsAddresses[2:3] -// keycardR1.LastUpdateClock = keycardR1.LastUpdateClock - 1 + // Add keycards on sender + err := senderDb.SaveOrUpdateKeycard(*keycard1, 0, false) + s.Require().NoError(err) + err = senderDb.SaveOrUpdateKeycard(*keycard2, 0, false) + s.Require().NoError(err) -// keycardR2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycardR2.KeycardName = "CardNameToBeChanged-1" -// keycardR2.LastUpdateClock = keycardR2.LastUpdateClock - 1 + // Add keycards on receiver + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) + s.Require().NoError(err) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard2, 0, false) + s.Require().NoError(err) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard2Copy, 0, false) + s.Require().NoError(err) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard3, 0, false) + s.Require().NoError(err) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycardR1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycardR2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) + // Trigger's a sync between devices + err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) + s.Require().NoError(err) -// // Trigger's a sync between devices -// err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) -// s.Require().NoError(err) + // Wait for the response + _, err = WaitOnMessengerResponse( + s.other, + func(r *MessengerResponse) bool { + success := len(r.Keypairs) == 3 + for _, kp := range r.Keypairs { + if kp.KeyUID == keycard1.KeyUID { + success = success && len(kp.Keycards) == 1 + } else if kp.KeyUID == keycard2.KeyUID { + success = success && len(kp.Keycards) == 1 + } + } + return success + }, + "expected to receive keycards", + ) + s.Require().NoError(err) -// // Wait for the response -// _, err = WaitOnMessengerResponse( -// s.other, -// func(r *MessengerResponse) bool { -// success := len(r.Keypairs) == 3 -// for _, kp := range r.Keypairs { -// if kp.KeyUID == keycardR1.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } else if kp.KeyUID == keycardR2.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } -// } -// return success -// }, -// "expected to receive keycards", -// ) -// s.Require().NoError(err) + syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + s.Require().NoError(err) + s.Require().Equal(2, len(syncedKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard1, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2, accounts.SameKeycards)) +} -// syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() -// s.Require().NoError(err) -// s.Require().Equal(2, len(syncedKeycards)) -// s.Require().True(contains(syncedKeycards, keycard1, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) -// } +func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverAndSenderHasNoKeycardsInCommon() { + senderDb := s.main.settings + dbOnReceiver := s.other.settings -// func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverHasKeycardsNewerThanSender() { -// senderDb := s.main.settings -// dbOnReceiver := s.other.settings + // Add keycards on sender + keycard1 := accounts.GetProfileKeycardForTest() -// keycard1 := accounts.GetProfileKeycardForTest() + keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() + keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" + keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// // Add keycards on sender -// addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) + keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() -// // Add keycards on receiver - partially -// keycardR1 := accounts.GetProfileKeycardForTest() -// keycardR1.KeycardName = "CardNameToBeChanged-0" -// keycardR1.AccountsAddresses = keycardR1.AccountsAddresses[2:3] -// keycardR1.LastUpdateClock = keycardR1.LastUpdateClock + 1 + // Add keycards on sender + err := senderDb.SaveOrUpdateKeycard(*keycard2, 0, false) + s.Require().NoError(err) + err = senderDb.SaveOrUpdateKeycard(*keycard2Copy, 0, false) + s.Require().NoError(err) -// keycardR2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycardR2.KeycardName = "CardNameToBeChanged-1" -// keycardR2.LastUpdateClock = keycardR2.LastUpdateClock + 1 + // Add keycards on receiver + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard1, 0, false) + s.Require().NoError(err) + err = dbOnReceiver.SaveOrUpdateKeycard(*keycard3, 0, false) + s.Require().NoError(err) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycardR1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycardR2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) + // Trigger's a sync between devices + err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) + s.Require().NoError(err) -// // Trigger's a sync between devices -// err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) -// s.Require().NoError(err) + // Wait for the response + _, err = WaitOnMessengerResponse( + s.other, + func(r *MessengerResponse) bool { + success := len(r.Keypairs) == 3 + for _, kp := range r.Keypairs { + if kp.KeyUID == keycard2.KeyUID { + success = success && len(kp.Keycards) == 2 + } + } + return success + }, + "expected to receive keycards", + ) + s.Require().NoError(err) -// // Wait for the response -// _, err = WaitOnMessengerResponse( -// s.other, -// func(r *MessengerResponse) bool { -// success := len(r.Keypairs) == 3 -// for _, kp := range r.Keypairs { -// if kp.KeyUID == keycardR1.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } else if kp.KeyUID == keycardR2.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } -// } -// return success -// }, -// "expected to receive keycards", -// ) -// s.Require().NoError(err) - -// syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() -// s.Require().NoError(err) -// s.Require().Equal(2, len(syncedKeycards)) -// s.Require().True(contains(syncedKeycards, keycardR1, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycardR2, accounts.SameKeycards)) -// } - -// func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfKeycardsWereDeletedOnSenderSide() { -// senderDb := s.main.settings -// dbOnReceiver := s.other.settings - -// // Add keycards on sender -// keycard1 := accounts.GetProfileKeycardForTest() - -// keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() - -// keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" -// keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// keycard2Copy.LastUpdateClock = keycard2Copy.LastUpdateClock + 1 - -// keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() - -// // Add keycards on sender -// addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) - -// // Add keycards on receiver -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2Copy) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard3) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) - -// // Trigger's a sync between devices -// err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) -// s.Require().NoError(err) - -// // Wait for the response -// _, err = WaitOnMessengerResponse( -// s.other, -// func(r *MessengerResponse) bool { -// success := len(r.Keypairs) == 3 -// for _, kp := range r.Keypairs { -// if kp.KeyUID == keycard1.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } else if kp.KeyUID == keycard2.KeyUID { -// success = success && len(kp.Keycards) == 1 -// } -// } -// return success -// }, -// "expected to receive keycards", -// ) -// s.Require().NoError(err) - -// syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() -// s.Require().NoError(err) -// s.Require().Equal(2, len(syncedKeycards)) -// s.Require().True(contains(syncedKeycards, keycard1, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) -// } - -// func (s *MessengerSyncKeycardsStateSuite) TestSyncKeycardsIfReceiverAndSenderHasNoKeycardsInCommon() { -// senderDb := s.main.settings -// dbOnReceiver := s.other.settings - -// // Add keycards on sender -// keycard1 := accounts.GetProfileKeycardForTest() - -// keycard2 := accounts.GetKeycardForSeedImportedKeypair1ForTest() - -// keycard2Copy := accounts.GetKeycardForSeedImportedKeypair1ForTest() -// keycard2Copy.KeycardUID = keycard2Copy.KeycardUID + "C" -// keycard2Copy.KeycardName = keycard2Copy.KeycardName + "Copy" -// keycard2Copy.LastUpdateClock = keycard2Copy.LastUpdateClock + 1 - -// keycard3 := accounts.GetKeycardForSeedImportedKeypair2ForTest() - -// // Add keycards on sender -// addedKc, addedAccs, err := senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = senderDb.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard2Copy) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) - -// // Add keycards on receiver -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard1) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) -// addedKc, addedAccs, err = dbOnReceiver.AddKeycardOrAddAccountsIfKeycardIsAdded(*keycard3) -// s.Require().NoError(err) -// s.Require().Equal(true, addedKc) -// s.Require().Equal(false, addedAccs) - -// // Trigger's a sync between devices -// err = s.main.SyncDevices(context.Background(), "ens-name", "profile-image", nil) -// s.Require().NoError(err) - -// // Wait for the response -// _, err = WaitOnMessengerResponse( -// s.other, -// func(r *MessengerResponse) bool { -// success := len(r.Keypairs) == 3 -// for _, kp := range r.Keypairs { -// if kp.KeyUID == keycard2.KeyUID { -// success = success && len(kp.Keycards) == 2 -// } -// } -// return success -// }, -// "expected to receive keycards", -// ) -// s.Require().NoError(err) - -// syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() -// s.Require().NoError(err) -// s.Require().Equal(2, len(syncedKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2, accounts.SameKeycards)) -// s.Require().True(contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) -// } + syncedKeycards, err := dbOnReceiver.GetAllKnownKeycards() + s.Require().NoError(err) + s.Require().Equal(2, len(syncedKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2, accounts.SameKeycards)) + s.Require().True(accounts.Contains(syncedKeycards, keycard2Copy, accounts.SameKeycards)) +} diff --git a/protocol/messenger_wallet.go b/protocol/messenger_wallet.go index 875b9ac86..4368018c5 100644 --- a/protocol/messenger_wallet.go +++ b/protocol/messenger_wallet.go @@ -198,7 +198,7 @@ func (m *Messenger) deleteKeystoreFileForAddress(address types.Address) error { lastAcccountOfKeypairWithTheSameKey := len(kp.Accounts) == 1 - knownKeycardsForKeyUID, err := m.settings.GetKeycardByKeyUID(acc.KeyUID) + knownKeycardsForKeyUID, err := m.settings.GetKeycardsWithSameKeyUID(acc.KeyUID) if err != nil { return err } @@ -219,23 +219,6 @@ func (m *Messenger) deleteKeystoreFileForAddress(address types.Address) error { } } } - } else { - if lastAcccountOfKeypairWithTheSameKey { - knownKeycards, err := m.settings.GetAllKnownKeycards() - if err != nil { - return err - } - - for _, kc := range knownKeycards { - if kc.KeyUID == acc.KeyUID { - clock := uint64(time.Now().Unix()) - err = m.RemoveMigratedAccountsForKeycard(context.Background(), kc.KeycardUID, kc.AccountsAddresses, clock) - if err != nil { - return err - } - } - } - } } } diff --git a/protocol/protobuf/application_metadata_message.pb.go b/protocol/protobuf/application_metadata_message.pb.go index 1e62d08c3..7e2e19f14 100644 --- a/protocol/protobuf/application_metadata_message.pb.go +++ b/protocol/protobuf/application_metadata_message.pb.go @@ -85,13 +85,12 @@ const ( ApplicationMetadataMessage_COMMUNITY_CANCEL_REQUEST_TO_JOIN ApplicationMetadataMessage_Type = 60 ApplicationMetadataMessage_CANCEL_CONTACT_VERIFICATION ApplicationMetadataMessage_Type = 61 ApplicationMetadataMessage_SYNC_KEYPAIR ApplicationMetadataMessage_Type = 62 - ApplicationMetadataMessage_SYNC_KEYCARD_ACTION ApplicationMetadataMessage_Type = 63 - ApplicationMetadataMessage_SYNC_SOCIAL_LINKS ApplicationMetadataMessage_Type = 64 - ApplicationMetadataMessage_SYNC_ENS_USERNAME_DETAIL ApplicationMetadataMessage_Type = 65 - ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION ApplicationMetadataMessage_Type = 66 - ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE ApplicationMetadataMessage_Type = 67 - ApplicationMetadataMessage_COMMUNITY_ADMIN_MESSAGE ApplicationMetadataMessage_Type = 68 - ApplicationMetadataMessage_COMMUNITY_EDIT_SHARED_ADDRESSES ApplicationMetadataMessage_Type = 69 + ApplicationMetadataMessage_SYNC_SOCIAL_LINKS ApplicationMetadataMessage_Type = 63 + ApplicationMetadataMessage_SYNC_ENS_USERNAME_DETAIL ApplicationMetadataMessage_Type = 64 + ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION ApplicationMetadataMessage_Type = 65 + ApplicationMetadataMessage_SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE ApplicationMetadataMessage_Type = 66 + ApplicationMetadataMessage_COMMUNITY_ADMIN_MESSAGE ApplicationMetadataMessage_Type = 67 + ApplicationMetadataMessage_COMMUNITY_EDIT_SHARED_ADDRESSES ApplicationMetadataMessage_Type = 68 ) var ApplicationMetadataMessage_Type_name = map[int32]string{ @@ -157,13 +156,12 @@ var ApplicationMetadataMessage_Type_name = map[int32]string{ 60: "COMMUNITY_CANCEL_REQUEST_TO_JOIN", 61: "CANCEL_CONTACT_VERIFICATION", 62: "SYNC_KEYPAIR", - 63: "SYNC_KEYCARD_ACTION", - 64: "SYNC_SOCIAL_LINKS", - 65: "SYNC_ENS_USERNAME_DETAIL", - 66: "SYNC_ACTIVITY_CENTER_NOTIFICATION", - 67: "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE", - 68: "COMMUNITY_ADMIN_MESSAGE", - 69: "COMMUNITY_EDIT_SHARED_ADDRESSES", + 63: "SYNC_SOCIAL_LINKS", + 64: "SYNC_ENS_USERNAME_DETAIL", + 65: "SYNC_ACTIVITY_CENTER_NOTIFICATION", + 66: "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE", + 67: "COMMUNITY_ADMIN_MESSAGE", + 68: "COMMUNITY_EDIT_SHARED_ADDRESSES", } var ApplicationMetadataMessage_Type_value = map[string]int32{ @@ -229,13 +227,12 @@ var ApplicationMetadataMessage_Type_value = map[string]int32{ "COMMUNITY_CANCEL_REQUEST_TO_JOIN": 60, "CANCEL_CONTACT_VERIFICATION": 61, "SYNC_KEYPAIR": 62, - "SYNC_KEYCARD_ACTION": 63, - "SYNC_SOCIAL_LINKS": 64, - "SYNC_ENS_USERNAME_DETAIL": 65, - "SYNC_ACTIVITY_CENTER_NOTIFICATION": 66, - "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE": 67, - "COMMUNITY_ADMIN_MESSAGE": 68, - "COMMUNITY_EDIT_SHARED_ADDRESSES": 69, + "SYNC_SOCIAL_LINKS": 63, + "SYNC_ENS_USERNAME_DETAIL": 64, + "SYNC_ACTIVITY_CENTER_NOTIFICATION": 65, + "SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE": 66, + "COMMUNITY_ADMIN_MESSAGE": 67, + "COMMUNITY_EDIT_SHARED_ADDRESSES": 68, } func (x ApplicationMetadataMessage_Type) String() string { @@ -314,67 +311,67 @@ func init() { } var fileDescriptor_ad09a6406fcf24c7 = []byte{ - // 990 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0x6b, 0x73, 0x53, 0x37, - 0x10, 0x6d, 0x80, 0x26, 0xa0, 0xbc, 0x36, 0x22, 0x0f, 0xe7, 0x9d, 0x18, 0x08, 0x01, 0x5a, 0xd3, - 0x42, 0xdb, 0x69, 0x4b, 0x69, 0x2b, 0x4b, 0x1b, 0x5b, 0xf8, 0x5e, 0xdd, 0x8b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0x98, 0xa2, 0x94, 0x2c, 0xf0, 0x48, 0x59, 0xc6, 0xad, 0x4b, 0x62, 0xc1, 0x2c, 0xc2, 0x0d, - 0xba, 0x4d, 0xd6, 0x43, 0x0c, 0x9b, 0xa8, 0x4d, 0x5b, 0xc6, 0x79, 0xb8, 0x3c, 0x72, 0x93, 0xae, - 0x90, 0xa5, 0x98, 0x49, 0xed, 0xa4, 0x32, 0x96, 0x05, 0x01, 0xb3, 0x32, 0x52, 0x70, 0xcb, 0x87, - 0x4d, 0x4f, 0xf1, 0xf3, 0xe1, 0x2f, 0xe9, 0x3d, 0xb2, 0xab, 0xf1, 0x75, 0x82, 0xc6, 0x3a, 0x26, - 0x84, 0x46, 0x63, 0xdc, 0x51, 0xa4, 0x9d, 0xd5, 0x4c, 0x19, 0xc6, 0x53, 0xd0, 0x34, 0x7d, 0x4c, - 0x0e, 0x18, 0xe7, 0x18, 0x5b, 0x77, 0x1d, 0x76, 0x86, 0x3e, 0x21, 0x0f, 0x05, 0xf2, 0x40, 0x2a, - 0xbc, 0x16, 0x7c, 0x9b, 0xae, 0x91, 0xbb, 0x05, 0x68, 0x3c, 0x71, 0x87, 0x2e, 0x13, 0x30, 0xa8, - 0xc4, 0xb9, 0x28, 0xa1, 0xbb, 0x64, 0xf3, 0x62, 0xed, 0x71, 0xc0, 0xac, 0xa7, 0xe6, 0x52, 0x93, - 0x2e, 0x27, 0x10, 0xe6, 0x26, 0xa7, 0x19, 0xe7, 0x51, 0xa2, 0x2c, 0xcc, 0xd3, 0x7d, 0xb2, 0x7d, - 0x39, 0x1d, 0x27, 0xcd, 0x40, 0x72, 0xe7, 0xe7, 0x02, 0x0b, 0x74, 0x87, 0x6c, 0x14, 0xf3, 0xe0, - 0x91, 0x40, 0xc7, 0x44, 0x17, 0xb5, 0x95, 0x06, 0x43, 0x54, 0x16, 0x16, 0x69, 0x9d, 0xec, 0xc4, - 0x89, 0x69, 0x3b, 0x15, 0x59, 0x79, 0x24, 0x79, 0x56, 0x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0x15, 0x75, 0x68, - 0x00, 0x9b, 0xf3, 0x7f, 0xce, 0x36, 0x9e, 0xbe, 0x28, 0x3e, 0xff, 0x6f, 0xa6, 0xd3, 0xff, 0x9e, - 0xff, 0x17, 0x00, 0x00, 0xff, 0xff, 0xcd, 0xaa, 0x54, 0xe4, 0xa5, 0x08, 0x00, 0x00, + // 982 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x55, 0x6d, 0x73, 0x13, 0x37, + 0x10, 0x6e, 0x80, 0xf2, 0xa2, 0xbc, 0x6d, 0x44, 0x5e, 0x9c, 0xf7, 0xc4, 0x40, 0x08, 0xd0, 0x9a, + 0x16, 0xda, 0x4e, 0x5b, 0x4a, 0x5b, 0x59, 0xda, 0xc4, 0xc2, 0x77, 0xd2, 0x21, 0xe9, 0xdc, 0x71, + 0xbf, 0x68, 0x4c, 0x71, 0x99, 0xcc, 0x00, 0xf1, 0x10, 0xf3, 0x21, 0x7f, 0xaa, 0xbf, 0xa2, 0x3f, + 0xac, 0xa3, 0x3b, 0xdf, 0x9d, 0x93, 0x38, 0xcd, 0xa7, 0xc4, 0xfb, 0x3c, 0x5a, 0x69, 0x9f, 0x7d, + 0x76, 0x8f, 0xd4, 0x7b, 0x83, 0xc1, 0xfb, 0xa3, 0xbf, 0x7a, 0xc3, 0xa3, 0xe3, 0x8f, 0xfe, 0x43, + 0x7f, 0xd8, 0x7b, 0xdb, 0x1b, 0xf6, 0xfc, 0x87, 0xfe, 0xc9, 0x49, 0xef, 0x5d, 0xbf, 0x31, 0xf8, + 0x74, 0x3c, 0x3c, 0xa6, 0xb7, 0xb3, 0x3f, 0x6f, 0x3e, 0xff, 0x5d, 0xff, 0x17, 0xc8, 0x1a, 0xab, + 0x0e, 0xc4, 0x23, 0x7e, 0x9c, 0xd3, 0xe9, 0x06, 0xb9, 0x73, 0x72, 0xf4, 0xee, 0x63, 0x6f, 0xf8, +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xd9, 0xec, 0x36, 0x76, 0xc3, + 0x07, 0x08, 0x7e, 0x2d, 0x95, 0xb0, 0x9a, 0x4b, 0x16, 0xf9, 0x60, 0x17, 0x0b, 0xbf, 0xd1, 0x0d, + 0x52, 0xcb, 0xc2, 0xa8, 0x6c, 0x26, 0x8e, 0x62, 0x31, 0x7a, 0x81, 0x8e, 0xc9, 0x08, 0x7e, 0xa7, + 0x0f, 0xc8, 0xee, 0x44, 0x43, 0x8f, 0xef, 0x27, 0x60, 0x61, 0x8b, 0x5e, 0x49, 0xf3, 0x61, 0xfe, + 0x11, 0x9a, 0xc1, 0x14, 0x63, 0x1e, 0x16, 0xf1, 0xd8, 0xe6, 0xe0, 0xe1, 0x13, 0x58, 0x81, 0xd9, + 0x0e, 0xb1, 0x2d, 0x66, 0x2a, 0x85, 0xd0, 0x82, 0x68, 0xce, 0xfe, 0x39, 0xdd, 0x78, 0xfa, 0xa2, + 0xf8, 0xca, 0xbf, 0xb9, 0x99, 0xfd, 0xf7, 0xfc, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xdd, 0xad, + 0xe6, 0x80, 0x8c, 0x08, 0x00, 0x00, } diff --git a/protocol/protobuf/application_metadata_message.proto b/protocol/protobuf/application_metadata_message.proto index 34c40979a..4cbcac549 100644 --- a/protocol/protobuf/application_metadata_message.proto +++ b/protocol/protobuf/application_metadata_message.proto @@ -75,12 +75,11 @@ message ApplicationMetadataMessage { COMMUNITY_CANCEL_REQUEST_TO_JOIN = 60; CANCEL_CONTACT_VERIFICATION = 61; SYNC_KEYPAIR = 62; - SYNC_KEYCARD_ACTION = 63; - SYNC_SOCIAL_LINKS = 64; - SYNC_ENS_USERNAME_DETAIL = 65; - SYNC_ACTIVITY_CENTER_NOTIFICATION = 66; - SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE = 67; - COMMUNITY_ADMIN_MESSAGE = 68; - COMMUNITY_EDIT_SHARED_ADDRESSES = 69; + SYNC_SOCIAL_LINKS = 63; + SYNC_ENS_USERNAME_DETAIL = 64; + SYNC_ACTIVITY_CENTER_NOTIFICATION = 65; + SYNC_ACTIVITY_CENTER_NOTIFICATION_STATE = 66; + COMMUNITY_ADMIN_MESSAGE = 67; + COMMUNITY_EDIT_SHARED_ADDRESSES = 68; } } diff --git a/protocol/protobuf/pairing.pb.go b/protocol/protobuf/pairing.pb.go index 1bed497d0..d08f69b6d 100644 --- a/protocol/protobuf/pairing.pb.go +++ b/protocol/protobuf/pairing.pb.go @@ -230,49 +230,6 @@ func (SyncContactRequestDecision_DecisionStatus) EnumDescriptor() ([]byte, []int return fileDescriptor_d61ab7221f0b5518, []int{32, 0} } -type SyncKeycardAction_Action int32 - -const ( - SyncKeycardAction_KEYCARD_ADDED SyncKeycardAction_Action = 0 - SyncKeycardAction_ACCOUNTS_ADDED SyncKeycardAction_Action = 1 - SyncKeycardAction_KEYCARD_DELETED SyncKeycardAction_Action = 2 - SyncKeycardAction_ACCOUNTS_REMOVED SyncKeycardAction_Action = 3 - SyncKeycardAction_LOCKED SyncKeycardAction_Action = 4 - SyncKeycardAction_UNLOCKED SyncKeycardAction_Action = 5 - SyncKeycardAction_UID_UPDATED SyncKeycardAction_Action = 6 - SyncKeycardAction_NAME_CHANGED SyncKeycardAction_Action = 7 -) - -var SyncKeycardAction_Action_name = map[int32]string{ - 0: "KEYCARD_ADDED", - 1: "ACCOUNTS_ADDED", - 2: "KEYCARD_DELETED", - 3: "ACCOUNTS_REMOVED", - 4: "LOCKED", - 5: "UNLOCKED", - 6: "UID_UPDATED", - 7: "NAME_CHANGED", -} - -var SyncKeycardAction_Action_value = map[string]int32{ - "KEYCARD_ADDED": 0, - "ACCOUNTS_ADDED": 1, - "KEYCARD_DELETED": 2, - "ACCOUNTS_REMOVED": 3, - "LOCKED": 4, - "UNLOCKED": 5, - "UID_UPDATED": 6, - "NAME_CHANGED": 7, -} - -func (x SyncKeycardAction_Action) String() string { - return proto.EnumName(SyncKeycardAction_Action_name, int32(x)) -} - -func (SyncKeycardAction_Action) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_d61ab7221f0b5518, []int{37, 0} -} - // `FetchingBackedUpDataDetails` is used to describe how many messages a single backup data structure consists of type FetchingBackedUpDataDetails struct { DataNumber uint32 `protobuf:"varint,1,opt,name=data_number,json=dataNumber,proto3" json:"data_number,omitempty"` @@ -3214,7 +3171,7 @@ type SyncKeycard struct { Locked bool `protobuf:"varint,3,opt,name=locked,proto3" json:"locked,omitempty"` KeyUid string `protobuf:"bytes,4,opt,name=key_uid,json=keyUid,proto3" json:"key_uid,omitempty"` Addresses [][]byte `protobuf:"bytes,5,rep,name=addresses,proto3" json:"addresses,omitempty"` - Clock uint64 `protobuf:"varint,6,opt,name=clock,proto3" json:"clock,omitempty"` + Position uint64 `protobuf:"varint,6,opt,name=position,proto3" json:"position,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -3280,68 +3237,13 @@ func (m *SyncKeycard) GetAddresses() [][]byte { return nil } -func (m *SyncKeycard) GetClock() uint64 { +func (m *SyncKeycard) GetPosition() uint64 { if m != nil { - return m.Clock + return m.Position } return 0 } -type SyncKeycardAction struct { - Action SyncKeycardAction_Action `protobuf:"varint,1,opt,name=action,proto3,enum=protobuf.SyncKeycardAction_Action" json:"action,omitempty"` - OldKeycardUid string `protobuf:"bytes,2,opt,name=oldKeycardUid,proto3" json:"oldKeycardUid,omitempty"` - Keycard *SyncKeycard `protobuf:"bytes,3,opt,name=keycard,proto3" json:"keycard,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SyncKeycardAction) Reset() { *m = SyncKeycardAction{} } -func (m *SyncKeycardAction) String() string { return proto.CompactTextString(m) } -func (*SyncKeycardAction) ProtoMessage() {} -func (*SyncKeycardAction) Descriptor() ([]byte, []int) { - return fileDescriptor_d61ab7221f0b5518, []int{37} -} - -func (m *SyncKeycardAction) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SyncKeycardAction.Unmarshal(m, b) -} -func (m *SyncKeycardAction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SyncKeycardAction.Marshal(b, m, deterministic) -} -func (m *SyncKeycardAction) XXX_Merge(src proto.Message) { - xxx_messageInfo_SyncKeycardAction.Merge(m, src) -} -func (m *SyncKeycardAction) XXX_Size() int { - return xxx_messageInfo_SyncKeycardAction.Size(m) -} -func (m *SyncKeycardAction) XXX_DiscardUnknown() { - xxx_messageInfo_SyncKeycardAction.DiscardUnknown(m) -} - -var xxx_messageInfo_SyncKeycardAction proto.InternalMessageInfo - -func (m *SyncKeycardAction) GetAction() SyncKeycardAction_Action { - if m != nil { - return m.Action - } - return SyncKeycardAction_KEYCARD_ADDED -} - -func (m *SyncKeycardAction) GetOldKeycardUid() string { - if m != nil { - return m.OldKeycardUid - } - return "" -} - -func (m *SyncKeycardAction) GetKeycard() *SyncKeycard { - if m != nil { - return m.Keycard - } - return nil -} - type SyncSocialLinks struct { SocialLinks []*SocialLink `protobuf:"bytes,1,rep,name=social_links,json=socialLinks,proto3" json:"social_links,omitempty"` Clock uint64 `protobuf:"varint,2,opt,name=clock,proto3" json:"clock,omitempty"` @@ -3354,7 +3256,7 @@ func (m *SyncSocialLinks) Reset() { *m = SyncSocialLinks{} } func (m *SyncSocialLinks) String() string { return proto.CompactTextString(m) } func (*SyncSocialLinks) ProtoMessage() {} func (*SyncSocialLinks) Descriptor() ([]byte, []int) { - return fileDescriptor_d61ab7221f0b5518, []int{38} + return fileDescriptor_d61ab7221f0b5518, []int{37} } func (m *SyncSocialLinks) XXX_Unmarshal(b []byte) error { @@ -3396,7 +3298,6 @@ func init() { proto.RegisterEnum("protobuf.SyncTrustedUser_TrustStatus", SyncTrustedUser_TrustStatus_name, SyncTrustedUser_TrustStatus_value) proto.RegisterEnum("protobuf.SyncVerificationRequest_VerificationStatus", SyncVerificationRequest_VerificationStatus_name, SyncVerificationRequest_VerificationStatus_value) proto.RegisterEnum("protobuf.SyncContactRequestDecision_DecisionStatus", SyncContactRequestDecision_DecisionStatus_name, SyncContactRequestDecision_DecisionStatus_value) - proto.RegisterEnum("protobuf.SyncKeycardAction_Action", SyncKeycardAction_Action_name, SyncKeycardAction_Action_value) proto.RegisterType((*FetchingBackedUpDataDetails)(nil), "protobuf.FetchingBackedUpDataDetails") proto.RegisterType((*Backup)(nil), "protobuf.Backup") proto.RegisterType((*MultiAccount)(nil), "protobuf.MultiAccount") @@ -3437,7 +3338,6 @@ func init() { proto.RegisterType((*RawMessage)(nil), "protobuf.RawMessage") proto.RegisterType((*SyncRawMessage)(nil), "protobuf.SyncRawMessage") proto.RegisterType((*SyncKeycard)(nil), "protobuf.SyncKeycard") - proto.RegisterType((*SyncKeycardAction)(nil), "protobuf.SyncKeycardAction") proto.RegisterType((*SyncSocialLinks)(nil), "protobuf.SyncSocialLinks") } @@ -3446,225 +3346,216 @@ func init() { } var fileDescriptor_d61ab7221f0b5518 = []byte{ - // 3517 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3a, 0x4d, 0x73, 0x23, 0x49, - 0x56, 0xa3, 0x0f, 0xeb, 0xe3, 0x49, 0x96, 0xcb, 0x69, 0xcf, 0x58, 0xed, 0xf6, 0x6c, 0x77, 0x57, - 0xef, 0xc4, 0x36, 0xc4, 0xe0, 0x01, 0x0f, 0xb0, 0xec, 0xf4, 0x4c, 0x0c, 0x6a, 0x49, 0xd3, 0xed, - 0x76, 0x5b, 0x36, 0x69, 0x7b, 0x86, 0x25, 0x88, 0x28, 0xd2, 0x55, 0xd9, 0x56, 0xad, 0x4b, 0x55, - 0xa2, 0x32, 0x65, 0xa3, 0x3d, 0x10, 0x40, 0x04, 0x67, 0x22, 0xb8, 0x2c, 0xc7, 0x39, 0x73, 0x24, - 0x82, 0x03, 0x11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 0x49, 0x70, - 0xa4, 0x17, 0x69, 0x42, 0x85, 0x2f, 0x60, 0x3e, 0x13, 0x01, 0x9a, 0x0f, 0x7a, 0x81, 0xfc, 0x66, - 0xd2, 0x01, 0xeb, 0x96, 0x49, 0x77, 0x78, 0x12, 0x06, 0xd3, 0x8e, 0xeb, 0x46, 0x93, 0x50, 0xb6, - 0xd7, 0x97, 0x09, 0x62, 0x16, 0xe9, 0x02, 0x39, 0x71, 0x60, 0x67, 0x1e, 0x97, 0x88, 0xd6, 0x7a, - 0x88, 0x68, 0xab, 0xb8, 0xd8, 0xff, 0x51, 0x86, 0xe6, 0xf1, 0x24, 0x90, 0x7e, 0x72, 0x22, 0x81, - 0x72, 0xc8, 0x46, 0x5c, 0xf9, 0x60, 0x9d, 0xaa, 0x6f, 0xb2, 0x07, 0x75, 0xe9, 0x8f, 0xb8, 0x90, - 0x6c, 0x34, 0x56, 0x9e, 0x58, 0xa2, 0x33, 0x04, 0xae, 0xea, 0x10, 0xe4, 0x46, 0x61, 0xbb, 0xa4, - 0xb6, 0xcd, 0x10, 0xe4, 0x6b, 0x00, 0x37, 0x0a, 0xa2, 0xd8, 0x19, 0x32, 0x31, 0x34, 0xce, 0xf6, - 0x74, 0x26, 0x74, 0xf6, 0xec, 0xfd, 0x2e, 0x12, 0xbe, 0x61, 0x62, 0x48, 0xeb, 0x6e, 0xf2, 0x49, - 0x1e, 0xa1, 0xbf, 0x23, 0x03, 0xdf, 0x53, 0xce, 0x56, 0xa2, 0x55, 0x05, 0x1f, 0x7a, 0xe4, 0x47, - 0xb0, 0x71, 0xcd, 0xa7, 0x2e, 0x8b, 0x3d, 0xc7, 0x84, 0x48, 0xe5, 0x3a, 0x75, 0xa5, 0x09, 0x44, - 0x9f, 0x6a, 0x2c, 0xd9, 0x51, 0x96, 0xe0, 0x4c, 0x7c, 0x4f, 0xf9, 0x43, 0x9d, 0x56, 0xae, 0xf9, - 0xf4, 0xc2, 0xf7, 0xc8, 0x97, 0x50, 0xf1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, 0x22, 0x95, 0x16, 0x44, 0x4a, 0x1e, 0xb6, 0x9c, 0xb7, 0xfe, 0xe4, 0x89, - 0xd6, 0x54, 0xa9, 0x91, 0x80, 0xf6, 0xbf, 0x17, 0x60, 0x67, 0x45, 0x71, 0x70, 0xcf, 0xba, 0xe3, - 0x39, 0xac, 0x9b, 0x0c, 0xe7, 0x28, 0xf7, 0x37, 0x22, 0x35, 0x0d, 0x52, 0xfb, 0xea, 0x23, 0xa8, - 0xf1, 0x50, 0x38, 0x19, 0xc1, 0xaa, 0x3c, 0x14, 0xea, 0x8d, 0x9f, 0x41, 0x33, 0x60, 0x42, 0x3a, - 0x93, 0xb1, 0xc7, 0x24, 0xd7, 0xb1, 0xac, 0x4c, 0x1b, 0x88, 0xbb, 0xd0, 0x28, 0xbc, 0xb3, 0x98, - 0x0a, 0xc9, 0x47, 0x8e, 0x64, 0x57, 0x58, 0x06, 0x94, 0xf0, 0xce, 0x1a, 0x75, 0xce, 0xae, 0x04, - 0xf9, 0x04, 0x5a, 0x01, 0xda, 0x88, 0x13, 0xfa, 0xee, 0xb5, 0x3a, 0x44, 0x87, 0xb3, 0x75, 0x85, - 0x1d, 0x18, 0xa4, 0xfd, 0xe7, 0x15, 0x78, 0xb4, 0xb2, 0x12, 0x22, 0xbf, 0x0e, 0xdb, 0x59, 0x41, - 0x1c, 0xb5, 0x37, 0x98, 0x9a, 0xdb, 0x93, 0x8c, 0x40, 0xef, 0xf4, 0xca, 0xff, 0xe3, 0xa7, 0x40, - 0xdd, 0x32, 0xcf, 0xe3, 0x9e, 0x0a, 0xca, 0x35, 0xaa, 0x01, 0xb4, 0x93, 0x4b, 0x54, 0x32, 0xf7, - 0x54, 0x89, 0x51, 0xa3, 0x09, 0x88, 0xf4, 0xa3, 0x09, 0xca, 0xd4, 0xd0, 0xf4, 0x0a, 0x40, 0xfa, - 0x98, 0x8f, 0xa2, 0x1b, 0xee, 0xa9, 0x8a, 0xa0, 0x46, 0x13, 0x90, 0x3c, 0x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0xf6, 0x43, 0x71, 0x21, 0x78, 0x8c, 0x07, 0xe9, 0x89, 0xe9, 0x0a, 0x51, 0x77, 0xa1, - 0x36, 0x31, 0x74, 0x46, 0xde, 0x14, 0x56, 0x03, 0xcc, 0x21, 0xf3, 0xd5, 0xac, 0x43, 0x17, 0x72, - 0x55, 0x05, 0x1f, 0xe6, 0xfa, 0xca, 0x72, 0x4e, 0x3c, 0xfb, 0xad, 0x2e, 0x97, 0xba, 0x01, 0x67, - 0xf1, 0x1b, 0x5f, 0xc8, 0x28, 0x9e, 0x66, 0x83, 0x67, 0x21, 0x17, 0x3c, 0x3f, 0x06, 0x70, 0x91, - 0x50, 0xdf, 0xc5, 0x04, 0x77, 0x83, 0xe9, 0x48, 0xfb, 0x97, 0x05, 0x20, 0xc8, 0xcc, 0x4c, 0xfc, - 0x4f, 0x7d, 0x57, 0x4e, 0x62, 0xbe, 0x74, 0x32, 0x95, 0x19, 0x1f, 0x16, 0x57, 0x8c, 0x0f, 0x4b, - 0x6a, 0xb0, 0xb2, 0x30, 0x3e, 0x2c, 0x2b, 0x74, 0x32, 0x3e, 0x7c, 0x0c, 0x75, 0xd5, 0x49, 0xa9, - 0xf9, 0xa1, 0x1e, 0xc5, 0xa8, 0xf9, 0xe1, 0xd9, 0xd2, 0xf9, 0x61, 0x45, 0x11, 0xac, 0x98, 0x1f, - 0x56, 0xb3, 0xf3, 0xc3, 0x21, 0x6c, 0x2d, 0xde, 0x44, 0xac, 0x1e, 0x91, 0xfe, 0x0e, 0xd4, 0xc6, - 0x86, 0xc8, 0x94, 0x87, 0x7b, 0xf9, 0x90, 0x98, 0xe7, 0x44, 0x53, 0x6a, 0xfb, 0x97, 0x45, 0x68, - 0x64, 0x66, 0xf3, 0x2b, 0xf4, 0xde, 0x86, 0x2a, 0xf3, 0xbc, 0x98, 0x0b, 0x91, 0xbc, 0x97, 0x01, - 0xb3, 0x22, 0x95, 0x72, 0x22, 0xe5, 0x6b, 0x7e, 0xdd, 0x81, 0x65, 0x6a, 0x7e, 0x02, 0xe5, 0x31, - 0x93, 0x43, 0x53, 0xbf, 0xab, 0xef, 0x54, 0x53, 0x95, 0x8c, 0xa6, 0xb2, 0x63, 0xf1, 0xaa, 0x99, - 0x51, 0x9a, 0xb1, 0xf8, 0x36, 0xac, 0xf1, 0x51, 0xf4, 0x33, 0x5f, 0xe5, 0xbe, 0x3a, 0xd5, 0x00, - 0xaa, 0xea, 0x96, 0x05, 0x01, 0x97, 0x66, 0x14, 0x62, 0x20, 0x64, 0x8e, 0x66, 0x64, 0x7a, 0x22, - 0xf5, 0xad, 0xd4, 0xea, 0x7b, 0x1e, 0x0f, 0x4d, 0x2f, 0x64, 0xa0, 0x3b, 0xe6, 0x20, 0xbb, 0x50, - 0x1b, 0x47, 0xc2, 0x57, 0x5d, 0xe5, 0xba, 0x9e, 0x17, 0x27, 0xb0, 0xfd, 0x6f, 0xe6, 0x29, 0xcd, - 0xff, 0x5b, 0x56, 0x3c, 0x65, 0xe6, 0xc1, 0x8a, 0x4b, 0xc7, 0xdc, 0xa5, 0xfc, 0x04, 0x35, 0x33, - 0xa9, 0x54, 0xdf, 0x6a, 0x28, 0xc0, 0x63, 0xff, 0x86, 0x7b, 0xce, 0xfb, 0x38, 0x1a, 0x99, 0x17, - 0x6c, 0x18, 0xdc, 0x37, 0x71, 0x34, 0x22, 0x2f, 0x61, 0x57, 0xb7, 0xef, 0x82, 0x7b, 0x8e, 0x5a, - 0x30, 0x53, 0x48, 0x35, 0x87, 0xd7, 0x41, 0x60, 0x47, 0x35, 0xf3, 0x82, 0x7b, 0xbd, 0x74, 0xfd, - 0x10, 0x97, 0xf5, 0x48, 0x2a, 0x74, 0x13, 0xf6, 0xfa, 0xd1, 0x41, 0xa3, 0x14, 0xf7, 0xdf, 0x50, - 0x15, 0x49, 0xb6, 0x45, 0x5a, 0xf1, 0x7f, 0x9e, 0x94, 0x0c, 0xb7, 0x98, 0xb9, 0x31, 0xb6, 0xb4, - 0xa5, 0xa5, 0xff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 0x8a, 0x91, 0x6e, 0x13, - 0xd6, 0x8f, 0xfa, 0x3f, 0xed, 0x76, 0x68, 0xcf, 0xe9, 0xf4, 0x7a, 0xca, 0xb5, 0x09, 0xb4, 0x3a, - 0xdd, 0xee, 0xc9, 0xc5, 0xe0, 0xfc, 0xcc, 0xe0, 0x0a, 0xd8, 0x3c, 0x27, 0x64, 0xbd, 0xfe, 0xbb, - 0xbe, 0x0e, 0x78, 0xdb, 0x60, 0xa5, 0x84, 0xb4, 0x7f, 0x7c, 0xf2, 0xad, 0x0a, 0x7c, 0x00, 0x95, - 0x77, 0x27, 0xdd, 0x23, 0x0c, 0x7b, 0x18, 0x25, 0x2e, 0x06, 0x06, 0x5a, 0x23, 0x1b, 0xd0, 0xb8, - 0x38, 0xec, 0x39, 0x17, 0xa7, 0xbd, 0x0e, 0x32, 0xa8, 0x10, 0x0b, 0x9a, 0x83, 0xce, 0x71, 0xdf, - 0xe9, 0xbe, 0xe9, 0x0c, 0x5e, 0xf7, 0x7b, 0x56, 0xd5, 0xfe, 0x23, 0x9d, 0x7e, 0x33, 0x2e, 0x47, - 0x7e, 0x3c, 0xe7, 0xa3, 0x0b, 0xb6, 0x38, 0x23, 0xce, 0xbb, 0x67, 0xaa, 0xa4, 0x62, 0x46, 0x49, - 0xaf, 0xd6, 0xff, 0xa0, 0xb1, 0xff, 0xd9, 0xcb, 0x64, 0xf3, 0x65, 0x45, 0x7d, 0x7d, 0xfe, 0x3f, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x9a, 0xb1, 0xaf, 0x0c, 0xb6, 0x27, 0x00, 0x00, + // 3368 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x3a, 0x3d, 0x6f, 0x24, 0x47, + 0x76, 0x9a, 0x0f, 0xce, 0xc7, 0x9b, 0x21, 0xd9, 0x2c, 0x52, 0xcb, 0x59, 0x2e, 0x57, 0xbb, 0xdb,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x42, 0x49, 0xee, 0x41, 0x07, 0xf9, 0x44, 0xc3, 0xc1, 0x29, + 0x4f, 0x7b, 0x95, 0xfb, 0x95, 0x47, 0x8b, 0x14, 0x34, 0xea, 0x00, 0x31, 0xe4, 0x01, 0x74, 0x55, + 0xac, 0x58, 0x98, 0x51, 0x54, 0x91, 0xa2, 0x83, 0x38, 0x43, 0xe2, 0xfe, 0xa6, 0x01, 0x0d, 0xcd, + 0x7b, 0x98, 0x90, 0x35, 0x58, 0xf0, 0xc3, 0xd8, 0x3f, 0x47, 0x46, 0x75, 0x6a, 0x00, 0xb2, 0x04, + 0x55, 0x11, 0xe0, 0xce, 0x36, 0xad, 0x8a, 0x80, 0x7c, 0x0e, 0x2d, 0x3f, 0x8e, 0x14, 0xf3, 0x95, + 0xec, 0xd5, 0xee, 0xd7, 0x1e, 0x75, 0x1e, 0x3f, 0xdc, 0xca, 0x34, 0xb2, 0x75, 0x34, 0x8a, 0xfc, + 0xfd, 0x48, 0x2a, 0x16, 0x86, 0x78, 0xd7, 0x1d, 0x43, 0xf9, 0xd5, 0x63, 0x9a, 0x6f, 0x22, 0x1f, + 0x43, 0xa7, 0x70, 0xd3, 0x5e, 0x1d, 0x79, 0xac, 0x97, 0x79, 0xec, 0x58, 0x82, 0x11, 0x2d, 0xd2, + 0x92, 0xd7, 0xb0, 0x9c, 0xb1, 0xb1, 0x3a, 0xe8, 0x2d, 0xdc, 0xaf, 0x3c, 0xea, 0x3c, 0x7e, 0x77, + 0xbc, 0xfd, 0x0a, 0x85, 0xd1, 0xc9, 0xdd, 0xe4, 0x04, 0x48, 0x81, 0x7f, 0xc6, 0xb3, 0x71, 0x13, + 0x9e, 0x33, 0x18, 0x90, 0x0f, 0xa1, 0x99, 0xa4, 0xf1, 0x1b, 0x11, 0xf2, 0x5e, 0x13, 0x79, 0xdd, + 0x1e, 0xf3, 0xca, 0x78, 0x1c, 0x1a, 0x02, 0x9a, 0x51, 0x92, 0x57, 0xb0, 0x64, 0x3f, 0x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fb, 0x72, 0x44, 0xa9, 0x7e, 0x32, + 0x75, 0xc8, 0xb8, 0x7e, 0xfa, 0x27, 0x93, 0x41, 0x0a, 0x56, 0x43, 0x3e, 0x9a, 0x30, 0xb3, 0x29, + 0x75, 0x8e, 0x89, 0xcb, 0x16, 0x96, 0xc7, 0x85, 0x6a, 0x21, 0x2e, 0x3c, 0x5d, 0xfc, 0x87, 0xce, + 0xd6, 0x07, 0x4f, 0xb2, 0xcd, 0xa7, 0x0d, 0xfc, 0xfa, 0xf0, 0xb7, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x17, 0xe1, 0xf7, 0xaf, 0x79, 0x26, 0x00, 0x00, } diff --git a/protocol/protobuf/pairing.proto b/protocol/protobuf/pairing.proto index a86e4baee..ef1a615ff 100644 --- a/protocol/protobuf/pairing.proto +++ b/protocol/protobuf/pairing.proto @@ -402,24 +402,7 @@ message SyncKeycard { bool locked = 3; string key_uid = 4; repeated bytes addresses = 5; - uint64 clock = 6; -} - -message SyncKeycardAction { - Action action = 1; - string oldKeycardUid = 2; - SyncKeycard keycard = 3; - - enum Action { - KEYCARD_ADDED = 0; - ACCOUNTS_ADDED = 1; - KEYCARD_DELETED = 2; - ACCOUNTS_REMOVED = 3; - LOCKED = 4; - UNLOCKED = 5; - UID_UPDATED = 6; - NAME_CHANGED = 7; - } + uint64 position = 6; } message SyncSocialLinks { diff --git a/protocol/v1/status_message.go b/protocol/v1/status_message.go index 5dd46afa3..2c1af6217 100644 --- a/protocol/v1/status_message.go +++ b/protocol/v1/status_message.go @@ -320,8 +320,6 @@ func (m *StatusMessage) HandleApplication() error { return m.unmarshalProtobufData((new(protobuf.SyncContactRequestDecision))) case protobuf.ApplicationMetadataMessage_SYNC_SAVED_ADDRESS: return m.unmarshalProtobufData(new(protobuf.SyncSavedAddress)) - case protobuf.ApplicationMetadataMessage_SYNC_KEYCARD_ACTION: - return m.unmarshalProtobufData(new(protobuf.SyncKeycardAction)) case protobuf.ApplicationMetadataMessage_SYNC_SOCIAL_LINKS: return m.unmarshalProtobufData(new(protobuf.SyncSocialLinks)) case protobuf.ApplicationMetadataMessage_SYNC_ENS_USERNAME_DETAIL: diff --git a/services/accounts/accounts.go b/services/accounts/accounts.go index 3dd889f7a..3f1e1e447 100644 --- a/services/accounts/accounts.go +++ b/services/accounts/accounts.go @@ -4,7 +4,6 @@ import ( "context" "errors" "strings" - "time" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/event" @@ -52,7 +51,7 @@ func (api *API) SaveAccount(ctx context.Context, account *accounts.Account) erro return nil } -// Setting `Keypair` without `Accounts` will update keypair only. +// Setting `Keypair` without `Accounts` will update keypair only, `Keycards` won't be saved/updated this way. func (api *API) SaveKeypair(ctx context.Context, keypair *accounts.Keypair) error { log.Info("[AccountsAPI::SaveKeypair]") err := (*api.messenger).SaveOrUpdateKeypair(keypair) @@ -327,13 +326,14 @@ func (api *API) VerifyPassword(password string) bool { } // If keypair is migrated from keycard to app, then `accountsComingFromKeycard` should be set to true, otherwise false. -func (api *API) AddKeycardOrAddAccountsIfKeycardIsAdded(ctx context.Context, kcUID string, kpName string, keyUID string, - accountAddresses []string, accountsComingFromKeycard bool) error { - if len(accountAddresses) == 0 { +// If keycard is new `Position` will be determined and set by the backend and `KeycardLocked` will be set to false. +// If keycard is already added, `Position` and `KeycardLocked` will be unchanged. +func (api *API) SaveOrUpdateKeycard(ctx context.Context, keycard *accounts.Keycard, accountsComingFromKeycard bool) error { + if len(keycard.AccountsAddresses) == 0 { return errors.New("cannot migrate a keypair without accounts") } - kpDb, err := api.db.GetKeypairByKeyUID(keyUID) + kpDb, err := api.db.GetKeypairByKeyUID(keycard.KeyUID) if err != nil { if err == accounts.ErrDbKeypairNotFound { return errors.New("cannot migrate an unknown keypair") @@ -341,23 +341,12 @@ func (api *API) AddKeycardOrAddAccountsIfKeycardIsAdded(ctx context.Context, kcU return err } - kp := accounts.Keycard{ - KeycardUID: kcUID, - KeycardName: kpName, - KeycardLocked: false, - KeyUID: keyUID, - LastUpdateClock: uint64(time.Now().Unix()), - } - for _, addr := range accountAddresses { - kp.AccountsAddresses = append(kp.AccountsAddresses, types.Address(common.HexToAddress(addr))) - } - - knownKeycardsForKeyUID, err := api.db.GetKeycardByKeyUID(keyUID) + relatedKeycardsByKeyUID, err := api.db.GetKeycardsWithSameKeyUID(keycard.KeyUID) if err != nil { return err } - added, err := (*api.messenger).AddKeycardOrAddAccountsIfKeycardIsAdded(ctx, &kp) + err = (*api.messenger).SaveOrUpdateKeycard(ctx, keycard) if err != nil { return err } @@ -365,8 +354,8 @@ func (api *API) AddKeycardOrAddAccountsIfKeycardIsAdded(ctx context.Context, kcU if !accountsComingFromKeycard { // Once we migrate a keypair, corresponding keystore files need to be deleted // if the keypair being migrated is not already migrated (in case user is creating a copy of an existing Keycard) - if added && len(knownKeycardsForKeyUID) == 0 { - for _, addr := range kp.AccountsAddresses { + if len(relatedKeycardsByKeyUID) == 0 { + for _, addr := range keycard.AccountsAddresses { err = api.manager.DeleteAccount(addr) if err != nil { return err @@ -383,52 +372,42 @@ func (api *API) AddKeycardOrAddAccountsIfKeycardIsAdded(ctx context.Context, kcU return nil } -func (api *API) RemoveMigratedAccountsForKeycard(ctx context.Context, kcUID string, accountAddresses []string) error { - clock := uint64(time.Now().Unix()) - var addresses []types.Address - for _, addr := range accountAddresses { - addresses = append(addresses, types.HexToAddress(addr)) - } - return (*api.messenger).RemoveMigratedAccountsForKeycard(ctx, kcUID, addresses, clock) -} - func (api *API) GetAllKnownKeycards(ctx context.Context) ([]*accounts.Keycard, error) { return api.db.GetAllKnownKeycards() } -func (api *API) GetAllKnownKeycardsGroupedByKeyUID(ctx context.Context) ([]*accounts.Keycard, error) { - return api.db.GetAllKnownKeycardsGroupedByKeyUID() +func (api *API) GetKeycardsWithSameKeyUID(ctx context.Context, keyUID string) ([]*accounts.Keycard, error) { + return api.db.GetKeycardsWithSameKeyUID(keyUID) } -func (api *API) GetKeycardByKeyUID(ctx context.Context, keyUID string) ([]*accounts.Keycard, error) { - return api.db.GetKeycardByKeyUID(keyUID) +func (api *API) GetKeycardByKeycardUID(ctx context.Context, keycardUID string) (*accounts.Keycard, error) { + return api.db.GetKeycardByKeycardUID(keycardUID) } -func (api *API) SetKeycardName(ctx context.Context, kcUID string, kpName string) error { - clock := uint64(time.Now().Unix()) - return (*api.messenger).SetKeycardName(ctx, kcUID, kpName, clock) +func (api *API) SetKeycardName(ctx context.Context, keycardUID string, kpName string) error { + return (*api.messenger).SetKeycardName(ctx, keycardUID, kpName) } -func (api *API) KeycardLocked(ctx context.Context, kcUID string) error { - clock := uint64(time.Now().Unix()) - return (*api.messenger).KeycardLocked(ctx, kcUID, clock) +func (api *API) KeycardLocked(ctx context.Context, keycardUID string) error { + return (*api.messenger).KeycardLocked(ctx, keycardUID) } -func (api *API) KeycardUnlocked(ctx context.Context, kcUID string) error { - clock := uint64(time.Now().Unix()) - return (*api.messenger).KeycardUnlocked(ctx, kcUID, clock) +func (api *API) KeycardUnlocked(ctx context.Context, keycardUID string) error { + return (*api.messenger).KeycardUnlocked(ctx, keycardUID) } -func (api *API) DeleteKeycard(ctx context.Context, kcUID string) error { - clock := uint64(time.Now().Unix()) - return (*api.messenger).DeleteKeycard(ctx, kcUID, clock) +func (api *API) DeleteKeycardAccounts(ctx context.Context, keycardUID string, accountAddresses []types.Address) error { + return (*api.messenger).DeleteKeycardAccounts(ctx, keycardUID, accountAddresses) +} + +func (api *API) DeleteKeycard(ctx context.Context, keycardUID string) error { + return (*api.messenger).DeleteKeycard(ctx, keycardUID) } func (api *API) DeleteAllKeycardsWithKeyUID(ctx context.Context, keyUID string) error { - return api.db.DeleteAllKeycardsWithKeyUID(keyUID) + return (*api.messenger).DeleteAllKeycardsWithKeyUID(ctx, keyUID) } -func (api *API) UpdateKeycardUID(ctx context.Context, oldKcUID string, newKcUID string) error { - clock := uint64(time.Now().Unix()) - return (*api.messenger).UpdateKeycardUID(ctx, oldKcUID, newKcUID, clock) +func (api *API) UpdateKeycardUID(ctx context.Context, oldKeycardUID string, newKeycardUID string) error { + return (*api.messenger).UpdateKeycardUID(ctx, oldKeycardUID, newKeycardUID) }