chore: Remove include watch only accounts settings as it is out dated and not needed anymore (#4153)

This commit is contained in:
Khushboo-dev-cpp 2023-10-13 11:23:24 +02:00 committed by GitHub
parent 466dccc809
commit ac813ef5d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 675 additions and 890 deletions

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
ALTER TABLE settings DROP COLUMN include_watch_only_account;

View File

@ -0,0 +1 @@
ALTER TABLE settings_sync_clock DROP COLUMN include_watch_only_account;

File diff suppressed because it is too large Load Diff

View File

@ -432,17 +432,6 @@ var (
dBColumnName: "address",
valueHandler: AddressHandler,
}
IncludeWatchOnlyAccount = SettingField{
reactFieldName: "include-watch-only-account?",
dBColumnName: "include_watch_only_account",
valueHandler: BoolHandler,
syncProtobufFactory: &SyncProtobufFactory{
fromInterface: includeWatchOnlyAccountProtobufFactory,
fromStruct: includeWatchOnlyAccountProtobufFactoryStruct,
valueFromProtobuf: BoolFromSyncProtobuf,
protobufType: protobuf.SyncSetting_INCLUDE_WATCHONLY_ACCOUNT,
},
}
ProfileMigrationNeeded = SettingField{
reactFieldName: "profile-migration-needed",
dBColumnName: "profile_migration_needed",
@ -516,7 +505,6 @@ var (
WalletSetUpPassed,
WalletVisibleTokens,
WebviewAllowPermissionRequests,
IncludeWatchOnlyAccount,
ProfileMigrationNeeded,
IsSepoliaEnabled,
}

View File

@ -334,7 +334,7 @@ func (db *Database) GetSettings() (Settings, error) {
profile_pictures_show_to, profile_pictures_visibility, wallet_root_address, wallet_set_up_passed, wallet_visible_tokens,
waku_bloom_filter_mode, webview_allow_permission_requests, current_user_status, send_status_updates, gif_recents,
gif_favorites, opensea_enabled, last_backup, backup_enabled, telemetry_server_url, auto_message_enabled, gif_api_key,
test_networks_enabled, mutual_contact_enabled, include_watch_only_account, profile_migration_needed, is_sepolia_enabled
test_networks_enabled, mutual_contact_enabled, profile_migration_needed, is_sepolia_enabled
FROM
settings
WHERE
@ -407,7 +407,6 @@ func (db *Database) GetSettings() (Settings, error) {
&s.GifAPIKey,
&s.TestNetworksEnabled,
&s.MutualContactEnabled,
&s.IncludeWatchOnlyAccount,
&s.ProfileMigrationNeeded,
&s.IsSepoliaEnabled,
)
@ -694,11 +693,6 @@ func (db *Database) GetTelemetryServerURL() (string, error) {
return db.makeSelectString(TelemetryServerURL)
}
func (db *Database) IncludeWatchOnlyAccount() (result bool, err error) {
err = db.makeSelectRow(IncludeWatchOnlyAccount).Scan(&result)
return result, err
}
func (db *Database) ProfileMigrationNeeded() (result bool, err error) {
err = db.makeSelectRow(ProfileMigrationNeeded).Scan(&result)
return result, err

View File

@ -44,7 +44,6 @@ var (
UseMailservers: true,
LinkPreviewRequestEnabled: true,
SendStatusUpdates: true,
IncludeWatchOnlyAccount: true,
WalletRootAddress: types.HexToAddress("0x3B591fd819F86D0A6a2EF2Bcb94f77807a7De1a6")}
)

View File

@ -194,7 +194,6 @@ type Settings struct {
AutoMessageEnabled bool `json:"auto-message-enabled?,omitempty"`
GifAPIKey string `json:"gifs/api-key"`
TestNetworksEnabled bool `json:"test-networks-enabled?,omitempty"`
IncludeWatchOnlyAccount bool `json:"include-watch-only-account?,omitempty"`
ProfileMigrationNeeded bool `json:"profile-migration-needed,omitempty"`
IsSepoliaEnabled bool `json:"is-sepolia-enabled?,omitempty"`
}

View File

@ -514,28 +514,3 @@ func mnemonicRemovedProtobufFactory(value interface{}, clock uint64, chatID stri
func mnemonicRemovedProtobufFactoryStruct(s Settings, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
return buildRawMnemonicRemovedSyncMessage(s.MnemonicRemoved, clock, chatID)
}
// IncludeWatchOnlyAccount
func buildRawIncludeWatchOnlyAccountSyncMessage(v bool, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
pb := &protobuf.SyncSetting{
Type: protobuf.SyncSetting_INCLUDE_WATCHONLY_ACCOUNT,
Value: &protobuf.SyncSetting_ValueBool{ValueBool: v},
Clock: clock,
}
rm, err := buildRawSyncSettingMessage(pb, chatID)
return rm, pb, err
}
func includeWatchOnlyAccountProtobufFactory(value interface{}, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
v, err := assertBool(value)
if err != nil {
return nil, nil, err
}
return buildRawIncludeWatchOnlyAccountSyncMessage(v, clock, chatID)
}
func includeWatchOnlyAccountProtobufFactoryStruct(s Settings, clock uint64, chatID string) (*common.RawMessage, *protobuf.SyncSetting, error) {
return buildRawIncludeWatchOnlyAccountSyncMessage(s.IncludeWatchOnlyAccount, clock, chatID)
}

View File

@ -59,7 +59,6 @@ var SyncSetting_Type_name = map[int32]string{
13: "DISPLAY_NAME",
14: "BIO",
15: "MNEMONIC_REMOVED",
17: "INCLUDE_WATCHONLY_ACCOUNT",
}
var SyncSetting_Type_value = map[string]int32{
@ -79,7 +78,6 @@ var SyncSetting_Type_value = map[string]int32{
"DISPLAY_NAME": 13,
"BIO": 14,
"MNEMONIC_REMOVED": 15,
"INCLUDE_WATCHONLY_ACCOUNT": 17,
}
func (x SyncSetting_Type) String() string {

View File

@ -32,7 +32,6 @@ message SyncSetting {
BIO = 14;
MNEMONIC_REMOVED = 15;
reserved 16; //do not use this value anymore as it was removed
INCLUDE_WATCHONLY_ACCOUNT = 17;
}
}