mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-17 03:47:58 +00:00
eth: Adjust format-param to prepend "0x";
use format-param in get-transaction-receipt fix execute fn to properly invoke get-signed-tx
This commit is contained in:
parent
b1b28db640
commit
5fd22660d2
@ -132,15 +132,15 @@
|
|||||||
[account digits]
|
[account digits]
|
||||||
(hex->eth (get-balance-hex account) digits))
|
(hex->eth (get-balance-hex account) digits))
|
||||||
|
|
||||||
(defn get-transaction-receipt
|
|
||||||
[hash]
|
|
||||||
(eth-rpc "eth_getTransactionReceipt" [hash]))
|
|
||||||
|
|
||||||
(defn- format-param
|
(defn- format-param
|
||||||
[param]
|
[param]
|
||||||
(if (number? param)
|
(if (number? param)
|
||||||
(format "%064x" param)
|
(format "%064x" param)
|
||||||
(clojure.string/replace (format "%64s" (subs param 2)) " " "0")))
|
(clojure.string/replace (format "0x%64s" (subs param 2)) " " "0")))
|
||||||
|
|
||||||
|
(defn get-transaction-receipt
|
||||||
|
[hash]
|
||||||
|
(eth-rpc "eth_getTransactionReceipt" [(format-param hash)]))
|
||||||
|
|
||||||
(defn format-call-params
|
(defn format-call-params
|
||||||
[method-id & params]
|
[method-id & params]
|
||||||
@ -166,12 +166,12 @@
|
|||||||
(merge {:to contract}))
|
(merge {:to contract}))
|
||||||
gas (if gas-limit gas-limit
|
gas (if gas-limit gas-limit
|
||||||
(estimate-gas from contract value params))
|
(estimate-gas from contract value params))
|
||||||
params (cond-> (assoc params :gas gas)
|
params (if (offline-signing?)
|
||||||
(offline-signing?)
|
|
||||||
(web3j/get-signed-tx (biginteger gas-price)
|
(web3j/get-signed-tx (biginteger gas-price)
|
||||||
(hex->big-integer gas)
|
(hex->big-integer gas)
|
||||||
contract
|
contract
|
||||||
data))]
|
data)
|
||||||
|
(assoc params :gas gas))]
|
||||||
(if (offline-signing?)
|
(if (offline-signing?)
|
||||||
(eth-rpc
|
(eth-rpc
|
||||||
"eth_sendRawTransaction"
|
"eth_sendRawTransaction"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user