mirror of
https://github.com/status-im/open-bounty.git
synced 2025-02-03 13:14:34 +00:00
Configurable blacklist for tokens
This commit is contained in:
parent
7ff641685f
commit
8610760938
5
env/dev/resources/config.edn
vendored
5
env/dev/resources/config.edn
vendored
@ -41,4 +41,7 @@
|
||||
:hubspot-contact-create-enabled false
|
||||
|
||||
;; needeed when :hubspot-contact-create-enabled
|
||||
:hubspot-api-key "xxxxxxx-xxxx-x-xxxx-xxxx"}
|
||||
:hubspot-api-key "xxxxxxx-xxxx-x-xxxx-xxxx"
|
||||
|
||||
;; used for blacklisting tokens from token registry data
|
||||
:token-blacklist #{}}
|
||||
|
@ -6,13 +6,21 @@
|
||||
|
||||
(def token-data-atom (atom {}))
|
||||
|
||||
(defn token-blacklisted?
|
||||
[tla]
|
||||
(let [blacklist (env :token-blacklist #{})]
|
||||
(blacklist tla)))
|
||||
|
||||
|
||||
(defn update-data []
|
||||
(let [test-data (env :testnet-token-data)
|
||||
token-data
|
||||
(if (and (env :on-testnet true)
|
||||
test-data)
|
||||
test-data
|
||||
(token-reg/load-parity-tokenreg-data))]
|
||||
(into {}
|
||||
(filter (fn [[tla _]] (not (token-blacklisted? tla)))
|
||||
(token-reg/load-parity-tokenreg-data))))]
|
||||
(reset! token-data-atom token-data)))
|
||||
|
||||
(mount/defstate
|
||||
|
Loading…
x
Reference in New Issue
Block a user