Skip to content

Commit

Permalink
Set fleet to shards.test
Browse files Browse the repository at this point in the history
  • Loading branch information
cammellos committed Dec 8, 2023
1 parent f614f0a commit 44fca8f
Show file tree
Hide file tree
Showing 11 changed files with 53 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1183,6 +1183,11 @@ public String keystoreDir() {
return pathCombine(absRootDirPath, "keystore");
}

@ReactMethod(isBlockingSynchronousMethod = true)
public String fleets() {
return Statusgo.fleets();
}

@ReactMethod(isBlockingSynchronousMethod = true)
public String backupDisabledDataDir() {
return this.getNoBackupDirectory();
Expand Down
4 changes: 4 additions & 0 deletions modules/react-native-status/ios/RCTStatus/RCTStatus.m
Original file line number Diff line number Diff line change
Expand Up @@ -981,6 +981,10 @@ - (void) migrateKeystore:(NSString *)accountData
return StatusgoIsAddress(address);
}

RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(fleets) {
return StatusgoFleets();
}

RCT_EXPORT_BLOCKING_SYNCHRONOUS_METHOD(toChecksumAddress:(NSString *)address) {
return StatusgoToChecksumAddress(address);
}
Expand Down
13 changes: 13 additions & 0 deletions modules/react-native-status/nodejs/status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ void _MultiAccountStoreAccount(const FunctionCallbackInfo<Value>& args) {
delete c;
}


void _InitKeystore(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<Context> context = isolate->GetCurrentContext();
Expand Down Expand Up @@ -562,6 +563,17 @@ void _CheckAddressChecksum(const FunctionCallbackInfo<Value>& args) {

}

void _Fleets(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
// Call exported Go function, which returns a C string
char *c = Fleets();

Local<String> ret = String::NewFromUtf8(isolate, c).ToLocalChecked();
args.GetReturnValue().Set(ret);
delete c;
}


void _IsAddress(const FunctionCallbackInfo<Value>& args) {
Isolate* isolate = args.GetIsolate();
Local<Context> context = isolate->GetCurrentContext();
Expand Down Expand Up @@ -1888,6 +1900,7 @@ void init(Local<Object> exports) {
NODE_SET_METHOD(exports, "multiAccountStoreDerivedAccounts", _MultiAccountStoreDerivedAccounts);
NODE_SET_METHOD(exports, "multiAccountStoreAccount", _MultiAccountStoreAccount);
NODE_SET_METHOD(exports, "initKeystore", _InitKeystore);
NODE_SET_METHOD(exports, "fleets", _Fleets);
NODE_SET_METHOD(exports, "stopCPUProfiling", _StopCPUProfiling);
NODE_SET_METHOD(exports, "encodeTransfer", _EncodeTransfer);
NODE_SET_METHOD(exports, "encodeFunctionCall", _EncodeFunctionCall);
Expand Down
4 changes: 4 additions & 0 deletions src/native_module/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,10 @@
[]
(.backupDisabledDataDir ^js (status)))

(defn fleets
[]
(.fleets ^js (status)))

(defn keystore-dir
[]
(.keystoreDir ^js (status)))
Expand Down
13 changes: 11 additions & 2 deletions src/status_im/fleet/core.cljs
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
(ns status-im.fleet.core
(:require
[native-module.core :as native-module]
[re-frame.core :as re-frame]
[status-im.multiaccounts.update.core :as multiaccounts.update]
[status-im.node.core :as node]
[status-im2.constants :as constants]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))
[utils.re-frame :as rf]
[utils.transforms :as transforms]))

(def ^:private default-fleets (transforms/json->clj (native-module/fleets)))
(def ^:private default-fleet (:defaultFleet default-fleets))
(def fleets
(->> default-fleets
:fleets
keys))

(defn current-fleet-sub
[multiaccount]
(keyword (or (get multiaccount :fleet)
config/fleet)))
default-fleet)))

