Skip to content
This repository has been archived by the owner on Dec 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #25 from district0x/fix_create_web3
Browse files Browse the repository at this point in the history
Fix create-web3 and contract-get-data
  • Loading branch information
ginesdt authored Oct 26, 2022
2 parents 3463035 + c1e53e2 commit d003f15
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/cljs_web3_next/core.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@
"
([url]
(create-web3 (default-web3) url))
([url provider]
([provider url]
(cond
(not (nil? provider)) (new Web3 provider)
(clojure.string/starts-with? "http" url) (http-provider url)
Expand Down
8 changes: 3 additions & 5 deletions src/cljs_web3_next/eth.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,8 @@
(unsubscribe filter (first args)))


;; DEPRECATED
;; Use (encode-abi ) instead
(defn contract-get-data
"Gets binary data of a contract method call.
Expand All @@ -341,11 +343,7 @@
user> `(web3-eth/contract-call ContractInstance :multiply 5)`
25"
[contract-instance method & args]
(let [method-name (web3-helpers/camel-case (name method))
method-fn (oget+ contract-instance method-name)]
(if method-fn
(ocall method-fn "getData" args)
(throw (str "Method: " method-name " was not found in object.")))))
(encode-abi contract-instance method args))


;; DEPRECATED
Expand Down

0 comments on commit d003f15

Please sign in to comment.