added SPANK token, #5387 fixed issue with token contract address case sensitivity
Signed-off-by: Goran Jovic <goranjovic@gmail.com>
This commit is contained in:
parent
694a0a37d2
commit
ef2d0fd4d0
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
Binary file not shown.
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 7.5 KiB |
|
@ -19,7 +19,8 @@
|
|||
[status-im.native-module.core :as status]
|
||||
[status-im.utils.ethereum.tokens :as tokens]
|
||||
[status-im.constants :as constants]
|
||||
[status-im.utils.datetime :as datetime])
|
||||
[status-im.utils.datetime :as datetime]
|
||||
[clojure.string :as string])
|
||||
(:refer-clojure :exclude [name symbol]))
|
||||
|
||||
(defn name [web3 contract cb]
|
||||
|
@ -161,7 +162,7 @@
|
|||
args {:jsonrpc "2.0"
|
||||
:id 2
|
||||
:method constants/web3-get-logs
|
||||
:params [{:address contracts
|
||||
:params [{:address (map string/lower-case contracts)
|
||||
:fromBlock "0x0"
|
||||
:topics [constants/event-transfer-hash
|
||||
(add-padding from)
|
||||
|
|
|
@ -367,6 +367,10 @@
|
|||
:name "Domraider"
|
||||
:address "0x9af4f26941677c706cfecf6d3379ff01bb85d5ab"
|
||||
:decimals 8}
|
||||
{:symbol :SPANK
|
||||
:name "SPANK"
|
||||
:address "0x42d6622deCe394b54999Fbd73D108123806f6a18"
|
||||
:decimals 18}
|
||||
;; NOTE(goranjovic) : the following three tokens are removed from the Manage Assets list
|
||||
;; and automatically removed from user's selection by a migration. However, we still need
|
||||
;; them listed here in order to correctly display any previous transactions the user had
|
||||
|
@ -404,7 +408,8 @@
|
|||
[{:name "Status Test Token"
|
||||
:symbol :STT
|
||||
:decimals 18
|
||||
:address "0xc55cf4b03948d7ebc8b9e8bad92643703811d162"}
|
||||
;;NOTE(goranjovic): intentionally checksummed for purposes of testing
|
||||
:address "0xc55cF4B03948D7EBc8b9E8BAD92643703811d162"}
|
||||
{:name "Handy Test Token"
|
||||
:symbol :HND
|
||||
:decimals 0
|
||||
|
@ -451,7 +456,8 @@
|
|||
(some #(when (= symbol (:symbol %)) %) (tokens-for chain)))
|
||||
|
||||
(defn address->token [chain address]
|
||||
(some #(when (= address (:address %)) %) (tokens-for chain)))
|
||||
(some #(when (= (string/lower-case address)
|
||||
(string/lower-case (:address %))) %) (tokens-for chain)))
|
||||
|
||||
(defn asset-for [chain symbol]
|
||||
(if (= (:symbol ethereum) symbol)
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
(eip681/generate-erc20-uri "0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7" {:symbol :SNT :value 5 :gas 10000 :gasPrice 10000})))
|
||||
(is (= "ethereum:0x744d70fdbe2ba4cf95131626614a1763df805b9e/transfer?uint256=5&address=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7"
|
||||
(eip681/generate-erc20-uri "0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7" {:symbol :SNT :chain-id 1 :value 5})))
|
||||
(is (= "ethereum:0xc55cf4b03948d7ebc8b9e8bad92643703811d162@3/transfer?uint256=5&address=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7"
|
||||
(is (= "ethereum:0xc55cF4B03948D7EBc8b9E8BAD92643703811d162@3/transfer?uint256=5&address=0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7"
|
||||
(eip681/generate-erc20-uri "0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7" {:symbol :STT :chain-id 3 :value 5}))))
|
||||
|
||||
(deftest generate-uri
|
||||
|
@ -57,7 +57,7 @@
|
|||
(let [uri "ethereum:0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7@3?value=1&gas=100"
|
||||
{:keys [address] :as params} (eip681/parse-uri uri)]
|
||||
(is (= uri (eip681/generate-uri address (dissoc params :address)))))
|
||||
(let [uri "ethereum:0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7@3/transfer?uint256=5&address=0xc55cf4b03948d7ebc8b9e8bad92643703811d162"
|
||||
(let [uri "ethereum:0x89205a3a3b2a69de6dbf7f01ed13b2108b2c43e7@3/transfer?uint256=5&address=0xc55cF4B03948D7EBc8b9E8BAD92643703811d162"
|
||||
{:keys [address] :as params} (eip681/parse-uri uri)]
|
||||
(is (= uri (eip681/generate-uri address (dissoc params :address))))))
|
||||
|
||||
|
|
Loading…
Reference in New Issue