mirror of
https://github.com/status-im/status-react.git
synced 2025-03-01 19:10:52 +00:00
fix faucet url formatting
This commit is contained in:
parent
47c4b9014f
commit
af052d2c65
@ -41,9 +41,8 @@
|
|||||||
:to "me"}]))
|
:to "me"}]))
|
||||||
(log/debug "ignoring command: " command))))))
|
(log/debug "ignoring command: " command))))))
|
||||||
|
|
||||||
(def faucet-base-url->url
|
(defn faucet-base-url->url [url]
|
||||||
{"http://faucet.ropsten.be:3001" "http://faucet.ropsten.be:3001/donate/0x%s"
|
(str url "/donate/0x%s"))
|
||||||
"http://46.101.129.137:3001" "http://46.101.129.137:3001/donate/0x%s"})
|
|
||||||
|
|
||||||
(defn- faucet-response-event [message-id content]
|
(defn- faucet-response-event [message-id content]
|
||||||
[:received-message
|
[:received-message
|
||||||
@ -76,8 +75,8 @@
|
|||||||
(fn [{:keys [db random-id]} {:keys [params id]}]
|
(fn [{:keys [db random-id]} {:keys [params id]}]
|
||||||
(let [{:accounts/keys [accounts current-account-id]} db
|
(let [{:accounts/keys [accounts current-account-id]} db
|
||||||
current-address (get-in accounts [current-account-id :address])
|
current-address (get-in accounts [current-account-id :address])
|
||||||
faucet-url (get faucet-base-url->url (:url params))]
|
faucet-url (faucet-base-url->url (:url params))]
|
||||||
{:http-get {:url (gstring/format faucet-url current-address)
|
{:http-get {:url (gstring/format faucet-url current-address)
|
||||||
:success-event-creator (fn [_]
|
:success-event-creator (fn [_]
|
||||||
(faucet-response-event
|
(faucet-response-event
|
||||||
random-id
|
random-id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user