[Fixes: #10777] Always convert value to string
When calling `SendTransaction` sometimes the value would be a string (most cases), sometimes the value would instead big a `BigInt`, which would be serialized to an integer, and status-go would be unable to parse it as it expects values to be a string. This commit makes sure that values are always serialized as string before sending them over. Signed-off-by: Andrea Maria Piana <andrea.maria.piana@gmail.com>
This commit is contained in:
parent
1b4dcb7103
commit
8748280279
|
@ -232,7 +232,9 @@
|
||||||
{:events [:sign/send-transaction-message]}
|
{:events [:sign/send-transaction-message]}
|
||||||
[cofx chat-id value contract transaction-hash signature]
|
[cofx chat-id value contract transaction-hash signature]
|
||||||
{::json-rpc/call [{:method (json-rpc/call-ext-method "sendTransaction")
|
{::json-rpc/call [{:method (json-rpc/call-ext-method "sendTransaction")
|
||||||
:params [chat-id value contract transaction-hash
|
;; We make sure `value` is serialized as string, and not
|
||||||
|
;; as an integer or big-int
|
||||||
|
:params [chat-id (str value) contract transaction-hash
|
||||||
(or (:result (types/json->clj signature))
|
(or (:result (types/json->clj signature))
|
||||||
(ethereum/normalized-hex signature))]
|
(ethereum/normalized-hex signature))]
|
||||||
:on-success
|
:on-success
|
||||||
|
@ -512,4 +514,4 @@
|
||||||
(when (and from nonce)
|
(when (and from nonce)
|
||||||
(sign cofx {:tx-obj (-> tx
|
(sign cofx {:tx-obj (-> tx
|
||||||
(select-keys [:from :to :value :input :gas :nonce :hash])
|
(select-keys [:from :to :value :input :gas :nonce :hash])
|
||||||
(clojure.set/rename-keys {:input :data}))})))
|
(clojure.set/rename-keys {:input :data}))})))
|
||||||
|
|
Loading…
Reference in New Issue