 (ns status-im.test.chat.commands.impl.transactions
   (:require [cljs.test :refer-macros [deftest is testing]]
+            [status-im.i18n :as i18n]
             [status-im.chat.commands.impl.transactions :as transactions]
             [status-im.chat.commands.protocol :as protocol]))
 

           #{:asset :amount})))
  (testing "Parameters validation"
    (is (= (protocol/validate personal-send-command {:asset "TST"} cofx)
           {:title       "Invalid Asset"
            :description "Unknown token - TST"}))
    (is (= (protocol/validate personal-send-command {:asset "SNT"} cofx)
           {:title       "Amount"
            :description "Amount must be specified"}))
    (is (= (protocol/validate personal-send-command {:asset "SNT" :amount "a"} cofx)
           {:title       "Amount"
            :description "Amount is not valid number"}))
    (is (= (protocol/validate personal-send-command {:asset "ETH" :amount "0.54354353454353453453454353453445345545"} cofx)
           {:title       "Amount"
            :description "Max number of decimals is 18"}))
    (is (= (protocol/validate personal-send-command {:asset "ETH" :amount "0.01"} cofx)
           nil)))
  (testing "Yielding control prefills wallet"

           #{:asset :amount})))
  (testing "Parameters validation"
    (is (= (protocol/validate personal-request-command {:asset "TST"} cofx)
           {:title       (i18n/label :t/send-request-invalid-asset)
            :description (i18n/label :t/send-request-unknown-token {:asset "TST"})}))
    (is (= (protocol/validate personal-request-command {:asset "SNT"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-must-be-specified)}))
    (is (= (protocol/validate personal-request-command {:asset "SNT" :amount "a"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "ETH" :amount "0,1Aaa"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "ETH" :amount "1-45"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "SNT" :amount "1$#@8"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "SNT" :amount "20,"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "SNT" :amount "20."} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-invalid-number)}))
    (is (= (protocol/validate personal-request-command {:asset "ETH" :amount "0.54354353454353453453454353453445345545"} cofx)
           {:title       (i18n/label :t/send-request-amount)
            :description (i18n/label :t/send-request-amount-max-decimals {:asset-decimals 18})}))
    (is (= (protocol/validate personal-request-command {:asset "ETH" :amount "0.01"} cofx)
           nil))))
