feat: move eth_call to status-go #13323 (#13481)

This commit is contained in:
flexsurfer 2022-06-15 11:06:45 +02:00 committed by GitHub
parent a141c75634
commit 08fa0e6db9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 27 deletions

View File

@ -1,7 +1,6 @@
(ns status-im.ethereum.json-rpc
(:require [clojure.string :as string]
[re-frame.core :as re-frame]
[status-im.ethereum.abi-spec :as abi-spec]
[status-im.native-module.core :as status]
[status-im.utils.types :as types]
[status-im.utils.utils :as utils]
@ -40,23 +39,6 @@
(.-result response-js)
(types/js->clj (.-result response-js)))))))))))
(defn eth-call
[{:keys [contract method params outputs on-success block]
:or {block "latest" params []}
:as arg}]
(call {:method "eth_call"
:params [{:to contract
:data (abi-spec/encode method params)}
(if (int? block)
(abi-spec/number-to-hex block)
block)]
:on-success
(if outputs
#(on-success (abi-spec/decode % outputs))
on-success)
:on-error
(on-error-retry eth-call arg)}))
(re-frame/reg-fx
::call
(fn [params]

View File

@ -445,15 +445,6 @@
{:db (update db :signing/queue conj (normalize-tx-obj db tx))}
(check-queue)))
(fx/defn eth-transaction-call
"Prepares tx-obj for contract call and show signing sheet"
[cofx {:keys [contract method params on-result on-error from]}]
(sign cofx {:tx-obj {:to contract
:data (abi-spec/encode method params)
:from from}
:on-result on-result
:on-error on-error}))
(fx/defn sign-transaction-button-clicked-from-chat
{:events [:wallet.ui/sign-transaction-button-clicked-from-chat]}
[{:keys [db] :as cofx} {:keys [to amount from token]}]