Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use staging fleet and upgrade status-go #9379

Merged
merged 1 commit into from
Nov 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ DEV_BUILD=1
ERC20_CONTRACT_WARNINGS=1
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=eth.beta
FLEET=eth.staging
GROUP_CHATS_ENABLED=1
HARDWALLET_ENABLED=1
LOG_LEVEL_STATUS_GO=info
Expand Down
2 changes: 1 addition & 1 deletion .env.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEFAULT_NETWORK=testnet_rpc
ERC20_CONTRACT_WARNINGS=1
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=eth.beta
FLEET=eth.staging
GROUP_CHATS_ENABLED=1
LOG_LEVEL_STATUS_GO=info
LOG_LEVEL=debug
Expand Down
2 changes: 1 addition & 1 deletion .env.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ DEFAULT_NETWORK=mainnet_rpc
ERC20_CONTRACT_WARNINGS=1
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=eth.beta
FLEET=eth.staging
GROUP_CHATS_ENABLED=1
HARDWALLET_ENABLED=1
LOG_LEVEL_STATUS_GO=info
Expand Down
2 changes: 1 addition & 1 deletion .env.nightly
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEFAULT_NETWORK=mainnet_rpc
ERC20_CONTRACT_WARNINGS=1
ETHEREUM_DEV_CLUSTER=1
EXTENSIONS=0
FLEET=eth.beta
FLEET=eth.staging
GROUP_CHATS_ENABLED=1
LOG_LEVEL_STATUS_GO=info
LOG_LEVEL=debug
Expand Down
2 changes: 1 addition & 1 deletion .env.release
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ DEFAULT_NETWORK=mainnet_rpc
ERC20_CONTRACT_WARNINGS=0
ETHEREUM_DEV_CLUSTER=0
EXTENSIONS=0
FLEET=eth.beta
FLEET=eth.staging
GROUP_CHATS_ENABLED=1
LOG_LEVEL_STATUS_GO=
LOG_LEVEL=info
Expand Down
4 changes: 2 additions & 2 deletions src/status_im/multiaccounts/login/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

(defn fetch-nodes [current-fleet resolve reject]
(let [default-nodes (-> (node/fleets {})
(get-in [:eth.beta :mail])
(get-in [:eth.staging :mail])
vals)]
(if config/contract-nodes-enabled?
(do
Expand All @@ -47,7 +47,7 @@
contract-address
(handlers/response-handler resolve
(fn [error]
(log/warn "could not fetch nodes from contract defaulting to eth.beta")
(log/warn "could not fetch nodes from contract defaulting to eth.staging")
(resolve default-nodes)))))
(resolve default-nodes))))