(defn format-mailserver
[mailserver address]
Expand Down
10 changes: 3 additions & 7 deletions src/status_im/ui/screens/fleet_settings/views.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
(ns status-im.ui.screens.fleet-settings.views
(:require
[re-frame.core :as re-frame]
[status-im.fleet.core :as fleets]
[status-im.ui.components.icons.icons :as icons]
[status-im.ui.components.list.views :as list]
[status-im.ui.components.react :as react]
Expand Down Expand Up @@ -29,16 +30,11 @@
[react/text {:style styles/fleet-item-name-text}
fleet]]]]))

(defn fleets
[custom-fleets]
(map name (keys (node/fleets {:custom-fleets custom-fleets}))))

(views/defview fleet-settings
[]
(views/letsubs [custom-fleets [:fleets/custom-fleets]
current-fleet [:fleets/current-fleet]]
(views/letsubs [current-fleet [:fleets/current-fleet]]
[list/flat-list
{:data (fleets custom-fleets)
{:data fleets/fleets
:default-separator? false
:key-fn identity
:render-data (name current-fleet)
Expand Down
3 changes: 3 additions & 0 deletions src/status_im/utils/test.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,9 @@
:isAddress
(fn [address] (.isAddress native-status address))

:fleets
(fn [] (.fleets native-status))

:validateMnemonic
(fn [json callback] (callback (.validateMnemonic native-status json)))

Expand Down
9 changes: 3 additions & 6 deletions src/status_im2/contexts/chat/actions/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(defn fetch-messages!
[chat-id]
(rf/dispatch [:hide-bottom-sheet])
(rf/dispatch [:chat/fetch-messages chat-id]))

(defn fetch-messages
[chat-id]
{:icon :i/download
:right-icon :i/chevron-right
:accessibility-label :chat-fetch-messages
:on-press (partial fetch-messages! chat-id)
:on-press (fn []
(rf/dispatch [:hide-bottom-sheet])
(rf/dispatch [:chat/fetch-messages chat-id]))
:label (i18n/label :t/fetch-messages)})

(defn new-chat
Expand Down
7 changes: 3 additions & 4 deletions src/status_im2/contexts/chat/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,9 @@
(update db :chats dissoc chat-id))
(update :chats-home-list disj chat-id)
(assoc :current-chat-id nil))
:json-rpc/call [{:method "wakuext_deactivateChat"
:params [{:id chat-id}]
:on-success #()
:on-error #(log/error "failed to create public chat" chat-id %)}]}
:json-rpc/call [{:method "wakuext_deactivateChat"
:params [{:id chat-id}]
:on-error #(log/error "failed to create public chat" chat-id %)}]}
(clear-history chat-id true)))

(rf/defn offload-messages
Expand Down
3 changes: 1 addition & 2 deletions src/status_im2/contexts/profile/rpc.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@

(defn rpc->wakuv2-config
[wakuv2-config]
(-> wakuv2-config
(clojure.set/rename-keys {:LightClient :light-client})))
(clojure.set/rename-keys wakuv2-config {:LightClient :light-client}))

(defn rpc->profiles-overview
[{:keys [customizationColor keycard-pairing] :as profile}]
Expand Down
6 changes: 3 additions & 3 deletions status-go-version.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
"owner": "status-im",
"repo": "status-go",
"version": "v0.171.28",
"commit-sha1": "d7e7792b51f79e8cbebc9f59de79e64b6f6e684a",
"src-sha256": "0y0di4jfmk93pqc4i9fsgasrhqgvwh46ly5h04m87pm611faa2ay"
"version": "chore/set-default-fleet-to-shard-test",
"commit-sha1": "7bbfbf5eb3cb1d21b105cb80694969189fb431e7",
"src-sha256": "01qxkqfs3nc2i5xfp1n84n71j4in7abh81spa98fyy4bhsd8k893"
}

0 comments on commit 44fca8f

Please sign in to comment.