From 675515a6557558ef8ccdde091e3e9ca953b0e110 Mon Sep 17 00:00:00 2001 From: andrey Date: Fri, 24 Sep 2021 12:03:23 +0200 Subject: [PATCH] [#12642] Can't send funds to multisig - Out of gas Signed-off-by: andrey --- src/status_im/ethereum/core.cljs | 10 ---------- src/status_im/signing/gas.cljs | 11 ++++------- src/status_im/wallet/choose_recipient/core.cljs | 4 ---- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/status_im/ethereum/core.cljs b/src/status_im/ethereum/core.cljs index c97f460f22..d6a551b0ca 100644 --- a/src/status_im/ethereum/core.cljs +++ b/src/status_im/ethereum/core.cljs @@ -1,7 +1,5 @@ (ns status-im.ethereum.core (:require [clojure.string :as string] - [status-im.ethereum.tokens :as tokens] - [status-im.utils.money :as money] ["web3-utils" :as utils])) (defn sha3 [s] @@ -127,14 +125,6 @@ (defn snt-symbol [db] (chain-keyword->snt-symbol (chain-keyword db))) -(def default-transaction-gas (money/bignumber 21000)) - -(defn estimate-gas [symbol] - (if (tokens/ethereum? symbol) - default-transaction-gas - ;; TODO(jeluard) Rely on estimateGas call - (.times ^js default-transaction-gas 5))) - (defn address= [address1 address2] (and address1 address2 (= (normalized-hex address1) diff --git a/src/status_im/signing/gas.cljs b/src/status_im/signing/gas.cljs index 5afe01a7ee..fc7a631ea3 100644 --- a/src/status_im/signing/gas.cljs +++ b/src/status_im/signing/gas.cljs @@ -366,10 +366,7 @@ (re-frame/reg-fx :signing/update-estimated-gas (fn [{:keys [obj success-event error-event]}] - (if (nil? (:data obj)) - (re-frame/dispatch [success-event (money/bignumber 21000)]) - (json-rpc/call - {:method "eth_estimateGas" - :params [obj] - :on-success #(re-frame/dispatch [success-event %]) - :on-error #(re-frame/dispatch [error-event %])})))) + (json-rpc/call {:method "eth_estimateGas" + :params [obj] + :on-success #(re-frame/dispatch [success-event %]) + :on-error #(re-frame/dispatch [error-event %])}))) diff --git a/src/status_im/wallet/choose_recipient/core.cljs b/src/status_im/wallet/choose_recipient/core.cljs index deef821f0b..ce48523a9d 100644 --- a/src/status_im/wallet/choose_recipient/core.cljs +++ b/src/status_im/wallet/choose_recipient/core.cljs @@ -25,10 +25,6 @@ (defn- find-address-name [db address] (:name (contact.db/find-contact-by-address (:contacts/contacts db) address))) -(defn use-default-eth-gas [fx] - (assoc-in fx [:db :wallet :send-transaction :gas] - ethereum/default-transaction-gas)) - (fx/defn set-recipient {:events [:wallet.send/set-recipient]} [{:keys [db]} address]