[#12920] Unable to perform swap on 1inch.exchange if initial swap was cancelled by closing bottom sheet

Signed-off-by: andrey <motor4ik@gmail.com>
This commit is contained in:
andrey 2022-01-06 14:54:18 +01:00
parent a858918b80
commit 130308fa8a
No known key found for this signature in database
GPG Key ID: 89B67245FD2F0272
6 changed files with 57 additions and 6 deletions

View File

@ -1011,6 +1011,25 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
StatusThreadPoolExecutor.getInstance().execute(r);
}
@ReactMethod
public void recover(final String rpcParams, final Callback callback) {
Log.d(TAG, "recover");
if (!checkAvailability()) {
callback.invoke(false);
return;
}
Runnable r = new Runnable() {
@Override
public void run() {
String res = Statusgo.recover(rpcParams);
callback.invoke(res);
}
};
StatusThreadPoolExecutor.getInstance().execute(r);
}
@ReactMethod
public void signTypedData(final String data, final String account, final String password, final Callback callback) {
Log.d(TAG, "signTypedData");

View File

@ -662,6 +662,18 @@ RCT_EXPORT_METHOD(signMessage:(NSString *)message
callback(@[result]);
}
////////////////////////////////////////////////////////////////////
#pragma mark - Recover
//////////////////////////////////////////////////////////////////// recover
RCT_EXPORT_METHOD(recover:(NSString *)message
callback:(RCTResponseSenderBlock)callback) {
#if DEBUG
NSLog(@"Recover() method called");
#endif
NSString *result = StatusgoRecover(message);
callback(@[result]);
}
////////////////////////////////////////////////////////////////////
#pragma mark - SignTypedData
//////////////////////////////////////////////////////////////////// signTypedData

View File

@ -107,6 +107,7 @@
}
else
{
if (window.statusAppDebug) { console.log("resolve " + callback.method + " :" + JSON.stringify(data.result.result)); }
callback.resolve(data.result.result);
}
}
@ -239,6 +240,7 @@
return new Promise(function (resolve, reject) {
callbacks[messageId] = {beta: true,
method: method,
resolve: resolve,
reject: reject};
});

View File

@ -418,12 +418,19 @@
:result {:jsonrpc "2.0"
:id (int id)
:result (if (= method "eth_coinbase") dapps-address [dapps-address])}})
(if (= method "personal_ecRecover")
{:signing.fx/recover-message {:params {:message (first params)
:signature (second params)}
:on-completed #(re-frame/dispatch [:browser.callback/call-rpc
{:type constants/web3-send-async-callback
:messageId message-id
:result (types/json->clj %)}])}}
{:browser/call-rpc [payload
#(re-frame/dispatch [:browser.callback/call-rpc
{:type constants/web3-send-async-callback
:messageId message-id
:error %1
:result %2}])]}))))
:result %2}])]})))))
(fx/defn handle-no-permissions [cofx {:keys [method id]} message-id]
(if (= method "eth_accounts")

View File

@ -253,6 +253,11 @@
(log/debug "[native-module] sign-message")
(.signMessage ^js (status) rpcParams callback))
(defn recover-message
[rpcParams callback]
(log/debug "[native-module] recover")
(.recover ^js (status) rpcParams callback))
(defn send-transaction
"NOTE: beware, the password has to be sha3 hashed"
[rpcParams hashed-password callback]

View File

@ -47,6 +47,12 @@
(status/sign-message (types/clj->json params)
on-completed)))
(re-frame/reg-fx
:signing.fx/recover-message
(fn [{:keys [params on-completed]}]
(status/recover-message (types/clj->json params)
on-completed)))
(re-frame/reg-fx
:signing.fx/sign-typed-data
(fn [{:keys [v4 data account on-completed hashed-password]}]