Expand Down
2 changes: 1 addition & 1 deletion src/status_im/utils/config.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
(def log-level-status-go
(-> (get-config :LOG_LEVEL_STATUS_GO "")
string/upper-case))
(def fleet (get-config :FLEET "eth.beta"))
(def fleet (get-config :FLEET "eth.staging"))
(def default-network (get-config :DEFAULT_NETWORK))
(def pow-target (js/parseFloat (get-config :POW_TARGET "0.002")))
(def pow-time (js/parseInt (get-config :POW_TIME "1")))
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
"owner": "status-im",
"repo": "status-go",
"version": "5f2544f1e8f2ee832bbab95c8d74e26ba0ab2481",
"commit-sha1": "5f2544f1e8f2ee832bbab95c8d74e26ba0ab2481",
"src-sha256": "0dlkr6056mhyny9k895zs5012ywiz75qm6y7a6hypb3pfxr35931"
"version": "v0.34.0-beta.4",
"commit-sha1": "e311307061ebf67fece33ff02e811d94972ae5b1",
"src-sha256": "063yfb9r1vdgskhfqg0r400wrpwk2ibryc785pffwash70yyf5y0"
}
120 changes: 60 additions & 60 deletions test/cljs/status_im/test/mailserver/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
(testing "it shows the popup"
(is (:ui/show-confirmation (mailserver/change-mailserver
{:db {:multiaccount {:settings
{:fleet :beta
:mailserver {:beta "id"}}}
{:fleet :staging
:mailserver {:staging "id"}}}
:peers-count 1}})))))
(testing "there's not a preferred mailserver"
(testing "it changes the mailserver"
(is (= :a
(get-in
(mailserver/change-mailserver
{:db {:mailserver/mailservers {:beta {:a "b"}}
{:db {:mailserver/mailservers {:staging {:a "b"}}
:multiaccount {:settings
{:fleet :beta}}
{:fleet :staging}}
:peers-count 1}})
[:db :mailserver/current-id]))))
(testing "it does not show the popup"
Expand Down Expand Up @@ -131,10 +131,10 @@

(deftest edit-mailserver
(let [db {:mailserver/mailservers
{:eth.beta {"a" {:id "a"
:address valid-enode-address
:password password
:name "name"}}}}
{:eth.staging {"a" {:id "a"
:address valid-enode-address
:password password
:name "name"}}}}
cofx {:db db}]
(testing "when no id is given"
(let [actual (mailserver/edit cofx nil)]
Expand Down Expand Up @@ -186,36 +186,36 @@

(deftest fetch-mailserver
(testing "it fetches the mailserver from the db"
(let [cofx {:db {:mailserver/mailservers {:eth.beta {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}]
(let [cofx {:db {:mailserver/mailservers {:eth.staging {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}]
(is (mailserver/fetch cofx "a")))))

(deftest fetch-current-mailserver
(testing "it fetches the mailserver from the db with corresponding id"
(let [cofx {:db {:mailserver/current-id "a"
:mailserver/mailservers {:eth.beta {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}]
:mailserver/mailservers {:eth.staging {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}]
(is (mailserver/fetch-current cofx)))))

(deftest set-current-mailserver
(with-redefs [rand-nth (comp last sort)]
(let [cofx {:db {:mailserver/mailservers {:eth.beta {"a" {}
"b" {}
"c" {}
"d" {}}}}}]
(let [cofx {:db {:mailserver/mailservers {:eth.staging {"a" {}
"b" {}
"c" {}
"d" {}}}}}]
(testing "the user has already a preference"
(let [cofx (assoc-in cofx
[:db :multiaccount :settings]
{:mailserver {:eth.beta "a"}})]
{:mailserver {:eth.staging "a"}})]
(testing "the mailserver exists"
(testing "it sets the preferred mailserver"
(is (= "a" (-> (mailserver/set-current-mailserver cofx)
:db
:mailserver/current-id)))))
(testing "the mailserver does not exists"
(let [cofx (update-in cofx [:db :mailserver/mailservers :eth.beta] dissoc "a")]
(let [cofx (update-in cofx [:db :mailserver/mailservers :eth.staging] dissoc "a")]
(testing "sets a random mailserver"
(is (= "d" (-> (mailserver/set-current-mailserver cofx)
:db
Expand Down Expand Up @@ -250,28 +250,28 @@
(deftest delete-mailserver
(testing "the user is not connected to the mailserver"
(let [cofx {:random-id-generator (constantly "random-id")
:db {:mailserver/mailservers {:eth.beta {"a" {:id "a"
:name "old-name"
:user-defined true
:address "enode://old-id:old-password@url:port"}}}}}
:db {:mailserver/mailservers {:eth.staging {"a" {:id "a"
:name "old-name"
:user-defined true
:address "enode://old-id:old-password@url:port"}}}}}
actual (mailserver/delete cofx "a")]
(testing "it removes the mailserver from the list"
(is (not (mailserver/fetch actual "a"))))
(testing "it stores it in the db"
(is (= 1 (count (::json-rpc/call actual)))))))
(testing "the mailserver is not user-defined"
(let [cofx {:random-id-generator (constantly "random-id")
:db {:mailserver/mailservers {:eth.beta {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
:db {:mailserver/mailservers {:eth.staging {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
actual (mailserver/delete cofx "a")]
(testing "it does not delete the mailserver"
(is (= {:dispatch [:navigate-back]} actual)))))
(testing "the user is connected to the mailserver"
(let [cofx {:random-id-generator (constantly "random-id")
:db {:mailserver/mailservers {:eth.beta {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
:db {:mailserver/mailservers {:eth.staging {"a" {:id "a"
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
actual (mailserver/delete cofx "a")]
(testing "it does not remove the mailserver from the list"
(is (= {:dispatch [:navigate-back]} actual))))))
Expand All @@ -286,11 +286,11 @@
actual (mailserver/upsert cofx)]

(testing "it adds the enode to mailserver/mailservers"
(is (= {:eth.beta {:randomid {:password "test-password"
:address "enode://test-id@url:port"
:name "test-name"
:id :randomid
:user-defined true}}}
(is (= {:eth.staging {:randomid {:password "test-password"
:address "enode://test-id@url:port"
:name "test-name"
:id :randomid
:user-defined true}}}
(get-in actual [:db :mailserver/mailservers]))))
(testing "it navigates back"
(is (= [:navigate-back]
Expand All @@ -303,19 +303,19 @@
:name {:value "new-name"}
:url {:value "enode://new-id:new-password@url:port"}}

:mailserver/mailservers {:eth.beta {:a {:id :a
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
:mailserver/mailservers {:eth.staging {:a {:id :a
:name "old-name"
:address "enode://old-id:old-password@url:port"}}}}}
actual (mailserver/upsert cofx)]
(testing "it navigates back"
(is (= [:navigate-back]
(:dispatch actual))))
(testing "it updates the enode to mailserver/mailservers"
(is (= {:eth.beta {:a {:password "new-password"
:address "enode://new-id@url:port"
:name "new-name"
:id :a
:user-defined true}}}
(is (= {:eth.staging {:a {:password "new-password"
:address "enode://new-id@url:port"
:name "new-name"
:id :a
:user-defined true}}}
(get-in actual [:db :mailserver/mailservers]))))
(testing "it stores it in the db"
(is (= 1 (count (::json-rpc/call actual))))))))
Expand All @@ -325,10 +325,10 @@
:peers-summary (if registered-peer?
[{:id "mailserver-id" :enode "enode://mailserver-id@ip"}]
[])
:multiaccount {:settings {:fleet :eth.beta}}
:multiaccount {:settings {:fleet :eth.staging}}
:mailserver/current-id "mailserver-a"
:mailserver/mailservers {:eth.beta {"mailserver-a" {:sym-key-id sym-key
:address "enode://mailserver-id@ip"}}}}})
:mailserver/mailservers {:eth.staging {"mailserver-a" {:sym-key-id sym-key
:address "enode://mailserver-id@ip"}}}}})

(defn peers-summary-change-result [sym-key registered-peer? registered-peer-before?]
(mailserver/peers-summary-change (cofx-fixtures sym-key
Expand Down Expand Up @@ -581,34 +581,34 @@
(testing "it removes the preference"
(let [db {:mailserver/current-id "mailserverid"
:mailserver/mailservers
{:eth.beta {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
{:eth.staging {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
:multiaccount
{:settings {:fleet :eth.beta
:mailserver {:eth.beta "mailserverid"}}}}]
{:settings {:fleet :eth.staging
:mailserver {:eth.staging "mailserverid"}}}}]
(is (not (get-in (mailserver/unpin {:db db})
[:db :multiaccount :settings :mailserver :eth.beta]))))))
[:db :multiaccount :settings :mailserver :eth.staging]))))))

(deftest pin-test
(testing "it removes the preference"
(let [db {:mailserver/current-id "mailserverid"
:mailserver/mailservers
{:eth.beta {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
{:eth.staging {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
:multiaccount
{:settings {:fleet :eth.beta
{:settings {:fleet :eth.staging
:mailserver {}}}}]
(is (= "mailserverid" (get-in (mailserver/pin {:db db})
[:db :multiaccount :settings :mailserver :eth.beta]))))))
[:db :multiaccount :settings :mailserver :eth.staging]))))))

(deftest connect-to-mailserver
(let [db {:mailserver/current-id "mailserverid"
:mailserver/mailservers
{:eth.beta {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
{:eth.staging {"mailserverid" {:address "mailserver-address"
:password "mailserver-password"}}}
:multiaccount
{:settings {:fleet :eth.beta
:mailserver {:eth.beta "mailserverid"}}}}]
{:settings {:fleet :eth.staging
:mailserver {:eth.staging "mailserverid"}}}}]
(testing "it adds the peer"
(is (= "mailserver-address"
(:mailserver/add-peer (mailserver/connect-to-mailserver {:db db})))))
Expand All @@ -619,7 +619,7 @@
first
:password))))
(let [mailserver-with-sym-key-db (assoc-in db
[:mailserver/mailservers :eth.beta "mailserverid" :sym-key-id]
[:mailserver/mailservers :eth.staging "mailserverid" :sym-key-id]
"somesymkeyid")]
(testing "it does not generate a sym key if already present"
(is (not (-> (mailserver/connect-to-mailserver {:db mailserver-with-sym-key-db})
Expand Down
20 changes: 10 additions & 10 deletions test/cljs/status_im/test/transport/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
(let [cofx {:db {:multiaccount {:public-key "1"}}}]
(testing "custom mailservers"
(let [ms-1 {:id :a
:fleet :eth.beta
:fleet :eth.staging
:name "name-1"
:address "address-1"
:password "password-1"}
ms-2 {:id :b
:fleet :eth.beta
:fleet :eth.staging
:name "name-2"
:address "address-2"
:password "password-2"}
Expand All @@ -24,12 +24,12 @@
:name "name-3"
:address "address-3"
:password "password-3"}
expected-mailservers {:eth.beta {:a (-> ms-1
(dissoc :fleet)
(assoc :user-defined true))
:b (-> ms-2
(dissoc ms-2 :fleet)
(assoc :user-defined true))}
expected-mailservers {:eth.staging {:a (-> ms-1
(dissoc :fleet)
(assoc :user-defined true))
:b (-> ms-2
(dissoc ms-2 :fleet)
(assoc :user-defined true))}
:eth.test {:c (-> ms-3
(dissoc :fleet)
(assoc :user-defined true))}}]
Expand All @@ -40,8 +40,8 @@
:mailserver-topics {}
:default-mailserver true})
[:db :mailserver/mailservers])
(update-in [:eth.beta :a] dissoc :generating-sym-key?)
(update-in [:eth.beta :b] dissoc :generating-sym-key?)
(update-in [:eth.staging :a] dissoc :generating-sym-key?)
(update-in [:eth.staging :b] dissoc :generating-sym-key?)
(update-in [:eth.test :c] dissoc :generating-sym-key?))))))))

(def sig "0x04325367620ae20dd878dbb39f69f02c567d789dd21af8a88623dc5b529827c2812571c380a2cd8236a2851b8843d6486481166c39debf60a5d30b9099c66213e4")
Expand Down