From 8a8f531733c86ee8655f9058a3b9785b710e699a Mon Sep 17 00:00:00 2001 From: Teemu Patja Date: Tue, 6 Jun 2017 21:35:12 +0300 Subject: [PATCH] Use provided :gas value in send-transaction if given --- src/clj/commiteth/eth/core.clj | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/clj/commiteth/eth/core.clj b/src/clj/commiteth/eth/core.clj index af15098..1ba4a61 100644 --- a/src/clj/commiteth/eth/core.clj +++ b/src/clj/commiteth/eth/core.clj @@ -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