Use provided :gas value in send-transaction if given

This commit is contained in:
Teemu Patja 2017-06-06 21:35:12 +03:00
parent 943b0bfdac
commit 8a8f531733
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
1 changed files with 6 additions and 4 deletions

View File

@ -65,13 +65,15 @@
(defn send-transaction
[from to value & [params]]
(let [gas (estimate-gas from to value params)
(let [
args (merge params
{:from from
:value value
:gas gas}
:value value}
(when-not (nil? (gas-price))
{:gasPrice gas-price}))]
{:gasPrice gas-price})
(when-not (contains? params :gas)
{:gas
(estimate-gas from to value params)}))]
(log/debug "gas:" gas)
(log/debug "args:" args)
(eth-rpc