-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bug #5356 - added snackbar for wallet errors, removed ATT from defaul…
…t tokens on ropsten Signed-off-by: Goran Jovic <goranjovic@gmail.com>
- Loading branch information
1 parent
8f13d97
commit 879e33b
Showing
10 changed files
with
80 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
src/status_im/data_store/realm/schemas/base/v8/account.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
(ns status-im.data-store.realm.schemas.base.v8.account | ||
(:require [taoensso.timbre :as log] | ||
[cognitect.transit :as transit] | ||
[clojure.set :as set] | ||
[status-im.data-store.realm.schemas.base.v4.account :as v7])) | ||
|
||
(def schema v7/schema) | ||
|
||
(def removed-tokens | ||
#{:ATT}) | ||
|
||
(def reader (transit/reader :json)) | ||
(def writer (transit/writer :json)) | ||
|
||
(defn serialize [o] (transit/write writer o)) | ||
(defn deserialize [o] (try (transit/read reader o) (catch :default e nil))) | ||
|
||
(defn migration [old-realm new-realm] | ||
(log/debug "migrating accounts schema v8") | ||
(let [accounts (.objects new-realm "account")] | ||
(dotimes [i (.-length accounts)] | ||
(let [account (aget accounts i) | ||
old-settings (deserialize (aget account "settings")) | ||
new-settings (-> old-settings | ||
(update-in [:wallet :visible-tokens :testnet] | ||
#(set/difference % removed-tokens))) | ||
updated (serialize new-settings)] | ||
(aset account "settings" updated))))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
(ns status-im.data-store.realm.schemas.base.v8.core | ||
(:require [status-im.data-store.realm.schemas.base.v1.network :as network] | ||
[status-im.data-store.realm.schemas.base.v4.bootnode :as bootnode] | ||
[status-im.data-store.realm.schemas.base.v8.account :as account] | ||
[taoensso.timbre :as log])) | ||
|
||
(def schema [network/schema | ||
bootnode/schema | ||
account/schema]) | ||
|
||
(defn migration [old-realm new-realm] | ||
(log/debug "migrating base database v8: " old-realm new-realm) | ||
(account/migration old-realm new-realm)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters