use status-go's hackaton-alt branch

This commit is contained in:
Roman Volosovskyi 2017-05-27 21:14:01 +03:00 committed by Roman Volosovskyi
parent 6921587e13
commit 6f6849f635
10 changed files with 47 additions and 31 deletions

View File

@ -72,10 +72,13 @@ function superSuggestion(params, context) {
return {markup: view}; return {markup: view};
}; };
var cnt = 0;
status.addListener("on-message-input-change", superSuggestion); status.addListener("on-message-input-change", superSuggestion);
status.addListener("on-message-send", function (params, context) { status.addListener("on-message-send", function (params, context) {
cnt++;
if (isNaN(params.message)) { if (isNaN(params.message)) {
return {"text-message": "Seems that you don't want to send money :("}; return {"text-message": "Seems that you don't want to send money :(. cnt = " + cnt};
} }
var balance = web3.eth.getBalance(context.from); var balance = web3.eth.getBalance(context.from);

View File

@ -99,6 +99,13 @@
ReferencedContainer = "container:StatusIm.xcodeproj"> ReferencedContainer = "container:StatusIm.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </BuildableProductRunnable>
<EnvironmentVariables>
<EnvironmentVariable
key = "OS_ACTIVITY_MODE"
value = "disabled"
isEnabled = "YES">
</EnvironmentVariable>
</EnvironmentVariables>
<AdditionalOptions> <AdditionalOptions>
</AdditionalOptions> </AdditionalOptions>
</LaunchAction> </LaunchAction>

View File

@ -15,5 +15,5 @@ android {
dependencies { dependencies {
compile 'com.facebook.react:react-native:+' compile 'com.facebook.react:react-native:+'
compile 'com.instabug.library:instabug:3+' compile 'com.instabug.library:instabug:3+'
compile(group: 'status-im', name: 'status-go', version: '0.9.8-g311f2b8', ext: 'aar') compile(group: 'status-im', name: 'status-go', version: 'hackaton-alt-gd3704fa', ext: 'aar')
} }

View File

@ -202,7 +202,6 @@ RCT_EXPORT_METHOD(startNode:(RCTResponseSenderBlock)onResultCallback) {
NSLog(@"error %@", error); NSLog(@"error %@", error);
}else }else
NSLog(@"folderName: %@", folderName); NSLog(@"folderName: %@", folderName);
char *configChars = GenerateConfig([folderName.path UTF8String], 3); char *configChars = GenerateConfig([folderName.path UTF8String], 3);
NSString *config = [NSString stringWithUTF8String: configChars]; NSString *config = [NSString stringWithUTF8String: configChars];
NSData *configData = [config dataUsingEncoding:NSUTF8StringEncoding]; NSData *configData = [config dataUsingEncoding:NSUTF8StringEncoding];

View File

@ -25,7 +25,7 @@
<artifactItem> <artifactItem>
<groupId>status-im</groupId> <groupId>status-im</groupId>
<artifactId>status-go-ios-simulator</artifactId> <artifactId>status-go-ios-simulator</artifactId>
<version>0.9.8-g311f2b8</version> <version>hackaton-alt-gd3704fa</version>
<type>zip</type> <type>zip</type>
<overWrite>true</overWrite> <overWrite>true</overWrite>
<outputDirectory>./</outputDirectory> <outputDirectory>./</outputDirectory>

View File

@ -34,7 +34,11 @@
result)] result)]
(dispatch [:set-in [:message-data data-type message-id] result]) (dispatch [:set-in [:message-data data-type message-id] result])
(when on-requested (on-requested result)))] (when on-requested (on-requested result)))]
(status/call-jail jail-id path params callback))))))) ;chat-id path params callback lock? type
(status/call-jail {:jail-id jail-id
:path path
:params params
:callback callback})))))))
(handlers/register-handler :execute-command-immediately (handlers/register-handler :execute-command-immediately
(handlers/side-effect! (handlers/side-effect!

View File

@ -128,14 +128,15 @@
params {:parameters {:args args} params {:parameters {:args args}
:context (merge {:data data} :context (merge {:data data}
(input-model/command-dependent-context-params command))}] (input-model/command-dependent-context-params command))}]
(status/call-jail jail-id (status/call-jail
path {:jail-id jail-id
params :path path
#(dispatch [:received-bot-response :params params
{:chat-id current-chat-id :callback #(dispatch [:received-bot-response
:command command {:chat-id current-chat-id
:parameter-index parameter-index} :command command
%])))))))) :parameter-index parameter-index}
%])})))))))
(handlers/register-handler (handlers/register-handler
::send-message ::send-message

View File

@ -143,11 +143,11 @@
[:check-and-load-commands! [:check-and-load-commands!
identity identity
#(status/call-jail #(status/call-jail
identity {:jail-id identity
path :path path
params :params params
(fn [res] :callback (fn [res]
(dispatch [:command-handler! chat-id parameters res])))]))))) (dispatch [:command-handler! chat-id parameters res]))})])))))
(register-handler :prepare-message (register-handler :prepare-message
(u/side-effect! (u/side-effect!

View File

@ -135,11 +135,12 @@
parameters {:context context parameters {:context context
:parameters {:amount amount :parameters {:amount amount
:address address}}] :address address}}]
(s/call-jail c/wallet-chat-id (s/call-jail
path {:jail-id c/wallet-chat-id
parameters :path path
(fn [data] :params parameters
(log/debug :webview-send-eth-callback data))))))) :callback (fn [data]
(log/debug :webview-send-eth-callback data))})))))
(register-handler :webview-nfc (register-handler :webview-nfc
(u/side-effect! (u/side-effect!

View File

@ -8,7 +8,8 @@
[cljs.core.async :refer [<! timeout]] [cljs.core.async :refer [<! timeout]]
[status-im.utils.js-resources :as js-res] [status-im.utils.js-resources :as js-res]
[status-im.i18n :as i] [status-im.i18n :as i]
[status-im.utils.platform :as p])) [status-im.utils.platform :as p]
[status-im.utils.scheduler :as scheduler]))
(defn cljs->json [data] (defn cljs->json [data]
(.stringify js/JSON (clj->js data))) (.stringify js/JSON (clj->js data)))
@ -135,11 +136,11 @@
(when status (when status
(call-module #(.parseJail status chat-id file callback)))) (call-module #(.parseJail status chat-id file callback))))
(defn call-jail [chat-id path params callback] (defn call-jail [{:keys [jail-id path params callback]}]
(when status (when status
(call-module (call-module
#(do #(do
(log/debug :call-jail :chat-id chat-id) (log/debug :call-jail :jail-id jail-id)
(log/debug :call-jail :path path) (log/debug :call-jail :path path)
(log/debug :call-jail :params params) (log/debug :call-jail :params params)
(let [params' (update params :context assoc (let [params' (update params :context assoc
@ -152,17 +153,17 @@
(doseq [{:keys [type message]} messages] (doseq [{:keys [type message]} messages]
(log/debug (str "VM console(" type ") - " message))) (log/debug (str "VM console(" type ") - " message)))
(callback r')))] (callback r')))]
(.callJail status chat-id (cljs->json path) (cljs->json params') cb)))))) (.callJail status jail-id (cljs->json path) (cljs->json params') cb))))))
(defn call-function! (defn call-function!
[{:keys [chat-id function callback] :as opts}] [{:keys [chat-id function callback] :as opts}]
(let [path [:functions function] (let [path [:functions function]
params (select-keys opts [:parameters :context])] params (select-keys opts [:parameters :context])]
(call-jail (call-jail
chat-id {:jail-id chat-id
path :path path
params :params params
(or callback #(dispatch [:received-bot-response {:chat-id chat-id} %]))))) :callback (or callback #(dispatch [:received-bot-response {:chat-id chat-id} %]))})))
(defn set-soft-input-mode [mode] (defn set-soft-input-mode [mode]
(when status (when status