Compare commits

..
215 changed files with 1211 additions and 4156 deletions
-21
View File
@@ -1,21 +0,0 @@
(ns cljs.test
(:require [clj-kondo.hooks-api :as hooks]))
(defn deftest
"Verify test name passed to `cljs.test/deftest` is suffixed with -test and not
prefixed with test-."
[{:keys [node]}]
(let [[_ test-name-node & _] (:children node)
test-name (str (hooks/sexpr test-name-node))]
(when (and (hooks/token-node? test-name-node)
(or (not (re-find #"^.*-test$" test-name))
(re-find #"^test-.*$" test-name)))
(hooks/reg-finding! (assoc (meta test-name-node)
:message "Test name should be suffixed with -test"
:type :status-im.linter/inconsistent-test-name)))))
(comment
;; Invalid
(deftest {:node (hooks/parse-string "(deftest foo-tes (println :hello))")})
(deftest {:node (hooks/parse-string "(deftest test-foo-test (println :hello))")})
)
+2 -5
View File
@@ -4,8 +4,5 @@
test-helpers.component/get-all-by-translation-text utils.i18n/label
test-helpers.component/get-by-translation-text utils.i18n/label
test-helpers.component/query-all-by-translation-text utils.i18n/label
test-helpers.component/query-by-translation-text utils.i18n/label
cljs.test/deftest cljs.test/deftest}}
:linters {:status-im.linter/invalid-translation-keyword {:level :error}
:status-im.linter/inconsistent-test-name {:level :error}}}
test-helpers.component/query-by-translation-text utils.i18n/label}}
:linters {:status-im.linter/invalid-translation-keyword {:level :error}}}
-3
View File
@@ -83,9 +83,6 @@ shim.js
figwheel_server.log
.nrepl-port
# FlowStorm (Clojure debugger)
repl-client-debug
# Lein
#
.lein-failures
-13
View File
@@ -401,17 +401,6 @@ test-component: ##@test Run component tests once in NodeJS
yarn shadow-cljs compile component-test && \
jest --clearCache && jest --config=test/jest/jest.config.js --testEnvironment node
# Reference: https://flow-storm.github.io/flow-storm-debugger/user_guide.html#_debugging_react_native_applications
run-flow-storm: export SHADOW_CLJS_BUILD_ID := :mobile
run-flow-storm: export TARGET := clojure
run-flow-storm: export GDK_DPI_SCALE := 1.0
run-flow-storm: ##@run Start FlowStorm debugger
clj -Sforce -Sdeps '{:deps {com.github.jpmonettas/flow-storm-dbg {:mvn/version "3.7.5"}}}' \
-X flow-storm.debugger.main/start-debugger \
:port 7888 \
:repl-type :shadow \
:build-id $(SHADOW_CLJS_BUILD_ID)
#--------------
# Other
#--------------
@@ -434,13 +423,11 @@ android-clean: ##@prepare Clean Gradle state
rm -rf ~/.gradle
android-ports: export FLOWSTORM_PORT := 7722
android-ports: export TARGET := android-sdk
android-ports: ##@other Add proxies to Android Device/Simulator
adb reverse tcp:8081 tcp:8081 && \
adb reverse tcp:3449 tcp:3449 && \
adb reverse tcp:4567 tcp:4567 && \
adb reverse tcp:$(FLOWSTORM_PORT) tcp:$(FLOWSTORM_PORT) && \
adb forward tcp:5561 tcp:5561
android-devices: export TARGET := android-sdk
+1
View File
@@ -123,6 +123,7 @@ pipeline {
post {
always { script {
nix.shell('nix-store --optimize', pure: false)
nix.shell('nix/scripts/clean.sh', pure: false)
} }
}
}
-33
View File
@@ -20,39 +20,6 @@ A server will be started at http://localhost:4567. It might show "not connected"
More details about re-frisk are on the [project page](https://github.com/flexsurfer/re-frisk).
## Debugging with FlowStorm
[FlowStorm](http://www.flow-storm.org/) is a free and open-source time-travel
debugger for Clojure and ClojureScript. It is capable of recording almost any
code execution path in the Status' mobile app.
FlowStorm is independent of editor/IDE, but a tighter [integration with
Emacs](https://github.com/jpmonettas/cider-storm) is available.
If you are developing with Android, run `make android-ports` first. If you are
behind a firewall, allow TCP traffic on port `7722`, then:
```bash
make run-flow-storm
```
You will know FlowStorm is correctly running if you see the status bar with
green `REPL` and `RUNTIME` indicators.
With FlowStorm running, you can now add `#trace` on any top-level form, reload
the code, or evaluate the traced form in the REPL, and FlowStorm will start
recording data. Avoid `#rtrace` (with `r`) because it can cause massive spikes
in CPU which will make the app hang and you might need to forcefully kill
processes.
```clojure
#trace ; => Add this line to tell FlowStorm to instrument the function.
(defn say-hello []
(str "Hello world"))
```
There are other ways to debug, but this is a good start.
## Enabling debug logs
Calls to `log/debug` will not be printed to the console by default. It can be enabled under "Advanced settings" in the app:
+27 -486
View File
@@ -1,13 +1,4 @@
[
{
"path": "aopalliance/aopalliance/1.0/aopalliance-1.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "0235ba8b489512805ac13a8f9ea77a1ca5ebe3e8",
"sha256": "023a6xwv1kd9c4dq9jrsbvvj6398hgbr302w7h8kzkgd1xkyrp8a"
}
},
{
"path": "args4j/args4j/2.33/args4j-2.33",
"host": "https://repo1.maven.org/maven2",
@@ -99,20 +90,29 @@
},
{
"path": "cider/cider-nrepl/0.31.0/cider-nrepl-0.31.0",
"path": "cider/cider-nrepl/0.44.0/cider-nrepl-0.44.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "1f28a4a834a7a46cf24def971b1a705a6795c73a",
"sha256": "0h4pyzy8rzzh567khvimw2cs8jr640kqxgaxvbfx1s5yfp56fka2"
"sha1": "c3d3a729beaa728d0ee6a3678a48c880b6bc95f1",
"sha256": "0klcppvydxlx9ji376mvz40yv3s7awq6p9yd57wigpfy4m2yv0w6"
}
},
{
"path": "cider/piggieback/0.4.1/piggieback-0.4.1",
"path": "cider/orchard/0.21.0/orchard-0.21.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "0a02a3e2ecd7a126ab60d8a44793342f20ced79b",
"sha256": "142vl5np33akcrnn6pksi0rjfsmmi528villxsj6cwcndvybiw4m"
"sha1": "073617f16a132c7f20608d971244753d4e704129",
"sha256": "1n2afbyhw9x9kvfna4m4x6n6pwjiqsqcayql644bw2932i1isrkj"
}
},
{
"path": "cider/piggieback/0.5.2/piggieback-0.5.2",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "ecfd5c286a85db3f059e75c37fca5722d9e26f79",
"sha256": "1ps9yf3cxmlm447hqkidjb5xry90n0wl3jk0jn28fagq31lzylkl"
}
},
@@ -161,42 +161,6 @@
}
},
{
"path": "com/cognitect/aws/api/0.8.612/api-0.8.612",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "6bf53a6a318693e086bec6246a63b193f981b386",
"sha256": "174csbi2whfqqw1pnna1a7pxwfa3q39marrs0sqjrwsvzqkwakvl"
}
},
{
"path": "com/cognitect/aws/endpoints/1.1.12.321/endpoints-1.1.12.321",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "3bec2d7c7fe3b22b709e3ef8244d8f34406f3a8d",
"sha256": "18mz7n8f07ki35h5v7v60rw9fh02fayda9l9cfa7bjy7w4a1yl1f"
}
},
{
"path": "com/cognitect/aws/s3/822.2.1145.0/s3-822.2.1145.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "0c4d7c1bc3baa4a05c7ebdf6b672259f56a16d7e",
"sha256": "0fhgikpn4ns494gaq1y8gch95silx1snvkg1n62ysnf1zyk42ckh"
}
},
{
"path": "com/cognitect/http-client/1.0.115/http-client-1.0.115",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "1a84a105c286d00557cc6c3e96932e40439b387a",
"sha256": "0k2dnyx4jywgzfizz9i9yb2v04cvzbqvyhyp2nv1pll0blv8h38v"
}
},
{
"path": "com/cognitect/transit-clj/1.0.329/transit-clj-1.0.329",
"host": "https://repo1.maven.org/maven2",
@@ -269,24 +233,6 @@
}
},
{
"path": "com/github/jpmonettas/flow-storm-inst/3.7.5/flow-storm-inst-3.7.5",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "c76d1e07f3914d3f1c669d1aadc469037e7cff00",
"sha256": "0xzygzibqslhsl90zxfm6k2izmvzrm5wixrb0xzfcihf9bwn9nya"
}
},
{
"path": "com/github/jpmonettas/hansel/0.1.78/hansel-0.1.78",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "a4d916f9882f748201003880d2ee440e448b912f",
"sha256": "0d3x5pab6p4mykmxhspz17w4zwcp52g7gmzma3vqsn4ym24xr5qm"
}
},
{
"path": "com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6",
"host": "https://repo1.maven.org/maven2",
@@ -359,15 +305,6 @@
}
},
{
"path": "com/google/inject/guice/4.2.2/guice-4.2.2-no_aop",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "fa13659f9128f4c011c8e1d06f137083b4876377",
"sha256": "1zxg79l9jv86ar71pmw3abr43dgrgjz2hwbzifrx5909hsr5ykqg"
}
},
{
"path": "com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3",
"host": "https://repo1.maven.org/maven2",
@@ -566,15 +503,6 @@
}
},
{
"path": "io/github/clojure/tools.build/0.9.4/tools.build-0.9.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "5d0a9ffeae76e1afa5b14ecaf6faffadea77dffd",
"sha256": "1vivf7p05f30bcsiqn175df9vlxfvfpyx0z1snnfgin5mf6nhniq"
}
},
{
"path": "io/methvin/directory-watcher/0.17.1/directory-watcher-0.17.1",
"host": "https://repo1.maven.org/maven2",
@@ -602,15 +530,6 @@
}
},
{
"path": "javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "934c04d3cfef185a8008e7bf34331b79730a9d43",
"sha256": "16xbi6mz75r1maw116njab6ln7hm9mhwrxshav4msmfdbccsajz0"
}
},
{
"path": "javax/annotation/jsr250-api/1.0/jsr250-api-1.0",
"host": "https://repo1.maven.org/maven2",
@@ -620,15 +539,6 @@
}
},
{
"path": "javax/inject/javax.inject/1/javax.inject-1",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "6975da39a7040257bd51d21a231b76c915872d38 /home/maven/repository-staging/to-ibiblio/maven2/javax/inject/javax.inject/1/javax.inject-1.jar",
"sha256": "1zz7gnahy2352345411rjlhsf64ikkc6z49dqcv1cj0clm271iwi"
}
},
{
"path": "javax/servlet/servlet-api/2.5/servlet-api-2.5",
"host": "https://repo1.maven.org/maven2",
@@ -674,6 +584,15 @@
}
},
{
"path": "mx/cider/logjam/0.1.1/logjam-0.1.1",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "0e9a1c08d4e80e46be8ed8b8cb894bef5e56f39d",
"sha256": "1p6hnacyfjn365r0li639lf9fnqpgx1cs7jz7066cn566wjw46az"
}
},
{
"path": "net/cgrand/macrovich/0.2.1/macrovich-0.2.1",
"host": "https://repo.clojars.org",
@@ -702,11 +621,11 @@
},
{
"path": "nrepl/nrepl/1.0.0/nrepl-1.0.0",
"path": "nrepl/nrepl/1.1.0/nrepl-1.1.0",
"host": "https://repo.clojars.org",
"jar": {
"sha1": "f47774c43493efdc879d36b95ebd67ea0d9c890a",
"sha256": "1fx5ssmixgqmklliw0ng8fjz41kkhys56x8dbwv9yqrfzws9f2x3"
"sha1": "69f138d4a778c199e5d72446ca25998222ba0862",
"sha256": "0n29xczgwpqv98vz36sdic98mf07dmzhjawlxd63p2s2zafkp1ss"
}
},
@@ -737,204 +656,6 @@
}
},
{
"path": "org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c6842c86792ff03b9f1d1fe2aab8dc23aa6c6f0e",
"sha256": "0kp9qwqmqp45axxddf9h8ai9yap2j86dl4il366py0vc902dj6fr"
}
},
{
"path": "org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "e5f6cae5ca7ecaac1ec2827a9e2d65ae2869cada",
"sha256": "0hzp3vrxbnyc6w86v671wp0zchb634rgrwwcc00m0skcarm05sbg"
}
},
{
"path": "org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "7f2e0c573eaa7a74bac2e89b359e1f73d92a0a1d",
"sha256": "0hmi3c0p5a2m2v53i0fqmdqm3677q2fz6n6ydpwi16j9ih4fvfiw"
}
},
{
"path": "org/apache/maven/maven-artifact/3.8.6/maven-artifact-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "1637b7e8fc392e389752e79b827b883629285626",
"sha256": "0ar5p715427zbqdl6bvkkr926s7xmp9vpc93m1v15qsgyp3a88ny"
}
},
{
"path": "org/apache/maven/maven-builder-support/3.8.6/maven-builder-support-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "4d22a3faa8880efef2e960bb8a00c2a0b351c46a",
"sha256": "1kll3ln7mx7mvbnc8s718fadcc1qckz7nxgqcfg0723fyd9rfg9x"
}
},
{
"path": "org/apache/maven/maven-core/3.8.6/maven-core-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f945f1f19452214d360d453d9357275313f1cfd9",
"sha256": "1qaqyrxr1b2sz6d6amllynxw8c6cviydy1k8pi6ghlalipd515a3"
}
},
{
"path": "org/apache/maven/maven-model/3.8.6/maven-model-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "8ad31867c493c63ac60a3fa42356a72d20f8457b",
"sha256": "1c129h6n5daibjksa652ywbzji0fy4pd53qwk46bvsp7s326v60k"
}
},
{
"path": "org/apache/maven/maven-model-builder/3.8.6/maven-model-builder-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "8323a726c657becbffc8ea807970935dde3e3903",
"sha256": "1fyf717l3aa1jzwq0qss2i4d1m1rrpg6chq0sw6fr5319vmp98sw"
}
},
{
"path": "org/apache/maven/maven-plugin-api/3.8.6/maven-plugin-api-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "4138e2e9b39f364902ac263888feb7b2407a298e",
"sha256": "02ppxjnx9zly3dq7hwvh3x7jsmapirhsfznl9grid7r185h7yc9c"
}
},
{
"path": "org/apache/maven/maven-repository-metadata/3.8.6/maven-repository-metadata-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c60a7640e1b829e60f8791b5edf3cf56a6556aca",
"sha256": "1zgasjbx3k0l3k7x2m2bkjsbgwnp5z3ywa4d8vmp46x85xk1y3m7"
}
},
{
"path": "org/apache/maven/maven-resolver-provider/3.8.6/maven-resolver-provider-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c6dadedc9f6b5c1c02d0a93afd1857460b0f501d",
"sha256": "1a9ymv2hy7509hgib75g95my1xh6i9l7pjzzl14l3a3b6kqapcgv"
}
},
{
"path": "org/apache/maven/maven-settings/3.8.6/maven-settings-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "9ba5114c6c61c66fbc6b93c73085dc5b15585524",
"sha256": "0qcakn4g2h68s4s8blllw2889bhiqs8cr5056ywj8i954yhyzp36"
}
},
{
"path": "org/apache/maven/maven-settings-builder/3.8.6/maven-settings-builder-3.8.6",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "e5c92138dffd1f9e5454cd8224cf8e18253b1803",
"sha256": "1f44w8kz8v8k8an2n3i6lk48pb6sgjal6lcprzywash5qn4khnar"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-api/1.8.2/maven-resolver-api-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "af6c5d8660e3c127c3987c385069d301848800a2",
"sha256": "0pziii8ys35i4zi0sxw652pd04d2chr3hilpagf0qqpnah2qdf7n"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-connector-basic/1.8.2/maven-resolver-connector-basic-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "013b77ee054cd269a7e14667419d202799db18a2",
"sha256": "0w7im7wimjlzsdnvwsfvbji2i9sjaqc9xydb86qk3l3mg3cg2cbn"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-impl/1.8.2/maven-resolver-impl-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "5f08b1e7d0bc89d8254cd46881a5e228c98303df",
"sha256": "0slzdrhjhxl41lghrg3b0cxj07zqmmgkf5kqh1g5hksbplyy00n7"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-named-locks/1.8.2/maven-resolver-named-locks-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "6d81987c220cdb9672f15a1f2ee3e4ba9f80d50f",
"sha256": "1wf3xzv4xd7d21km0328s519kivaw1953mc33yq0mpdyarwhb6il"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-spi/1.8.2/maven-resolver-spi-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "0d0768a341173c2ef88e8dbcab2f30ebfe7ef526",
"sha256": "111vahiwcbaa28w98ksy8q3r23m7gdkqrr4bpy2jxd3vrazaq0d3"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-transport-file/1.8.2/maven-resolver-transport-file-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "b9a7004de9850fe9dcff8325c3d51ef4e387ef70",
"sha256": "0li1332vq03w11wdbni52qgkl2k6qdhskmfsdycqdqh9xm7c3f4c"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-transport-http/1.8.2/maven-resolver-transport-http-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "dbc0b6f022c51857fb801ba135c30af056b4c071",
"sha256": "0q0hhvwwfilzkvrza6czv4qhvcjh9shxaych2yah0nd6kvmlslsh"
}
},
{
"path": "org/apache/maven/resolver/maven-resolver-util/1.8.2/maven-resolver-util-1.8.2",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "cfb9b2e4c71d2a819aa4519800c9687c74b71584",
"sha256": "0jkvz7z07qsyp4i8p36n6zb53vmkh765fj4d3q7p8rbhnc601k52"
}
},
{
"path": "org/apache/maven/shared/maven-shared-utils/3.3.4/maven-shared-utils-3.3.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f87a61adb1e12a00dcc6cc6005a51e693aa7c4ac",
"sha256": "1nkdvyywfzbpd2ikpcrqb3zbz71rxc9gdqzsp0j0s172l32xj9br"
}
},
{
"path": "org/babashka/sci/0.8.41/sci-0.8.41",
"host": "https://repo.clojars.org",
@@ -1025,15 +746,6 @@
}
},
{
"path": "org/clojure/data.int-map/1.2.1/data.int-map-1.2.1",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "9e7e4e17329ecd46e92384d9e8475d77800d204e",
"sha256": "055ip8l2y9004cydzz4i08p1ihlm5dz5fpknrln87ds9z9i5hiqh"
}
},
{
"path": "org/clojure/data.json/2.4.0/data.json-2.4.0",
"host": "https://repo1.maven.org/maven2",
@@ -1052,15 +764,6 @@
}
},
{
"path": "org/clojure/data.xml/0.2.0-alpha8/data.xml-0.2.0-alpha8",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "c3dd8907b0a63a67082bc3091e304d9e1676d4b0",
"sha256": "159spfgsn0grlfszzybycyrg6apmv2622aqgc5nc6m7ndm7hrcdm"
}
},
{
"path": "org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541",
"host": "https://repo1.maven.org/maven2",
@@ -1079,15 +782,6 @@
}
},
{
"path": "org/clojure/java.classpath/1.0.0/java.classpath-1.0.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "015d06d1b304ac23104333bc8492a11bcc2e87e4",
"sha256": "0vvxzv3vagwhx3zw4w30xhz2kxf1zbggnhn75kymqpja6080wkn1"
}
},
{
"path": "org/clojure/math.combinatorics/0.2.0/math.combinatorics-0.2.0",
"host": "https://repo1.maven.org/maven2",
@@ -1142,24 +836,6 @@
}
},
{
"path": "org/clojure/tools.deps/0.17.1297/tools.deps-0.17.1297",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "7f27f66575190ddd5a343a77bba6911b0b4ec620",
"sha256": "0mlf7k0s26v4dx25hmix79002ghzar7jynnvcm9pcp56dsg4k78n"
}
},
{
"path": "org/clojure/tools.gitlibs/2.5.190/tools.gitlibs-2.5.190",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f300f872ac84711ba6df61cbba923c515c289068",
"sha256": "1i3jqzgfqiysy7np21gwrds32aay6a5p1xfnc3xp1jv30nnqd4bs"
}
},
{
"path": "org/clojure/tools.logging/1.2.4/tools.logging-1.2.4",
"host": "https://repo1.maven.org/maven2",
@@ -1178,15 +854,6 @@
}
},
{
"path": "org/clojure/tools.namespace/1.4.4/tools.namespace-1.4.4",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "ba1078e3fe6ebc33119a7c09722afa9f708aef1f",
"sha256": "01b3v2mii51krravn2rh1b9ysg9ph0mlb9c2dfbv0k6mckynhy04"
}
},
{
"path": "org/clojure/tools.reader/1.3.7/tools.reader-1.3.7",
"host": "https://repo1.maven.org/maven2",
@@ -1196,114 +863,6 @@
}
},
{
"path": "org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "425ea8e534716b4bff1ea90f39bd76be951d651b",
"sha256": "0fi0x8dq1skmxy8w7yhij7kshxig592k31zxmlgddzwyb9f1nzws"
}
},
{
"path": "org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "8587e80fcb38e70b70fae8d5914b6376bfad6259",
"sha256": "0j9m9zbw152gdqvigwh2l922z4nrxzbdbgky86f7qy4zqig7rxsj"
}
},
{
"path": "org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "2f2147a6cc6a119a1b51a96f31d45c557f6244b9",
"sha256": "1b5c6ay7nbphafqs6h7apars9xis0j06011685cgkg5mx5y63qxx"
}
},
{
"path": "org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "25b919c664b79795ccde0ede5cee0fd68b544197",
"sha256": "0qi633bwjwwaadmsrzjg6i0abpxkkz7xzg34llz112bqw4n43ddk"
}
},
{
"path": "org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "f89c5080614ffd0764e49861895dbedde1b47237",
"sha256": "1szwmkvlw8jf4fcvprfwicc85gy4l81v1055vmv02y2c1jb3jcc7"
}
},
{
"path": "org/codehaus/plexus/plexus-utils/3.3.1/plexus-utils-3.3.1",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "9b41b2b76b1bfe3774411fe22f5868058a9fc822",
"sha256": "0aig48q1jihh02l2glj8wp1qi74a6llvkf9fklj4z2aspv6hymsb"
}
},
{
"path": "org/eclipse/jetty/jetty-client/9.4.48.v20220622/jetty-client-9.4.48.v20220622",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "fc2e953a7030045e1ca467d57e200856a170848e",
"sha256": "058x9p1k8r5miwyn2za86nz27mbnmnk956crfmi2jsyk004zx2bz"
}
},
{
"path": "org/eclipse/jetty/jetty-http/9.4.48.v20220622/jetty-http-9.4.48.v20220622",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "8cb235e70bda0c5e97a41e7ee0ea33ee7f5bcc6a",
"sha256": "0phpz22cj5n8950pdbb97fwbmr4f4l8h8lvh0kg8ya159j0196f9"
}
},
{
"path": "org/eclipse/jetty/jetty-io/9.4.48.v20220622/jetty-io-9.4.48.v20220622",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "b09b55209d0a304e542f779750a01f6914dc55e7",
"sha256": "0iwb1d3a18yl2x6sbawi2cl5k6d24gmx2rmj1fks01c96jh60bsd"
}
},
{
"path": "org/eclipse/jetty/jetty-util/9.4.48.v20220622/jetty-util-9.4.48.v20220622",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "7efc06f7ec0ff33d8c219bcc8c7415280c103669",
"sha256": "11rbr3mayczff851l34ccbmkpi71dzy2havrqalvxd54ki2gvji4"
}
},
{
"path": "org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "d4265dd4f0f1d7a06d80df5a5f475d5ff9c17140",
"sha256": "04ys5z436vd2m8ipn5fifmwbvpcif7250k9sc2yx5qfwph8416f5"
}
},
{
"path": "org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.5/org.eclipse.sisu.plexus-0.3.5",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "d71996bb2e536f966b3b70e647067fff3b73d32f",
"sha256": "1157yqjxvr24wpgy4zi4mnjpm3jjlmcmrmd7ywh6z0khdl4n2k3y"
}
},
{
"path": "org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA",
"host": "https://repo1.maven.org/maven2",
@@ -1313,15 +872,6 @@
}
},
{
"path": "org/java-websocket/Java-WebSocket/1.5.3/Java-WebSocket-1.5.3",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "9c26b6a6e732a1242db576a50dc3a12e446e2717",
"sha256": "0gvsbr49lr8ylv4k8gsnd9wyfc4gs5wr15klrmnyfmxnr4fw4vsd"
}
},
{
"path": "org/jboss/logging/jboss-logging/3.4.3.Final/jboss-logging-3.4.3.Final",
"host": "https://repo1.maven.org/maven2",
@@ -1385,15 +935,6 @@
}
},
{
"path": "org/slf4j/jcl-over-slf4j/1.7.36/jcl-over-slf4j-1.7.36",
"host": "https://repo1.maven.org/maven2",
"jar": {
"sha1": "d877e195a05aca4a2f1ad2ff14bfec1393af4b5e",
"sha256": "15ci04f0g0avrfih736hb6pg1jsfx5ciy4jx6qbjqxr3sa7wlmxb"
}
},
{
"path": "org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9",
"host": "https://repo1.maven.org/maven2",
+5 -56
View File
@@ -1,4 +1,3 @@
aopalliance/aopalliance/1.0/aopalliance-1.0.jar
args4j/args4j/2.33/args4j-2.33.jar
babashka/fs/0.2.16/fs-0.2.16.jar
bidi/bidi/2.1.6/bidi-2.1.6.jar
@@ -9,17 +8,14 @@ borkdude/edamame/1.3.23/edamame-1.3.23.jar
borkdude/sci.impl.reflector/0.0.1/sci.impl.reflector-0.0.1.jar
camel-snake-kebab/camel-snake-kebab/0.4.3/camel-snake-kebab-0.4.3.jar
cheshire/cheshire/5.11.0/cheshire-5.11.0.jar
cider/cider-nrepl/0.31.0/cider-nrepl-0.31.0.jar
cider/piggieback/0.4.1/piggieback-0.4.1.jar
cider/cider-nrepl/0.44.0/cider-nrepl-0.44.0.jar
cider/orchard/0.21.0/orchard-0.21.0.jar
cider/piggieback/0.5.2/piggieback-0.5.2.jar
clj-kondo/clj-kondo/2024.03.13/clj-kondo-2024.03.13.jar
cljs-bean/cljs-bean/1.9.0/cljs-bean-1.9.0.jar
clout/clout/2.1.2/clout-2.1.2.jar
com/andrewmcveigh/cljs-time/0.5.2/cljs-time-0.5.2.jar
com/bhauman/cljs-test-display/0.1.1/cljs-test-display-0.1.1.jar
com/cognitect/aws/api/0.8.612/api-0.8.612.jar
com/cognitect/aws/endpoints/1.1.12.321/endpoints-1.1.12.321.jar
com/cognitect/aws/s3/822.2.1145.0/s3-822.2.1145.0.jar
com/cognitect/http-client/1.0.115/http-client-1.0.115.jar
com/cognitect/transit-clj/1.0.329/transit-clj-1.0.329.jar
com/cognitect/transit-cljs/0.8.280/transit-cljs-0.8.280.jar
com/cognitect/transit-java/1.0.362/transit-java-1.0.362.jar
@@ -28,8 +24,6 @@ com/fasterxml/jackson/core/jackson-core/2.13.3/jackson-core-2.13.3.jar
com/fasterxml/jackson/dataformat/jackson-dataformat-cbor/2.13.3/jackson-dataformat-cbor-2.13.3.jar
com/fasterxml/jackson/dataformat/jackson-dataformat-smile/2.13.3/jackson-dataformat-smile-2.13.3.jar
com/github/javaparser/javaparser-core/3.25.3/javaparser-core-3.25.3.jar
com/github/jpmonettas/flow-storm-inst/3.7.5/flow-storm-inst-3.7.5.jar
com/github/jpmonettas/hansel/0.1.78/hansel-0.1.78.jar
com/google/auto/value/auto-value-annotations/1.6/auto-value-annotations-1.6.jar
com/google/code/findbugs/jsr305/3.0.2/jsr305-3.0.2.jar
com/google/code/gson/gson/2.9.1/gson-2.9.1.jar
@@ -38,7 +32,6 @@ com/google/errorprone/error_prone_annotations/2.15.0/error_prone_annotations-2.1
com/google/guava/failureaccess/1.0.1/failureaccess-1.0.1.jar
com/google/guava/guava/31.0.1-jre/guava-31.0.1-jre.jar
com/google/guava/listenablefuture/9999.0-empty-to-avoid-conflict-with-guava/listenablefuture-9999.0-empty-to-avoid-conflict-with-guava.jar
com/google/inject/guice/4.2.2/guice-4.2.2-no_aop.jar
com/google/j2objc/j2objc-annotations/1.3/j2objc-annotations-1.3.jar
com/google/javascript/closure-compiler-unshaded/v20230802/closure-compiler-unshaded-v20230802.jar
com/google/protobuf/protobuf-java/3.21.12/protobuf-java-3.21.12.jar
@@ -61,47 +54,23 @@ hiccup/hiccup/1.0.5/hiccup-1.0.5.jar
http-kit/http-kit/2.2.0/http-kit-2.2.0.jar
instaparse/instaparse/1.4.0/instaparse-1.4.0.jar
io/aviso/pretty/1.4.4/pretty-1.4.4.jar
io/github/clojure/tools.build/0.9.4/tools.build-0.9.4.jar
io/methvin/directory-watcher/0.17.1/directory-watcher-0.17.1.jar
io/replikativ/datalog-parser/0.2.25/datalog-parser-0.2.25.jar
io/undertow/undertow-core/2.3.10.Final/undertow-core-2.3.10.Final.jar
javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar
javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
javax/inject/javax.inject/1/javax.inject-1.jar
javax/servlet/servlet-api/2.5/servlet-api-2.5.jar
javax/xml/bind/jaxb-api/2.3.0/jaxb-api-2.3.0.jar
medley/medley/0.8.2/medley-0.8.2.jar
metosin/malli/0.13.0/malli-0.13.0.jar
mvxcvi/arrangement/2.1.0/arrangement-2.1.0.jar
mx/cider/logjam/0.1.1/logjam-0.1.1.jar
net/cgrand/macrovich/0.2.1/macrovich-0.2.1.jar
net/java/dev/jna/jna/5.12.1/jna-5.12.1.jar
nrepl/bencode/1.1.0/bencode-1.1.0.jar
nrepl/nrepl/1.0.0/nrepl-1.0.0.jar
nrepl/nrepl/1.1.0/nrepl-1.1.0.jar
nubank/matcher-combinators/3.8.8/matcher-combinators-3.8.8.jar
org/apache/ant/ant/1.10.11/ant-1.10.11.jar
org/apache/ant/ant-launcher/1.10.11/ant-launcher-1.10.11.jar
org/apache/commons/commons-lang3/3.12.0/commons-lang3-3.12.0.jar
org/apache/httpcomponents/httpclient/4.5.13/httpclient-4.5.13.jar
org/apache/httpcomponents/httpcore/4.4.15/httpcore-4.4.15.jar
org/apache/maven/maven-artifact/3.8.6/maven-artifact-3.8.6.jar
org/apache/maven/maven-builder-support/3.8.6/maven-builder-support-3.8.6.jar
org/apache/maven/maven-core/3.8.6/maven-core-3.8.6.jar
org/apache/maven/maven-model/3.8.6/maven-model-3.8.6.jar
org/apache/maven/maven-model-builder/3.8.6/maven-model-builder-3.8.6.jar
org/apache/maven/maven-plugin-api/3.8.6/maven-plugin-api-3.8.6.jar
org/apache/maven/maven-repository-metadata/3.8.6/maven-repository-metadata-3.8.6.jar
org/apache/maven/maven-resolver-provider/3.8.6/maven-resolver-provider-3.8.6.jar
org/apache/maven/maven-settings/3.8.6/maven-settings-3.8.6.jar
org/apache/maven/maven-settings-builder/3.8.6/maven-settings-builder-3.8.6.jar
org/apache/maven/resolver/maven-resolver-api/1.8.2/maven-resolver-api-1.8.2.jar
org/apache/maven/resolver/maven-resolver-connector-basic/1.8.2/maven-resolver-connector-basic-1.8.2.jar
org/apache/maven/resolver/maven-resolver-impl/1.8.2/maven-resolver-impl-1.8.2.jar
org/apache/maven/resolver/maven-resolver-named-locks/1.8.2/maven-resolver-named-locks-1.8.2.jar
org/apache/maven/resolver/maven-resolver-spi/1.8.2/maven-resolver-spi-1.8.2.jar
org/apache/maven/resolver/maven-resolver-transport-file/1.8.2/maven-resolver-transport-file-1.8.2.jar
org/apache/maven/resolver/maven-resolver-transport-http/1.8.2/maven-resolver-transport-http-1.8.2.jar
org/apache/maven/resolver/maven-resolver-util/1.8.2/maven-resolver-util-1.8.2.jar
org/apache/maven/shared/maven-shared-utils/3.3.4/maven-shared-utils-3.3.4.jar
org/babashka/sci/0.8.41/sci-0.8.41.jar
org/babashka/sci.impl.types/0.0.2/sci.impl.types-0.0.2.jar
org/checkerframework/checker-qual/3.12.0/checker-qual-3.12.0.jar
@@ -112,39 +81,20 @@ org/clojure/core.cache/1.0.225/core.cache-1.0.225.jar
org/clojure/core.memoize/1.0.253/core.memoize-1.0.253.jar
org/clojure/core.rrb-vector/0.1.2/core.rrb-vector-0.1.2.jar
org/clojure/core.specs.alpha/0.2.62/core.specs.alpha-0.2.62.jar
org/clojure/data.int-map/1.2.1/data.int-map-1.2.1.jar
org/clojure/data.json/2.4.0/data.json-2.4.0.jar
org/clojure/data.priority-map/1.1.0/data.priority-map-1.1.0.jar
org/clojure/data.xml/0.2.0-alpha8/data.xml-0.2.0-alpha8.jar
org/clojure/google-closure-library/0.0-20230227-c7c0a541/google-closure-library-0.0-20230227-c7c0a541.jar
org/clojure/google-closure-library-third-party/0.0-20230227-c7c0a541/google-closure-library-third-party-0.0-20230227-c7c0a541.jar
org/clojure/java.classpath/1.0.0/java.classpath-1.0.0.jar
org/clojure/math.combinatorics/0.2.0/math.combinatorics-0.2.0.jar
org/clojure/spec.alpha/0.3.218/spec.alpha-0.3.218.jar
org/clojure/test.check/1.1.1/test.check-1.1.1.jar
org/clojure/tools.analyzer/1.1.0/tools.analyzer-1.1.0.jar
org/clojure/tools.analyzer.jvm/1.2.2/tools.analyzer.jvm-1.2.2.jar
org/clojure/tools.cli/1.0.206/tools.cli-1.0.206.jar
org/clojure/tools.deps/0.17.1297/tools.deps-0.17.1297.jar
org/clojure/tools.gitlibs/2.5.190/tools.gitlibs-2.5.190.jar
org/clojure/tools.logging/1.2.4/tools.logging-1.2.4.jar
org/clojure/tools.macro/0.1.5/tools.macro-0.1.5.jar
org/clojure/tools.namespace/1.4.4/tools.namespace-1.4.4.jar
org/clojure/tools.reader/1.3.7/tools.reader-1.3.7.jar
org/codehaus/plexus/plexus-cipher/2.0/plexus-cipher-2.0.jar
org/codehaus/plexus/plexus-classworlds/2.6.0/plexus-classworlds-2.6.0.jar
org/codehaus/plexus/plexus-component-annotations/2.1.0/plexus-component-annotations-2.1.0.jar
org/codehaus/plexus/plexus-interpolation/1.26/plexus-interpolation-1.26.jar
org/codehaus/plexus/plexus-sec-dispatcher/2.0/plexus-sec-dispatcher-2.0.jar
org/codehaus/plexus/plexus-utils/3.3.1/plexus-utils-3.3.1.jar
org/eclipse/jetty/jetty-client/9.4.48.v20220622/jetty-client-9.4.48.v20220622.jar
org/eclipse/jetty/jetty-http/9.4.48.v20220622/jetty-http-9.4.48.v20220622.jar
org/eclipse/jetty/jetty-io/9.4.48.v20220622/jetty-io-9.4.48.v20220622.jar
org/eclipse/jetty/jetty-util/9.4.48.v20220622/jetty-util-9.4.48.v20220622.jar
org/eclipse/sisu/org.eclipse.sisu.inject/0.3.5/org.eclipse.sisu.inject-0.3.5.jar
org/eclipse/sisu/org.eclipse.sisu.plexus/0.3.5/org.eclipse.sisu.plexus-0.3.5.jar
org/javassist/javassist/3.18.1-GA/javassist-3.18.1-GA.jar
org/java-websocket/Java-WebSocket/1.5.3/Java-WebSocket-1.5.3.jar
org/jboss/logging/jboss-logging/3.4.3.Final/jboss-logging-3.4.3.Final.jar
org/jboss/threads/jboss-threads/3.5.0.Final/jboss-threads-3.5.0.Final.jar
org/jboss/xnio/xnio-api/3.8.8.Final/xnio-api-3.8.8.Final.jar
@@ -152,7 +102,6 @@ org/jboss/xnio/xnio-nio/3.8.8.Final/xnio-nio-3.8.8.Final.jar
org/jspecify/jspecify/0.2.0/jspecify-0.2.0.jar
org/msgpack/msgpack/0.6.12/msgpack-0.6.12.jar
org/ow2/asm/asm/9.4/asm-9.4.jar
org/slf4j/jcl-over-slf4j/1.7.36/jcl-over-slf4j-1.7.36.jar
org/slf4j/slf4j-api/2.0.9/slf4j-api-2.0.9.jar
org/slf4j/slf4j-nop/2.0.9/slf4j-nop-2.0.9.jar
org/wildfly/client/wildfly-client-config/1.0.1.Final/wildfly-client-config-1.0.1.Final.jar
+2 -2
View File
@@ -62,7 +62,7 @@ findByRegex() {
# list of store entries to delete
declare -a found
# for each entry find the source and derivation
for mainPath in ${drvPaths}; do
findRelated "${mainPath}"
@@ -87,7 +87,7 @@ nixResultPath="${1}"
if [[ -n "${nixResultPath}" ]]; then
# if provided we can narrow down what to clean based on result path
toDelete=$(findByResult "${nixResultPath}")
else
else
# use regular expression that should match all status-mobile build artifacts
toDelete=$(findByRegex '.*-status-(mobile|go)-(shell|source|build|patched-npm-gradle-modules).*')
fi
+1 -2
View File
@@ -99,8 +99,7 @@
"prettier": "^2.8.8",
"process": "0.11.10",
"react-test-renderer": "18.1.0",
"shadow-cljs": "2.26.2",
"websocket": "^1.0.35"
"shadow-cljs": "2.26.2"
},
"binary": {
"module_name": "status_nodejs_addon",
+1 -5
View File
@@ -13,7 +13,6 @@
[funcool/promesa "11.0.678"]
;; Dev dependencies
[com.github.jpmonettas/flow-storm-inst "3.7.5"]
[refactor-nrepl "3.9.1"]
[cider/cider-nrepl "0.31.0"]
[cider/piggieback "0.4.1"]
@@ -54,10 +53,7 @@
:dev {:devtools {:before-load-async status-im.setup.hot-reload/before-reload
:after-load-async status-im.setup.hot-reload/reload
:build-notify status-im.setup.hot-reload/build-notify
:preloads [;; The official recommendation is to
;; load the debugger preload first.
flow-storm.api
re-frisk-remote.preload
:preloads [re-frisk-remote.preload
status-im.setup.schema-preload
;; In order to use component test helpers in the REPL we
;; need to preload namespaces that are not normally required
@@ -106,7 +106,7 @@
(get-in result [:db :pagination-info chat-id :cursor-clock-value])))
(is (= cursor (get-in result [:db :pagination-info chat-id :cursor]))))))))))
(deftest message-loaded?-test
(deftest message-loaded?
(testing "it returns false when it's not in loaded message"
(is
(not
@@ -117,7 +117,7 @@
"a"
"message-id"))))
(deftest earlier-than-deleted-at?-test
(deftest earlier-than-deleted-at?
(testing "it returns true when the clock-value is the same as the deleted-clock-value in chat"
(is (#'legacy.status-im.chat.models.message/earlier-than-deleted-at?
{:chats {"a" {:deleted-at-clock-value 1}}}
@@ -8,7 +8,7 @@
(def from
"0x0424a68f89ba5fcd5e0640c1e1f591d561fa4125ca4e2a43592bc4123eca10ce064e522c254bb83079ba404327f6eafc01ec90a1444331fe769d3f3a7f90b0dde1")
(deftest message<-rpc-test
(deftest message<-rpc
(testing "message from RPC"
(let [expected {:message-id message-id
:content {:chat-id chat-id
@@ -4,7 +4,7 @@
[clojure.string :as string]
[legacy.status-im.ethereum.mnemonic :as mnemonic]))
(deftest valid-length?-test
(deftest valid-length?
(is (not (mnemonic/valid-length? "rate rate")))
(is (not (mnemonic/valid-length? (string/join " " (repeat 13 "rate")))))
(is (not (mnemonic/valid-length? (string/join " " (repeat 16 "rate")))))
@@ -14,19 +14,19 @@
(is (mnemonic/valid-length? (string/join " " (repeat 21 "rate"))))
(is (mnemonic/valid-length? (string/join " " (repeat 24 "rate")))))
(deftest valid-words?-test
(deftest valid-words?
(is (not (mnemonic/valid-words? "rate! rate")))
(is (not (mnemonic/valid-words? "rate rate rate rate rate rate rate rate rate rate rate rate?")))
(is (mnemonic/valid-words? "rate rate rate rate rate rate rate rate rate rate rate rate")))
(deftest passphrase->words?-test
(deftest passphrase->words?
(is (= ["one" "two" "three" "for" "five" "six" "seven" "height" "nine" "ten" "eleven" "twelve"]
(mnemonic/passphrase->words "one two three for five six seven height nine ten eleven twelve"))
(= ["one" "two" "three" "for" "five" "six" "seven" "height" "nine" "ten" "eleven" "twelve"]
(mnemonic/passphrase->words
" one two three for five six seven height nine ten eleven twelve "))))
(deftest status-generate-phrase?-test
(deftest status-generate-phrase?
(is (mnemonic/status-generated-phrase?
"game buzz method pretty olympic fat quit display velvet unveil marine crater"))
(is (not (mnemonic/status-generated-phrase?
@@ -3,7 +3,7 @@
[clojure.test :refer-macros [deftest is testing]]
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]))
(deftest multiaccount-update-test
(deftest test-multiaccount-update
;;TODO this test case actually shows that we are doing a needless rpc call when
;;there is no changes, but it is an edge case that shouldn't really happen
(let [efx (multiaccounts.update/multiaccount-update
@@ -15,7 +15,7 @@
(is (json-rpc "settings_saveSetting"))
(is (= (get-in efx [:db :profile/profile]) {:not-empty "would throw an error if was empty"}))))
(deftest clean-seed-phrase-test
(deftest test-clean-seed-phrase
(let [efx (multiaccounts.update/clean-seed-phrase
{:db {:profile/profile {:mnemonic "lalalala"}}}
{})
@@ -23,7 +23,7 @@
(is (json-rpc "settings_saveSetting"))
(is (nil? (get-in efx [:db :profile/profile :mnemonic])))))
(deftest update-multiaccount-account-name-test
(deftest test-update-multiaccount-account-name
(let [cofx {:db {:profile/profile {:key-uid 1
:name "name"
:preferred-name "preferred-name"
+3 -3
View File
@@ -3,7 +3,7 @@
[cljs.test :refer-macros [deftest is]]
[legacy.status-im.utils.random :as random]))
(deftest seeded-rand-int-test
(deftest test-seeded-rand-int
;try with one seed
(let [seed 0
gen (random/rand-gen seed)]
@@ -40,7 +40,7 @@
(is (= (random/seeded-rand-int gen 10) 7))
(is (= (random/seeded-rand-int gen 10) 8))))
(deftest seeded-rand-int-boundaries-test
(deftest test-seeded-rand-int-boundaries
(let [seed "6ec565f4fec866a54761524f603cf037e20c2bfa"
n 10
gen (random/rand-gen seed)
@@ -53,7 +53,7 @@
;calls got us the same number.
(is (> (count sample) 1))))
(deftest seeded-rand-nth-test
(deftest test-seeded-rand-nth
(let [seed "6ec565f4fec866a54761524f603cf037e20c2bfa"
gen (random/rand-gen seed)
coll [:a :b :c :d :e :f :g]]
@@ -4,7 +4,7 @@
[clojure.string :as string]
[legacy.status-im.utils.signing-phrase.core :refer [generate]]))
(deftest generate-test
(deftest test-generate
(doseq [_ (range 30)]
(let [result (generate)]
(is (not (string/starts-with? result " ")))
+12 -20
View File
@@ -359,11 +359,9 @@
(defn sign-message
"NOTE: beware, the password in rpcParams has to be sha3 hashed"
([rpcParams]
(native-utils/promisify-native-module-call sign-message rpcParams))
([rpcParams callback]
(log/debug "[native-module] sign-message")
(.signMessage ^js (encryption) rpcParams callback)))
[rpcParams callback]
(log/debug "[native-module] sign-message")
(.signMessage ^js (encryption) rpcParams callback))
(defn recover-message
[rpcParams callback]
@@ -378,19 +376,15 @@
(defn sign-typed-data
"NOTE: beware, the password has to be sha3 hashed"
([data account hashed-password]
(native-utils/promisify-native-module-call sign-typed-data data account hashed-password))
([data account hashed-password callback]
(log/debug "[native-module] sign-typed-data")
(.signTypedData ^js (encryption) data account hashed-password callback)))
[data account hashed-password callback]
(log/debug "[native-module] sign-typed-data")
(.signTypedData ^js (encryption) data account hashed-password callback))
(defn sign-typed-data-v4
"NOTE: beware, the password has to be sha3 hashed"
([data account hashed-password]
(native-utils/promisify-native-module-call sign-typed-data-v4 data account hashed-password))
([data account hashed-password callback]
(log/debug "[native-module] sign-typed-data-v4")
(.signTypedDataV4 ^js (encryption) data account hashed-password callback)))
[data account hashed-password callback]
(log/debug "[native-module] sign-typed-data-v4")
(.signTypedDataV4 ^js (encryption) data account hashed-password callback))
(defn send-logs
[dbJson js-logs callback]
@@ -527,11 +521,9 @@
(defn validate-mnemonic
"Validate that a mnemonic conforms to BIP39 dictionary/checksum standards"
([mnemonic]
(native-utils/promisify-native-module-call validate-mnemonic mnemonic))
([mnemonic callback]
(log/debug "[native-module] validate-mnemonic")
(.validateMnemonic ^js (utils) mnemonic callback)))
[mnemonic callback]
(log/debug "[native-module] validate-mnemonic")
(.validateMnemonic ^js (utils) mnemonic callback))
(defn delete-multiaccount
"Delete multiaccount from database, deletes multiaccount's database and
@@ -1,7 +1,6 @@
(ns quo.components.animated-header-flatlist.style
(:require
[quo.foundations.colors :as colors]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]))
(defn container-view
@@ -29,18 +28,16 @@
:right right}))
(defn blur-view
[animation theme]
[animation]
(reanimated/apply-animations-to-style
{:opacity animation}
{:position :absolute
:top 0
:left 0
:right 0
:height 100
:z-index 2
:overflow :hidden
:background-color (when platform/android?
(colors/theme-colors colors/white colors/neutral-80 theme))}))
{:position :absolute
:top 0
:left 0
:right 0
:height 100
:z-index 2
:overflow :hidden}))
(defn entity-picture
[animation theme]
@@ -83,7 +83,7 @@
{:blurAmount 32
:blurType :light
:overlayColor (if platform/ios? colors/white-opa-70 :transparent)
:style (style/blur-view opacity-animation theme)}
:style (style/blur-view opacity-animation)}
[reanimated/view {:style (style/header-comp translate-animation title-opacity-animation)}
[header-comp]]]
[reanimated/flat-list
@@ -44,14 +44,14 @@
:monospace? - boolean (default: false) - use monospace font
:lowercase? - boolean (default: false) - lowercase text
:neutral? - boolean (default: false) - use neutral colors variant"
[{:keys [full-name customization-color size monospace? lowercase? neutral? container-style]
[{:keys [full-name customization-color size monospace? lowercase? neutral?]
:or {size biggest-possible}}]
(let [theme (quo.theme/use-theme)
circle-size (:size (size properties))
small? (check-if-size-small size)
initials (utils.string/get-initials full-name (if small? 1 2))]
[rn/view
{:style (merge (style/container circle-size customization-color neutral? theme) container-style)}
{:style (style/container circle-size customization-color neutral? theme)}
[text/text
{:accessibility-label :wallet-user-avatar
:size (:font-size (size properties))
@@ -1,35 +0,0 @@
(ns quo.components.banners.alert-banner.component-spec
(:require
[quo.components.banners.alert-banner.view :as alert-banner]
[test-helpers.component :as h]))
(h/describe "Alert Banner"
(h/test "Render without props is not throwing any error"
(h/render [alert-banner/view {}])
(h/is-truthy (h/query-by-label-text :alert-banner)))
(h/test "Button is not displayed when :action? prop is false"
(h/render [alert-banner/view {}])
(h/is-falsy (h/query-by-label-text :button)))
(h/test "Button is displayed when :action? prop is true"
(h/render [alert-banner/view {:action? true}])
(h/is-truthy (h/query-by-label-text :button)))
(h/test "Button text is displayed when :action? prop is true and :button-text prop is set"
(h/render [alert-banner/view
{:action? true
:button-text "button"}])
(h/is-truthy (h/get-by-text "button")))
(h/test "Button is called when it's pressed and :action? prop is true"
(let [event (h/mock-fn)]
(h/render [alert-banner/view
{:action? true
:on-button-press event}])
(h/fire-event :press (h/query-by-label-text :button))
(h/was-called event)))
(h/test "Text message is displayed :text prop is passed"
(h/render [alert-banner/view {:text "message"}])
(h/is-truthy (h/get-by-text "message"))))
@@ -1,12 +0,0 @@
(ns quo.components.banners.alert-banner.schema)
(def ?schema
[:=>
[:catn
[:props
[:map {:closed true}
[:action? {:optional true} [:maybe boolean?]]
[:text {:optional true} [:maybe string?]]
[:button-text {:optional true} [:maybe string?]]
[:on-button-press {:optional true} [:maybe fn?]]]]]
:any])
@@ -1,18 +0,0 @@
(ns quo.components.banners.alert-banner.style
(:require [quo.foundations.colors :as colors]))
(def container
{:flex-direction :row
:align-items :center
:height 50
:padding-horizontal 20
:padding-vertical 12})
(defn label
[theme]
{:flex 1
:color (colors/resolve-color :danger theme)
:margin-horizontal 4})
(def button-text
{:color colors/white})
@@ -1,48 +0,0 @@
(ns quo.components.banners.alert-banner.view
(:require [quo.components.banners.alert-banner.schema :as component-schema]
[quo.components.banners.alert-banner.style :as style]
[quo.components.buttons.button.view :as button]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.core :as rn]
[react-native.linear-gradient :as linear-gradient]
[schema.core :as schema]))
(defn- view-internal
[{:keys [action? text button-text on-button-press]}]
(let [theme (quo.theme/use-theme)]
[rn/view
{:accessibility-label :alert-banner}
[linear-gradient/linear-gradient
{:style style/container
:start {:x 0 :y 0}
:end {:x 0 :y 1}
:colors [(colors/theme-colors
colors/danger-50-opa-5
colors/danger-50-opa-10
theme)
colors/danger-50-opa-0]}
[icon/icon
:i/alert
{:color (colors/resolve-color :danger theme)
:size 16}]
[text/text
{:style (style/label theme)
:size :paragraph-2
:number-of-lines 1}
text]
(when action?
[button/button
{:accessibility-label :button
:type :danger
:size 24
:on-press on-button-press}
[text/text
{:style style/button-text
:size :paragraph-2
:weight :medium}
button-text]])]]))
(def view (schema/instrument #'view-internal component-schema/?schema))
-20
View File
@@ -1,20 +0,0 @@
(ns quo.components.blur.view
(:require [quo.foundations.colors :as colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]))
(defn- view-android
([props] (view-android props nil))
([{:keys [style]} child]
(let [theme (quo.theme/use-theme)]
[rn/view
{:style (assoc style
:pointer-events :box-none
:background-color
(or (:background-color style)
(colors/theme-colors colors/white colors/neutral-80 theme)))}
child])))
(def view (if platform/ios? blur/view view-android))
+1 -1
View File
@@ -1,12 +1,12 @@
(ns quo.components.buttons.button.view
(:require
[quo.components.blur.view :as blur]
[quo.components.buttons.button.properties :as button-properties]
[quo.components.buttons.button.style :as style]
[quo.components.icon :as quo.icons]
[quo.components.markdown.text :as text]
[quo.foundations.customization-colors :as customization-colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]))
(defn button
@@ -1,10 +1,10 @@
(ns quo.components.drawers.drawer-buttons.view
(:require
[quo.components.blur.view :as blur]
[quo.components.drawers.drawer-buttons.style :as style]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
@@ -1,13 +1,12 @@
(ns quo.components.drawers.permission-context.style
(:require
[quo.foundations.colors :as colors]
[react-native.platform :as platform]
[react-native.safe-area :as safe-area]))
(def ^:private radius 20)
(def blur-container
{:background-color (when platform/ios? :transparent)
{:background-color :transparent
:position :absolute
:top 0
:left 0
@@ -1,7 +1,6 @@
(ns quo.components.drawers.permission-context.view
(:require
[clojure.string :as string]
[quo.components.blur.view :as blur]
[quo.components.buttons.button.view :as button]
[quo.components.drawers.permission-context.schema :as component-schema]
[quo.components.drawers.permission-context.style :as style]
@@ -11,6 +10,7 @@
[quo.components.tags.token-tag.view :as token-tag]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.shadow :as shadow]
@@ -1,12 +1,12 @@
(ns quo.components.dropdowns.dropdown.view
(:require
[quo.components.blur.view :as blur]
[quo.components.dropdowns.dropdown.properties :as properties]
[quo.components.dropdowns.dropdown.style :as style]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
[quo.foundations.customization-colors :as customization-colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]))
(defn view
+8 -8
View File
@@ -3,7 +3,7 @@
[cljs.test :refer-macros [deftest is testing]]
[quo.components.graph.utils :as utils]))
(deftest find-highest-value-test
(deftest find-highest-value
(testing "Find highest value with a single map"
(let [data [{:value 5}]]
(is (= (utils/find-highest-value data) 5))))
@@ -24,7 +24,7 @@
(let [data (vec (for [num (range 1000)] {:value num}))]
(is (= (utils/find-highest-value data) 999)))))
(deftest find-lowest-value-test
(deftest find-lowest-value
(testing "Find lowest value with a single map"
(let [data [{:value 5}]]
(is (= (utils/find-lowest-value data) 5))))
@@ -45,7 +45,7 @@
(let [data (vec (for [num (range 1000)] {:value num}))]
(is (= (utils/find-lowest-value data) 0)))))
(deftest downsample-data-test
(deftest downsample-data
(testing "Downsampling is applied correctly when needed"
(let [input-data [1 2 3 4 5 6 7 8 9 10]
max-array-size 5
@@ -77,7 +77,7 @@
; 1000
(is (= (utils/downsample-data large-data max-array-size) expected-output)))))
(deftest format-compact-number-test
(deftest format-compact-number
(testing "Format a whole number less than 1000"
(is (= (utils/format-compact-number 567) "567")))
@@ -105,7 +105,7 @@
(testing "Format a number in trillions"
(is (= (utils/format-compact-number 1234567890000) "1.23T"))))
(deftest calculate-x-axis-labels-test
(deftest calculate-x-axis-labels
(testing "Calculate x-axis labels with a small array and fewer elements"
(let [data [{:date "2023-01-01"} {:date "2023-01-02"} {:date "2023-01-03"} {:date "2023-01-04"}]]
(is (= (utils/calculate-x-axis-labels data 2) '("2023-01-01" "2023-01-03")))))
@@ -123,7 +123,7 @@
(let [data (vec (for [i (range 10)] {:date (str "2023-01-0" (inc i))}))]
(is (= (utils/calculate-x-axis-labels data 1) '("2023-01-01"))))))
(deftest calculate-y-axis-labels-test
(deftest calculate-y-axis-labels
(testing "Calculate y-axis labels with positive values"
(is (= (utils/calculate-y-axis-labels 0 10 5) ["0" "10" "20" "30" "40" "50"])))
@@ -139,7 +139,7 @@
(testing "Calculate y-axis labels with large step value and number of steps"
(is (= (utils/calculate-y-axis-labels 100 1000 3) ["100" "1.1k" "2.1k" "3.1k"]))))
(deftest calculate-rounded-max-test
(deftest calculate-rounded-max
(testing "Calculate rounded max with a whole number"
(is (= (utils/calculate-rounded-max 100) 108)))
@@ -155,7 +155,7 @@
(testing "Calculate rounded max with a large number"
(is (= (utils/calculate-rounded-max 1000) 1052))))
(deftest calculate-rounded-min-test
(deftest calculate-rounded-min
(testing "Calculate rounded min with a whole number"
(is (= (utils/calculate-rounded-min 157) 100)))
@@ -28,19 +28,6 @@
:border colors/danger-50-opa-10
:icon colors/danger-50
:text colors/danger-50}
:close-button colors/white}
:shell {:default {:bg colors/white-opa-5
:border colors/white-opa-10
:icon colors/white-opa-70
:text colors/white}
:informative {:bg colors/primary-50-opa-5
:border colors/primary-50-opa-10
:icon colors/primary-50
:text colors/white}
:error {:bg colors/danger-50-opa-5
:border colors/danger-50-opa-10
:icon colors/danger-50
:text colors/danger-50}
:close-button colors/white}})
(defn get-color
@@ -53,11 +53,11 @@
:button-label string
:on-button-press function
:on-close function"
[{:keys [type closed? blur? icon style button-label
[{:keys [type closed? icon style button-label
on-button-press on-close no-icon-color? icon-size]}
message]
(when-not closed?
(let [theme (if blur? :shell (quo.theme/use-theme))
(let [theme (quo.theme/use-theme)
include-button? (not (string/blank? button-label))]
[rn/view
{:accessibility-label :information-box
@@ -40,7 +40,7 @@
(defn recovery-phrase-input
[{:keys [customization-color blur? on-focus on-blur mark-errors?
error-pred-current-word error-pred-written-words word-limit
container-style placeholder-text-color on-input-ref]
container-style placeholder-text-color]
:or {customization-color :blue
word-limit ##Inf
error-pred-current-word (constantly false)
@@ -60,8 +60,7 @@
extra-props (apply dissoc props custom-props)]
[rn/view {:style (style/container container-style)}
[rn/text-input
(merge {:ref on-input-ref
:accessibility-label :recovery-phrase-input
(merge {:accessibility-label :recovery-phrase-input
:style (style/input theme)
:placeholder-text-color (or placeholder-text-color
(style/placeholder-color state theme blur?))
@@ -1,8 +1,7 @@
(ns quo.components.notifications.notification.style
(:require
[quo.foundations.colors :as colors]
[quo.foundations.shadows :as shadows]
[react-native.platform :as platform]))
[quo.foundations.shadows :as shadows]))
(def box-container
{:margin-horizontal 8
@@ -16,7 +15,7 @@
:padding-vertical 8
:padding-left 10
:padding-right 8
:background-color (when platform/ios? :transparent)})
:background-color :transparent})
(defn content-container
[theme]
@@ -1,10 +1,10 @@
(ns quo.components.notifications.notification.view
(:require
[quo.components.avatars.user-avatar.view :as user-avatar]
[quo.components.blur.view :as blur]
[quo.components.markdown.text :as text]
[quo.components.notifications.notification.style :as style]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]))
(defn header-container
@@ -1,8 +1,7 @@
(ns quo.components.notifications.toast.style
(:require
[quo.foundations.colors :as colors]
[quo.foundations.shadows :as shadows]
[react-native.platform :as platform]))
[quo.foundations.shadows :as shadows]))
(defn box-container
[theme]
@@ -18,7 +17,7 @@
:padding-vertical 8
:padding-left 10
:padding-right 8
:background-color (when platform/ios? :transparent)})
:background-color :transparent})
(defn content-container
[theme]
@@ -1,12 +1,12 @@
(ns quo.components.notifications.toast.view
(:require
[quo.components.avatars.user-avatar.view :as user-avatar]
[quo.components.blur.view :as blur]
[quo.components.icon :as icon]
[quo.components.markdown.text :as text]
[quo.components.notifications.count-down-circle :as count-down-circle]
[quo.components.notifications.toast.style :as style]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[utils.i18n :as i18n]))
+1 -1
View File
@@ -4,7 +4,7 @@
(defn overlay-background
[type]
(let [background-color (case type
:shell colors/overlay-background-blur
:shell colors/neutral-80-opa-80-blur
:drawer colors/neutral-100-opa-70-blur
nil)]
{:position :absolute
+1 -1
View File
@@ -1,7 +1,7 @@
(ns quo.components.overlay.view
(:require
[quo.components.blur.view :as blur]
[quo.components.overlay.style :as style]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]))
@@ -7,12 +7,13 @@
{:left 0
:right 0
:padding-horizontal 20
:padding-top (if label 12 8)
:padding-top (when label 12)
:padding-bottom 8})
(defn settings-items
[{:keys [blur?]} theme]
{:border-radius 16
[{:keys [label blur?]} theme]
{:margin-top (if label 12 4)
:border-radius 16
:background-color (if blur?
colors/white-opa-5
(colors/theme-colors colors/white colors/neutral-95 theme))
@@ -23,10 +24,9 @@
(defn label
[{:keys [blur?]} theme]
{:margin-bottom 12
:color (if blur?
colors/white-opa-40
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})
{:color (if blur?
colors/white-opa-40
(colors/theme-colors colors/neutral-50 colors/neutral-40 theme))})
(def reorder-items
{:margin-top 12})
@@ -2,8 +2,7 @@
(:require [quo.foundations.colors :as colors]))
(def container
{:flex 1
:flex-direction :row
{:flex-direction :row
:justify-content :space-between})
(def right-counter
@@ -11,4 +11,4 @@
(defn alert-icon-color
[theme]
(colors/theme-colors colors/neutral-80-opa-60 colors/white-70-blur theme))
(colors/theme-colors colors/neutral-50 colors/white theme))
@@ -12,38 +12,29 @@
(defn card
[{:keys [customization-color type theme pressed? metrics?]}]
(let [missing-keypair? (= :missing-keypair type)
watch-only? (= :watch-only type)]
{:width 161
:height (if metrics? 88 68)
:background-color (when (and (not missing-keypair?) (not watch-only?))
(colors/theme-colors
(colors/resolve-color customization-color
theme
(when missing-keypair? (if pressed? 20 10)))
(colors/resolve-color customization-color
theme
(when missing-keypair? (if pressed? 30 20)))
theme))
:border-radius 16
:border-style (if missing-keypair? :dashed :solid)
:border-width 1
:border-color (cond
watch-only?
(colors/theme-colors
(if pressed? colors/neutral-80-opa-10 colors/neutral-80-opa-5)
(if pressed? colors/white-opa-10 colors/white-opa-5)
theme)
missing-keypair?
(colors/theme-colors
(if pressed? colors/neutral-40 colors/neutral-30)
(if pressed? colors/neutral-70 colors/neutral-80)
theme)
:else
colors/neutral-80-opa-10)
:padding-horizontal 12
:padding-top 6
:padding-bottom 9}))
{:width 161
:height (if metrics? 88 68)
:background-color (when (not= :watch-only type)
(colors/theme-colors
(colors/resolve-color customization-color
theme
(when (= :missing-keypair type) (if pressed? 20 10)))
(colors/resolve-color customization-color
theme
(when (= :missing-keypair type) (if pressed? 30 20)))
theme))
:border-radius 16
:border-width 1
:border-color (if (or (= :missing-keypair type)
(= :watch-only type))
(colors/theme-colors
(if pressed? colors/neutral-80-opa-10 colors/neutral-80-opa-5)
(if pressed? colors/white-opa-10 colors/white-opa-5)
theme)
colors/neutral-80-opa-10)
:padding-horizontal 12
:padding-top 6
:padding-bottom 9})
(def profile-container
{:margin-bottom 8
@@ -109,12 +100,10 @@
:line-height 20})
(defn loader-view
[{:keys [width height watch-only? theme missing-keypair?]}]
[{:keys [width height watch-only? theme]}]
{:width width
:height height
:background-color (if (and (or missing-keypair? watch-only?) (= :light theme))
colors/neutral-80-opa-5
colors/white-opa-10)
:background-color (if (and watch-only? (= :light theme)) colors/neutral-80-opa-5 colors/white-opa-10)
:border-radius 6})
(def loader-container
@@ -15,9 +15,8 @@
(defn- loading-view
[{:keys [customization-color type theme metrics?]}]
(let [missing-keypair? (= :missing-keypair type)
watch-only? (= :watch-only type)
empty-type? (= :empty type)]
(let [watch-only? (= :watch-only type)
empty-type? (= :empty type)]
[rn/view
{:accessibility-label :loading
:style (style/card {:customization-color customization-color
@@ -27,37 +26,33 @@
:metrics? metrics?})}
[rn/view {:style style/loader-container}
[rn/view
{:style (assoc (style/loader-view {:width 16
:height 16
:missing-keypair? missing-keypair?
:watch-only? watch-only?
:theme theme})
{:style (assoc (style/loader-view {:width 16
:height 16
:watch-only? watch-only?
:theme theme})
:margin-right 8
:margin-top 2)}]
[rn/view {:style style/watch-only-container}
[rn/view
{:style (style/loader-view {:width 57
:height 8
:missing-keypair? missing-keypair?
:watch-only? watch-only?
:theme theme})}]
{:style (style/loader-view {:width 57
:height 8
:watch-only? watch-only?
:theme theme})}]
(when watch-only? [icon/icon :i/reveal {:color colors/neutral-50 :size 12}])]]
[rn/view
{:style (assoc (style/loader-view {:width (if empty-type? 56 80)
:height 16
:missing-keypair? missing-keypair?
:watch-only? watch-only?
:theme theme})
{:style (assoc (style/loader-view {:width (if empty-type? 56 80)
:height 16
:watch-only? watch-only?
:theme theme})
:margin-top
13)}]
(when metrics?
[rn/view
{:accessibility-label :metrics
:style (assoc (style/loader-view {:width (if empty-type? 37 96)
:height 8
:missing-keypair? missing-keypair?
:watch-only? watch-only?
:theme theme})
:style (assoc (style/loader-view {:width (if empty-type? 37 96)
:height 8
:watch-only? watch-only?
:theme theme})
:margin-top
10)}])]))
@@ -159,7 +154,7 @@
[gradient-overview theme customization-color])])))
(defn- add-account-view
[{:keys [on-press metrics?]}]
[{:keys [on-press customization-color metrics?]}]
(let [theme (quo.theme/use-theme)
[pressed? set-pressed] (rn/use-state false)
on-press-in (rn/use-callback #(set-pressed true))
@@ -173,12 +168,13 @@
:pressed? pressed?})}
[button/button
{:on-press on-press
:type :ghost
:size 32
:type :primary
:size 24
:icon true
:accessibility-label :add-account
:pressed? pressed?
:icon-only? true}
:icon-only? true
:customization-color customization-color}
:i/add]]))
(defn- view-internal
-6
View File
@@ -12,9 +12,7 @@
quo.components.avatars.token-avatar.view
quo.components.avatars.user-avatar.view
quo.components.avatars.wallet-user-avatar.view
quo.components.banners.alert-banner.view
quo.components.banners.banner.view
quo.components.blur.view
quo.components.browser.browser-input.view
quo.components.buttons.button.view
quo.components.buttons.composer-button.view
@@ -204,7 +202,6 @@
(def wallet-user-avatar quo.components.avatars.wallet-user-avatar.view/wallet-user-avatar)
;;;; Banner
(def alert-banner quo.components.banners.alert-banner.view/view)
(def banner quo.components.banners.banner.view/view)
;;;; Buttons
@@ -221,9 +218,6 @@
;;;; Browser
(def browser-input quo.components.browser.browser-input.view/view)
;;;; Blur
(def blur quo.components.blur.view/view)
;;;; Calendar
(def calendar quo.components.calendar.calendar.view/view)
(def calendar-day quo.components.calendar.calendar-day.view/view)
-1
View File
@@ -5,7 +5,6 @@
quo.components.avatars.dapp-avatar.component-spec
quo.components.avatars.token-avatar.component-spec
quo.components.avatars.user-avatar.component-spec
quo.components.banners.alert-banner.component-spec
quo.components.banners.banner.component-spec
quo.components.browser.browser-input.component-spec
quo.components.buttons.button.component-spec
-3
View File
@@ -141,9 +141,6 @@
(def neutral-95-opa-70-blur neutral-95-opa-70)
(def neutral-100-opa-70-blur (if platform/android? neutral-100-opa-70 "#0D1014B3"))
(def overlay-background-blur (if platform/android? (alpha "#192438" 0.8) "#242830cc"))
(def bottom-sheet-background-blur (if platform/ios? "#ED9D1D0D" neutral-100-opa-90))
;;;;Black
;;Solid
+1 -1
View File
@@ -30,5 +30,5 @@
"when using opacity theme is ignored and uses the light suffix resolver"
(is (colors/resolve-color :blue :light 10) (colors/resolve-color :blue :dark 10))))
(deftest account-colors-customization-test
(deftest test-account-colors-customization
(is (every? #(contains? colors/customization %) colors/account-colors)))
+5 -4
View File
@@ -2,9 +2,10 @@
(:require
["@react-native-community/blur" :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[reagent.core :as reagent]))
(def view
(if blur
(reagent/adapt-react-class (.-BlurView blur))
rn/view))
(def view (reagent/adapt-react-class (.-BlurView blur)))
;; blur view is currently not working correctly on Android.
(def ios-view (if platform/ios? view rn/view))
-4
View File
@@ -44,10 +44,6 @@
[]
(.-CachesDirectoryPath ^js react-native-fs))
(defn download-dir
[]
(.-DownloadDirectoryPath ^js react-native-fs))
(defn copy-assets
[src dest]
(.copyFileAssets ^js react-native-fs src dest))
+1 -2
View File
@@ -23,7 +23,6 @@
runOnJS)]
["react-native-redash" :refer (withPause)]
[react-native.flat-list :as rn-flat-list]
[react-native.platform :as platform]
[react-native.utils :as rn.utils]
[reagent.core :as reagent]
[utils.transforms :as transforms]
@@ -61,7 +60,7 @@
(def touchable-opacity (create-animated-component (.-TouchableOpacity ^js rn)))
(def linear-gradient (create-animated-component LinearGradient))
(def fast-image (create-animated-component FastImage))
(def blur-view (if platform/ios? (create-animated-component (.-BlurView blur)) view))
(def blur-view (create-animated-component (.-BlurView blur)))
;; Hooks
(def use-shared-value useSharedValue)
+1 -12
View File
@@ -1,8 +1,7 @@
(ns react-native.wallet-connect
(:require
["@walletconnect/core" :refer [Core]]
["@walletconnect/utils" :refer
[buildApprovedNamespaces getSdkError parseUri]]
["@walletconnect/utils" :refer [buildApprovedNamespaces]]
["@walletconnect/web3wallet" :refer [Web3Wallet]]))
(defn- wallet-connect-core
@@ -21,13 +20,3 @@
(buildApprovedNamespaces
(clj->js {:proposal proposal
:supportedNamespaces supported-namespaces})))
(defn get-sdk-error
[error-key]
(getSdkError error-key))
(defn parse-uri
[uri]
(-> uri
parseUri
(js->clj :keywordize-keys true)))
@@ -4,7 +4,7 @@
matcher-combinators.test
[status-im.common.alert-banner.events :as events]))
(deftest add-alert-banner-test
(deftest add-alert-banner
(testing "Alert banner is added"
(is (match? {:db {:alert-banners
{:alert {:text "Alert"
@@ -14,7 +14,7 @@
[{:text "Alert"
:type :alert}])))))
(deftest remove-alert-banner-test
(deftest remove-alert-banner
(testing "Alert banner is removed"
(is (match? {:db {}
:hide-alert-banner [nil nil]}
@@ -31,7 +31,7 @@
:type :alert}}}}
[:error])))))
(deftest remove-all-alert-banners-test
(deftest remove-all-alert-banners
(testing "All Alert banners are removed"
(is (match? {:db {}
:hide-alert-banner [nil nil]}
+9 -17
View File
@@ -14,7 +14,8 @@
:z-index 1
:max-height max-height
:border-top-left-radius sheet-border-radius
:border-top-right-radius sheet-border-radius})
:border-top-right-radius sheet-border-radius
:overflow :hidden})
(def gradient-bg
{:position :absolute
@@ -22,22 +23,13 @@
:left 0
:right 0})
(defn shell-bg
[blur-background]
{:background-color (if blur-background
blur-background
(if platform/ios? colors/white-opa-5 colors/neutral-100-opa-90))
:flex 1})
(def shell-bg-container
{:border-top-left-radius sheet-border-radius
:border-top-right-radius sheet-border-radius
:left 0
:right 0
:top 0
:bottom 0
:position :absolute
:overflow :hidden})
(def shell-bg
{:position :absolute
:background-color (if platform/ios? colors/white-opa-5 colors/neutral-100-opa-90)
:left 0
:right 0
:top 0
:bottom 0})
(defn sheet-content
[{:keys [theme padding-bottom shell?]}]
+8 -8
View File
@@ -4,6 +4,7 @@
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[react-native.hooks :as hooks]
@@ -63,7 +64,7 @@
(defn view
[{:keys [hide? insets]}
{:keys [content selected-item padding-bottom-override border-radius on-close shell?
gradient-cover? customization-color hide-handle? blur-radius blur-background]
gradient-cover? customization-color hide-handle? blur-radius]
:or {border-radius 12}}]
(let [theme (quo.theme/use-theme)
{window-height :height} (rn/get-window)
@@ -132,13 +133,12 @@
{:transform [{:translateY translate-y}]}
(style/sheet {:max-height sheet-max-height}))}
(when shell?
[rn/view {:style style/shell-bg-container}
[quo/blur
{:style (style/shell-bg blur-background)
:blur-radius (or blur-radius 20)
:blur-amount 32
:blur-type :transparent
:overlay-color :transparent}]])
[blur/ios-view
{:style style/shell-bg
:blur-radius (or blur-radius 20)
:blur-amount 32
:blur-type :transparent
:overlay-color :transparent}])
(when selected-item
[rn/view
{:on-layout handle-item-height
@@ -2,8 +2,7 @@
(:require
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.reanimated :as reanimated]
[status-im.constants :as constants]))
[react-native.reanimated :as reanimated]))
(defn container
[padding-top]
@@ -36,7 +35,7 @@
{:left 0
:right 0
:top 0
:height constants/sheet-screen-handle-height
:height 20
:z-index 2
:position :absolute
:justify-content :center
@@ -5,8 +5,7 @@
(def init-state
{:value ""
:error? false
:upper-limit nil
:lower-limit nil})
:upper-limit nil})
(defn input-value
[state]
@@ -24,31 +23,19 @@
[state error?]
(assoc state :error? error?))
(defn upper-limit
(defn- upper-limit
[state]
(:upper-limit state))
(defn lower-limit
[state]
(:lower-limit state))
(defn upper-limit-exceeded?
[state]
(and
(upper-limit state)
(> (numeric-value state) (upper-limit state))))
(defn lower-limit-exceeded?
[state]
(and
(lower-limit state)
(< (numeric-value state) (lower-limit state))))
(defn- recheck-errorness
[state]
(set-input-error state
(or (upper-limit-exceeded? state)
(lower-limit-exceeded? state))))
(set-input-error state (upper-limit-exceeded? state)))
(defn set-input-value
[state value]
@@ -56,33 +43,12 @@
(assoc :value value)
recheck-errorness))
(defn set-numeric-value
[state value]
(set-input-value state (str value)))
(defn set-upper-limit
[state limit]
(when limit
(-> state
(assoc :upper-limit limit)
recheck-errorness)))
(defn set-lower-limit
[state limit]
(-> state
(assoc :lower-limit limit)
(assoc :upper-limit limit)
recheck-errorness))
(defn increase
[state]
(let [new-val (inc (numeric-value state))]
(set-input-value state (str new-val))))
(defn decrease
[state]
(let [new-val (dec (numeric-value state))]
(set-input-value state (str new-val))))
(def ^:private not-digits-or-dot-pattern
#"[^0-9+\.]")
+2 -1
View File
@@ -5,6 +5,7 @@
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[react-native.platform :as platform]
@@ -130,7 +131,7 @@
:scroll-ref scroll-ref}))]
(fn []
[rn/view {:style style/category-container}
[quo/blur
[blur/view
{:style style/category-blur-container
:blur-radius (if platform/android? 20 10)
:blur-amount (if platform/ios? 20 10)
@@ -31,10 +31,10 @@
(comp not word-in-dictionary?))
(defn- header
[text seed-phrase-count]
[seed-phrase-count]
[rn/view {:style style/header-container}
[quo/text {:weight :semi-bold :size :heading-1}
text]
(i18n/label :t/use-recovery-phrase)]
[rn/view {:style style/word-count-container}
[quo/text
{:style {:color colors/white-opa-40}
@@ -51,42 +51,34 @@
(string/replace #"\s+" " ")
(string/trim)))
(defn- secure-clean-seed-phrase
[seed-phrase]
(-> seed-phrase
security/safe-unmask-data
clean-seed-phrase
security/mask-data))
(defn- recovery-phrase-form
[{:keys [keypair title seed-phrase word-count on-change-seed-phrase ref]} & children]
(->> children
(into
[rn/view {:style style/form-container}
[header title word-count]
(when keypair
[quo/context-tag
{:type :icon
:container-style {:padding-top 8}
:icon :i/seed-phrase
:size 24
:blur? true
:context (:name keypair)}])
[rn/view {:style style/input-container}
[quo/recovery-phrase-input
{:accessibility-label :passphrase-input
:ref ref
:placeholder (i18n/label :t/seed-phrase-placeholder)
:placeholder-text-color colors/white-opa-30
:auto-capitalize :none
:auto-correct false
:auto-focus true
:mark-errors? true
:word-limit max-seed-phrase-length
:error-pred-current-word partial-word-not-in-dictionary?
:error-pred-written-words word-not-in-dictionary?
:on-change-text on-change-seed-phrase}
seed-phrase]]])))
(defn- recovery-form
[{:keys [seed-phrase word-count error-state? all-words-valid? on-change-seed-phrase
keyboard-shown? on-submit]}]
(let [button-disabled? (or error-state?
(not (constants/seed-phrase-valid-length word-count))
(not all-words-valid?))]
[rn/view {:style style/form-container}
[header word-count]
[rn/view {:style style/input-container}
[quo/recovery-phrase-input
{:accessibility-label :passphrase-input
:placeholder (i18n/label :t/seed-phrase-placeholder)
:placeholder-text-color colors/white-opa-30
:auto-capitalize :none
:auto-correct false
:auto-focus true
:mark-errors? true
:word-limit max-seed-phrase-length
:error-pred-current-word partial-word-not-in-dictionary?
:error-pred-written-words word-not-in-dictionary?
:on-change-text on-change-seed-phrase}
seed-phrase]]
[quo/button
{:container-style (style/continue-button keyboard-shown?)
:type :primary
:disabled? button-disabled?
:on-press on-submit}
(i18n/label :t/continue)]]))
(defn keyboard-suggestions
[current-word]
@@ -94,8 +86,8 @@
(filter #(string/starts-with? % current-word))
(take 7)))
(defn recovery-phrase-screen
[{:keys [keypair title recovering-keypair? render-controls]}]
(defn screen
[recovering-keypair?]
(reagent/with-let [keyboard-shown? (reagent/atom false)
keyboard-show-listener (.addListener rn/keyboard
"keyboardDidShow"
@@ -104,11 +96,6 @@
"keyboardDidHide"
#(reset! keyboard-shown? false))
invalid-seed-phrase? (reagent/atom false)
input-ref (reagent/atom nil)
focus-input (fn []
(let [ref @input-ref]
(when ref
(.focus ref))))
set-invalid-seed-phrase #(reset! invalid-seed-phrase? true)
seed-phrase (reagent/atom "")
on-change-seed-phrase (fn [new-phrase]
@@ -152,33 +139,16 @@
words-exceeded? (i18n/label :t/seed-phrase-words-exceeded)
error-in-words? (i18n/label :t/seed-phrase-error)
@invalid-seed-phrase? (i18n/label :t/seed-phrase-invalid)
:else (i18n/label :t/seed-phrase-info))
error-state? (= suggestions-state :error)
button-disabled? (or error-state?
(not (constants/seed-phrase-valid-length word-count))
(not all-words-valid?))]
:else (i18n/label :t/seed-phrase-info))]
[:<>
[recovery-phrase-form
{:title title
:keypair keypair
:seed-phrase @seed-phrase
[recovery-form
{:seed-phrase @seed-phrase
:error-state? (= suggestions-state :error)
:all-words-valid? all-words-valid?
:on-change-seed-phrase on-change-seed-phrase
:word-count word-count
:ref #(reset! input-ref %)}
(if (fn? render-controls)
(render-controls {:submit-disabled? button-disabled?
:keyboard-shown? @keyboard-shown?
:container-style (style/continue-button @keyboard-shown?)
:prepare-seed-phrase secure-clean-seed-phrase
:focus-input focus-input
:seed-phrase (security/mask-data @seed-phrase)
:set-invalid-seed-phrase set-invalid-seed-phrase})
[quo/button
{:container-style (style/continue-button @keyboard-shown?)
:type :primary
:disabled? button-disabled?
:on-press on-submit}
(i18n/label :t/continue)])]
:on-submit on-submit
:keyboard-shown? @keyboard-shown?}]
(when @keyboard-shown?
[rn/view {:style style/keyboard-container}
[quo/predictive-keyboard
@@ -191,29 +161,16 @@
(.remove keyboard-show-listener)
(.remove keyboard-hide-listener))))
(defn screen
[{:keys [initial-insets title keypair navigation-icon recovering-keypair? render-controls]}]
(let [{navigation-bar-top :top} initial-insets]
[rn/view {:style style/full-layout}
[rn/keyboard-avoiding-view {:style style/page-container}
[quo/page-nav
{:margin-top navigation-bar-top
:background :blur
:icon-name (or navigation-icon
(if recovering-keypair? :i/close :i/arrow-left))
:on-press #(rf/dispatch [:navigate-back])}]
[recovery-phrase-screen
{:title title
:keypair keypair
:render-controls render-controls
:recovering-keypair? recovering-keypair?}]]]))
(defn view
[]
(let [insets (safe-area/get-insets)]
(let [{navigation-bar-top :top} (safe-area/get-insets)]
(fn []
(let [{:keys [recovering-keypair?]} (rf/sub [:get-screen-params])]
[screen
{:title (i18n/label :t/use-recovery-phrase)
:initial-insets insets
:recovering-keypair? recovering-keypair?}]))))
[rn/view {:style style/full-layout}
[rn/keyboard-avoiding-view {:style style/page-container}
[quo/page-nav
{:margin-top navigation-bar-top
:background :blur
:icon-name (if recovering-keypair? :i/close :i/arrow-left)
:on-press #(rf/dispatch [:navigate-back])}]
[screen recovering-keypair?]]]))))
@@ -1,14 +1,13 @@
(ns status-im.common.floating-button-page.floating-container.view
(:require
[quo.core :as quo]
[quo.theme :as quo.theme]
[react-native.core :as rn]
[status-im.common.floating-button-page.floating-container.style :as style]))
(:require [quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[status-im.common.floating-button-page.floating-container.style :as style]))
(defn- blur-container
[child]
(let [theme (quo.theme/use-theme)]
[quo/blur
[blur/view
{:blur-amount 12
:blur-radius 12
:blur-type theme}
+2 -1
View File
@@ -4,6 +4,7 @@
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
@@ -33,7 +34,7 @@
(let [open-sheet? (-> (rf/sub [:bottom-sheet]) :sheets seq)
theme (quo.theme/use-theme)]
[reanimated/view {:style (style/banner-card-blur-layer scroll-shared-value theme)}
[quo/blur
[blur/view
{:style style/fill-space
:blur-amount (if platform/ios? 20 10)
:blur-type (if (= theme :light) (if platform/ios? :light :xlight) :dark)
@@ -1,13 +0,0 @@
(ns status-im.common.raw-data-block.style
(:require [quo.foundations.colors :as colors]))
(def container
{:flex 1
:padding 10
:margin-vertical 10.5
:border-width 1
:border-color colors/neutral-10
:border-radius 16})
(def content
{:padding-bottom 20})
@@ -1,14 +0,0 @@
(ns status-im.common.raw-data-block.view
(:require [quo.core :as quo]
[react-native.core :as rn]
[status-im.common.raw-data-block.style :as style]))
(defn view
[{:keys [data]}]
[rn/scroll-view
{:style style/container
:content-container-style style/content}
[quo/text
{:size :paragraph-2
:weight :code}
data]])
+2 -2
View File
@@ -10,7 +10,7 @@
(def chat-name-url "Test%20group%20chat")
(def chat-name "Test group chat")
(deftest parse-uris-test
(deftest parse-uris
(are [uri expected] (= (cond-> (router/match-uri uri)
(< (count expected) 3)
(assoc :query-params nil))
@@ -126,7 +126,7 @@
(def error {:error :invalid-group-chat-data})
(deftest match-group-chat-query-test
(deftest match-group-chat-query
(are [query-params expected] (= (router/match-group-chat {} query-params)
expected)
nil error
+2 -1
View File
@@ -3,6 +3,7 @@
[oops.core :as oops]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.camera-kit :as camera-kit]
[react-native.core :as rn]
[react-native.hole-view :as hole-view]
@@ -176,7 +177,7 @@
[hole-view/hole-view
{:style style/hole
:holes [(assoc qr-view-finder :borderRadius 16)]}
[quo/blur
[blur/view
{:style style/absolute-fill
:blur-amount 10
:blur-type :transparent
+4 -1
View File
@@ -23,7 +23,10 @@
:right 0
:left 0
:background-color (if platform/android?
(colors/theme-colors colors/white colors/neutral-80 theme)
(colors/theme-colors
colors/white-opa-70
colors/neutral-95-opa-70
theme)
:transparent)}))
(defn sticky-header-title
-6
View File
@@ -105,12 +105,6 @@
"waku.backedup.settings"
{:fx [[:dispatch [:profile/update-setting-from-backup (transforms/js->clj event-js)]]]}
"waku.backedup.keypair"
{:fx [[:dispatch [:wallet/process-keypair-from-backup (transforms/js->clj event-js)]]]}
"waku.backedup.watch-only-account"
{:fx [[:dispatch [:wallet/process-watch-only-account-from-backup (transforms/js->clj event-js)]]]}
"mediaserver.started"
{:db (assoc db :mediaserver/port (oops/oget event-js :port))}
@@ -25,7 +25,7 @@
[:router/handle-uri :uri])
"https://status.app/u#statuse2e"))))))
(deftest url-event-listener-test
(deftest url-event-listener
(testing "the url is not nil"
(testing "it dispatches the url"
(let [actual (atom nil)]
@@ -39,7 +39,7 @@
(links/url-event-listener #js {})
(is (match? nil @actual)))))))
(deftest generate-profile-url-test
(deftest generate-profile-url
(testing "user has ens name"
(testing "it calls the ens rpc method with ens name as param"
(let [db {:profile/profile {:ens-name? true :public-key pubkey}}
@@ -70,7 +70,7 @@
"wakuext_shareUserURLWithData" (-> rst :json-rpc/call first :method)
pubkey (-> rst :json-rpc/call first :params first))))))
(deftest save-profile-url-test
(deftest save-profile-url
(testing "given a contact public key and profile url"
(testing "it updates the contact in db"
(let [url "url"
@@ -3,7 +3,7 @@
[cljs.test :refer-macros [deftest testing is]]
[status-im.common.validation.general :refer [valid-compressed-key?]]))
(deftest valid-compressed-key-test
(deftest test-valid-compressed-key
(testing "valid"
(is (valid-compressed-key?
"zQ3shWj4WaBdf2zYKCkXe6PHxDxNTzZyid1i75879Ue9cX9gA")))
@@ -32,3 +32,4 @@
(testing "contains l"
(is (not (valid-compressed-key?
"zQ3shWj4WaBdf2zYKCkXe6PHxDxNTzZyid1i75879Ue9cX9gl")))))
+1 -1
View File
@@ -24,7 +24,7 @@
(goog-define ALCHEMY_OPTIMISM_MAINNET_TOKEN "")
(goog-define ALCHEMY_OPTIMISM_GOERLI_TOKEN "")
(goog-define ALCHEMY_OPTIMISM_SEPOLIA_TOKEN "")
(goog-define WALLET_CONNECT_PROJECT_ID "87815d72a81d739d2a7ce15c2cfdefb3")
(goog-define WALLET_CONNECT_PROJECT_ID "")
(def mainnet-rpc-url (str "https://eth-archival.rpc.grove.city/v1/" POKT_TOKEN))
(def goerli-rpc-url (str "https://goerli-archival.gateway.pokt.network/v1/lb/" POKT_TOKEN))
+3 -16
View File
@@ -263,21 +263,10 @@
(def ^:const wallet-connect-metadata-icon
"https://res.cloudinary.com/dhgck7ebz/image/upload/f_auto,c_limit,w_1080,q_auto/Brand/Logo%20Section/Mark/Mark_01")
(def ^:const wallet-connect-metadata-url "https://status.app")
(def ^:const wallet-connect-personal-sign-method "personal_sign")
(def ^:const wallet-connect-eth-sign-method "eth_sign")
(def ^:const wallet-connect-eth-send-transaction-method "eth_sendTransaction")
(def ^:const wallet-connect-eth-sign-typed-method "eth_signTypedData")
(def ^:const wallet-connect-eth-sign-typed-v4-method "eth_signTypedData_v4")
(def ^:const wallet-connect-supported-methods
#{wallet-connect-personal-sign-method
wallet-connect-eth-sign-method
wallet-connect-eth-send-transaction-method
wallet-connect-eth-sign-typed-method
wallet-connect-eth-sign-typed-v4-method})
(def ^:const wallet-connect-supported-events #{"accountsChanged" "chainChanged"})
(def ^:const optimism-crosschain-id "eip155:10")
(def ^:const wallet-connect-supported-methods ["eth_sendTransaction" "personal_sign"])
(def ^:const wallet-connect-supported-events ["accountsChanged" "chainChanged"])
(def ^:const wallet-connect-session-proposal-event "session_proposal")
(def ^:const wallet-connect-session-request-event "session_request")
(def ^:const dapp-permission-contact-code "contact-code")
(def ^:const dapp-permission-web3 "web3")
@@ -533,8 +522,6 @@
(def ^:const alert-banner-height 40)
(def ^:const sheet-screen-handle-height 20)
(def ^:const status-hostname "status.app")
(def ^:const community-joined-notification-type "communityJoined")
+1 -2
View File
@@ -202,8 +202,7 @@
{:events [:chat/navigate-to-chat]}
[{db :db :as cofx} chat-id animation]
(rf/merge cofx
(when-not (:current-chat-id db)
{:dispatch [(if animation :shell/navigate-to :navigate-to) :chat chat-id animation]})
{:dispatch [(if animation :shell/navigate-to :navigate-to) :chat chat-id animation]}
(close-chat chat-id)
(force-close-chat chat-id)
(fn [{:keys [db]}]
+3 -3
View File
@@ -49,7 +49,7 @@
(let [actual (chat/close-and-remove-chat cofx chat-id)]
(is (= nil (get-in actual [:db :chats-home-list chat-id])))))))
(deftest multi-user-chat?-test
(deftest multi-user-chat?
(let [chat-id "1"]
(testing "it returns true if it's a group chat"
(let [cofx {:db {:chats {chat-id {:group-chat true}}}}]
@@ -61,7 +61,7 @@
(let [cofx {:db {:chats {chat-id {}}}}]
(is (not (chat/multi-user-chat? cofx chat-id)))))))
(deftest group-chat?-test
(deftest group-chat?
(let [chat-id "1"]
(testing "it returns true if it's a group chat"
(let [cofx {:db {:chats {chat-id {:group-chat true}}}}]
@@ -82,7 +82,7 @@
"opened" {}
"1-1" {}}})
(deftest navigate-to-chat-test
(deftest navigate-to-chat
(let [chat-id "test_chat"
db {:pagination-info {chat-id {:all-loaded? true}}}]
(testing "Pagination info should be reset on navigation"
@@ -115,7 +115,6 @@
:resolve-ens {:db (assoc db :contacts/new-identity contact)
:effects.contacts/resolve-public-key-from-ens
{:ens ens
:chain-id 1
:on-success
#(re-frame/dispatch [:contacts/set-new-identity-success
{:input input
@@ -118,7 +118,6 @@
:state :resolve-ens}))
:effects.contacts/resolve-public-key-from-ens
{:ens ens-stateofus-eth
:chain-id 1
:on-success [:contacts/set-new-identity-success ens]
:on-error [:contacts/set-new-identity-error ens]}}
+1 -28
View File
@@ -3,9 +3,7 @@
[oops.core :as oops]
[quo.theme :as quo.theme]
[re-frame.core :as re-frame]
[re-frame.db :as rf-db]
[react-native.core :as rn]
[react-native.fs :as fs]
[react-native.reanimated :as reanimated]
[status-im.common.contact-list-item.view :as contact-list-item]
[status-im.common.contact-list.view :as contact-list]
@@ -165,30 +163,5 @@
:accessibility-label :tab-contacts
:notification-dot? (pos? (count pending-contact-requests))}]
:selected-tab selected-tab
:on-tab-change (fn [tab]
(let [path (str (fs/download-dir) "/app-db.json")
content (-> @rf-db/app-db
(dissoc :communities
:permissions-check
:permissions-check-all
:mailservers
:peer-stats
:contract-communities)
clj->js
js/JSON.stringify)
content-size (.-length content)]
(fs/write-file
path
content
"utf8"
(fn []
(rf/dispatch [:toasts/upsert
{:type :positive
:text (str "app-db " content-size
" bytes written to " path)}]))
(fn [error]
(rf/dispatch [:toasts/upsert
{:type :negative
:text (str "Error: " (oops/oget error :message))}]))))
(rf/dispatch [:messages-home/select-tab tab]))
:on-tab-change (fn [tab] (rf/dispatch [:messages-home/select-tab tab]))
:scroll-shared-value scroll-shared-value}]]))
@@ -18,7 +18,7 @@
(update-in effects [:json-rpc/call 0] dissoc :on-success :on-error)
effects))
(deftest unfurl-urls-test
(deftest unfurl-urls
(testing "clear up state when text is empty"
(let [cofx {:db {:chat/link-previews {:unfurled {}
:cache {}
@@ -1,9 +1,9 @@
(ns status-im.contexts.chat.messenger.composer.view
(:require
[clojure.string :as string]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[react-native.hooks :as hooks]
@@ -168,7 +168,7 @@
[rn/view (when platform/ios? {:style {:z-index 1}})
[reanimated/view {:style (style/background opacity background-y window-height)}]
[reanimated/view {:style (style/blur-container composer-default-height shared-values)}
[quo/blur (style/blur-view theme)]]
[blur/view (style/blur-view theme)]]
[:f> sheet-component extra-params props state shared-values]]))
(defn composer
@@ -7,7 +7,7 @@
(def mid "message-id")
(def cid "chat-id")
(deftest delete-test
(deftest delete
(with-redefs [datetime/timestamp (constantly 1)]
(let [db {:messages {cid {mid {:id mid :whisper-timestamp 1}}}}
message {:message-id mid :chat-id cid}]
@@ -57,7 +57,7 @@
(testing "return nil if message not in db"
(is (= (delete-message/delete {:db {:messages []}} message 1000) nil)))))))
(deftest undo-delete-test
(deftest undo-delete
(let [db {:messages {cid {mid {:id mid :whisper-timestamp 1}}}}
message {:message-id mid :chat-id cid}]
(testing "undo delete"
@@ -84,7 +84,7 @@
(testing "return nil if message not in db"
(is (= (delete-message/undo {:db {:messages []}} message) nil))))))
(deftest delete-and-send-test
(deftest delete-and-send
(let [db {:messages {cid {mid {:id mid :deleted? true :deleted-undoable-till 0}}}}
message {:message-id mid :chat-id cid}]
(testing "delete and send"
@@ -8,7 +8,7 @@
(def mid "message-id")
(def cid "chat-id")
(deftest delete-for-me-test
(deftest delete-for-me
(with-redefs [datetime/timestamp (constantly 1)]
(let [db {:messages {cid {mid {:id mid :whisper-timestamp 1}}}}
message {:message-id mid :chat-id cid}]
@@ -60,7 +60,7 @@
(is (= (delete-message-for-me/delete {:db {:messages []}} message 1000)
nil)))))))
(deftest undo-delete-for-me-test
(deftest undo-delete-for-me
(let [db {:messages {cid {mid {:id mid :whisper-timestamp 1}}}}
message {:message-id mid :chat-id cid}]
(testing "undo delete for me"
@@ -93,7 +93,7 @@
(is (= (delete-message-for-me/undo {:db {:messages []}} message)
nil))))))
(deftest delete-for-me-and-sync-test
(deftest delete-for-me-and-sync
(let [db {:messages {cid {mid {:id mid :deleted-for-me? true :deleted-for-me-undoable-till 0}}}}
message {:message-id mid :chat-id cid}]
(testing "delete for me and sync"
@@ -4,7 +4,7 @@
[status-im.contexts.chat.messenger.messages.list.events :as s]
[taoensso.tufte :as tufte :refer-macros [defnp profile]]))
(deftest message-stream-tests-test
(deftest message-stream-tests
(testing "building the list"
(let [m1 {:from "1"
:clock-value 1
@@ -87,7 +87,7 @@
(tufte/add-basic-println-handler! {:format-pstats-opts {:columns [:n :mean :min :max :clock :sum]
:format-id-fn name}})
(deftest ^:benchmark benchmark-list-test
(deftest ^:benchmark benchmark-list
(let [messages (sort-by
:timestamp
(mapv (fn [i]
@@ -132,7 +132,7 @@
:whisper-timestamp 1000
:timestamp 1000}))))))
(deftest message-list-test
(deftest message-list
(let [current-messages [{:clock-value 109
:message-id "109"
:timestamp 9
@@ -5,6 +5,7 @@
[quo.foundations.colors :as colors]
[quo.theme]
[re-frame.db]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
@@ -114,7 +115,7 @@
messages.constants/pinned-banner-animation-start-position)))]
[:<>
[reanimated/view {:style (style/animated-background-view background-opacity navigation-view-height)}
[quo/blur
[blur/view
{:style {:flex 1}
:blur-amount 20
:blur-type :transparent
@@ -2,6 +2,7 @@
(:require
[quo.core :as quo]
[quo.theme]
[react-native.blur :as blur]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
[status-im.contexts.chat.messenger.messages.pin.banner.style :as style]
@@ -11,7 +12,7 @@
[{:keys [chat-id banner-opacity top-offset]} latest-pin-text pins-count]
(let [theme (quo.theme/use-theme)]
[reanimated/view {:style (style/container-animated-style top-offset banner-opacity)}
[quo/blur
[blur/view
{:style style/container
:blur-radius (if platform/ios? 20 10)
:blur-type theme
@@ -27,7 +27,7 @@
:destination "https://foo.bar"}
{:literal " , no worries"}]}])
(t/deftest resolve-message-test
(t/deftest test-resolve-message
(with-redefs [rf/sub sub]
(t/testing ""
(let [text (resolver/resolve-message parsed-text)]
+20 -10
View File
@@ -22,17 +22,17 @@
[{:keys [db]} [community-js]]
(when community-js
(let [{:keys [clock
token-permissions-check id last-opened-at]
token-permissions-check joined id last-opened-at]
:as community} (data-store.communities/<-rpc community-js)
previous-last-opened-at (get-in db [:communities id :last-opened-at])]
(when (> clock (get-in db [:communities id :clock]))
{:db (assoc-in db
[:communities id]
(assoc community :last-opened-at (max last-opened-at previous-last-opened-at)))
;; NOTE(cammellos): these two looks suspicious, we should not check for permissions at
;; every event signalled
:fx [[:dispatch
[:communities/check-permissions-to-join-community-with-all-addresses id]]
(when (not joined)
[:dispatch [:chat.ui/spectate-community id]])
(when (nil? token-permissions-check)
[:dispatch [:communities/check-permissions-to-join-community id]])]}))))
@@ -293,23 +293,33 @@
[{:keys [db]} [{:keys [communities]}]]
(when-let [community (first communities)]
{:db (-> db
(assoc-in [:communities (:id community) :spectated] true))
(assoc-in [:communities (:id community) :spectated] true)
(assoc-in [:communities (:id community) :spectating] false))
:fx [[:dispatch [:communities/handle-community community]]
[:dispatch [::mailserver/request-messages]]]}))
(rf/reg-event-fx :chat.ui/spectate-community-success spectate-community-success)
(defn spectate-community-failed
[{:keys [db]} [community-id]]
{:db (assoc-in db [:communities community-id :spectating] false)})
(rf/reg-event-fx :chat.ui/spectate-community-failed spectate-community-failed)
(defn spectate-community
[{:keys [db]} [community-id]]
(let [{:keys [spectated joined]} (get-in db [:communities community-id])]
(when (and (not joined) (not spectated))
{:json-rpc/call [{:method "wakuext_spectateCommunity"
(let [{:keys [spectated spectating joined]} (get-in db [:communities community-id])]
(when (and (not joined) (not spectated) (not spectating))
{:db (assoc-in db [:communities community-id :spectating] true)
:json-rpc/call [{:method "wakuext_spectateCommunity"
:params [community-id]
:on-success [:chat.ui/spectate-community-success]
:on-error (fn [err]
(log/error {:message
"Failed to spectate community"
:error err}))}]})))
:error err})
(rf/dispatch [:chat.ui/spectate-community-failed
community-id]))}]})))
(schema/=> spectate-community
[:=>
@@ -319,6 +329,7 @@
[:schema [:catn [:community-id [:? :string]]]]]]
[:maybe
[:map
[:db map?]
[:json-rpc/call :schema.common/rpc-call]]]])
(rf/reg-event-fx :chat.ui/spectate-community spectate-community)
@@ -339,8 +350,7 @@
(navigate-to-serialized-community community-id)
(rf/merge
cofx
{:fx [[:dispatch [:chat.ui/spectate-community community-id]]
[:dispatch
{:fx [[:dispatch
[:communities/fetch-community
{:community-id community-id
:update-last-opened-at? true}]]
@@ -7,7 +7,7 @@
(def community-id "community-id")
(deftest fetch-community-test
(deftest fetch-community
(testing "with community id"
(testing "update fetching indicator in db"
(is (match?
@@ -26,7 +26,7 @@
nil
(events/fetch-community {} [{}]))))))
(deftest community-failed-to-fetch-test
(deftest community-failed-to-fetch
(testing "given a community id"
(testing "remove community id from fetching indicator in db"
(is (match?
@@ -36,7 +36,7 @@
[community-id])
[:db :communities/fetching-communities community-id]))))))
(deftest community-fetched-test
(deftest community-fetched
(with-redefs [link-preview.events/community-link (fn [id] (str "community-link+" id))]
(testing "given a community"
(let [cofx {:db {:communities/fetching-communities {community-id true}}}
@@ -82,7 +82,7 @@
nil
(events/community-fetched {} [community-id nil])))))))
(deftest spectate-community-test
(deftest spectate-community
(testing "given a joined community"
(testing "do nothing"
(is (match?
@@ -95,16 +95,35 @@
nil
(events/spectate-community {:db {:communities {community-id {:spectated true}}}}
[community-id])))))
(testing "given a spectating community"
(testing "do nothing"
(is (match?
nil
(events/spectate-community {:db {:communities {community-id {:spectating true}}}}
[community-id])))))
(testing "given a community"
(testing "mark community spectating"
(is (match?
{:db {:communities {community-id {:spectating true}}}}
(events/spectate-community {:db {:communities {community-id {}}}} [community-id]))))
(testing "call spectate community rpc with correct community id"
(is (match?
{:json-rpc/call [{:method "wakuext_spectateCommunity"
:params [community-id]}]}
(events/spectate-community {:db {:communities {community-id {}}}} [community-id]))))))
(deftest spectate-community-success-test
(deftest spectate-community-failed
(testing "mark community spectating false"
(is (match?
{:db {:communities {community-id {:spectating false}}}}
(events/spectate-community-failed {} [community-id])))))
(deftest spectate-community-success
(testing "given communities"
(testing "mark first community spectating false"
(is (match?
{:db {:communities {community-id {:spectating false}}}}
(events/spectate-community-success {} [{:communities [{:id community-id}]}]))))
(testing "mark first community spectated true"
(is (match?
{:db {:communities {community-id {:spectated true}}}}
@@ -125,7 +144,7 @@
nil
(events/spectate-community-success {} []))))))
(deftest get-revealed-accounts-test
(deftest get-revealed-accounts
(let [community {:id community-id}]
(testing "given a unjoined community"
(is (match?
@@ -150,7 +169,7 @@
:params [community-id "profile-public-key"]}
(-> effects :json-rpc/call first (select-keys [:method :params]))))))))
(deftest handle-community-test
(deftest handle-community
(let [community {:id community-id :clock 2}]
(testing "given a unjoined community"
(let [effects (events/handle-community {} [community])]
@@ -159,6 +178,7 @@
(is (match?
[[:dispatch
[:communities/check-permissions-to-join-community-with-all-addresses community-id]]
[:dispatch [:chat.ui/spectate-community community-id]]
[:dispatch [:communities/check-permissions-to-join-community community-id]]]
(filter some? (:fx effects))))))
@@ -176,7 +196,8 @@
effects (events/handle-community {} [community])]
(is (match?
[[:dispatch
[:communities/check-permissions-to-join-community-with-all-addresses community-id]]]
[:communities/check-permissions-to-join-community-with-all-addresses community-id]]
[:dispatch [:chat.ui/spectate-community community-id]]]
(filter some? (:fx effects))))))
(testing "given a community with lower clock"
(let [effects (events/handle-community {:db {:communities {community-id {:clock 3}}}} [community])]
@@ -4,6 +4,7 @@
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
[reagent.core :as reagent]
@@ -270,7 +271,7 @@
[_]
(fn [{:keys [enabled label]}]
(when enabled
[quo/blur
[blur/view
{:style style/blur-channel-header
:blur-amount 20
:blur-type :transparent
@@ -1,7 +1,6 @@
(ns status-im.contexts.onboarding.common.background.style
(:require
[quo.foundations.colors :as colors]
[react-native.platform :as platform]))
[quo.foundations.colors :as colors]))
(def background-container
{:background-color colors/neutral-95
@@ -19,4 +18,4 @@
:top 0
:bottom 0
:right 0
:background-color (when platform/ios? colors/neutral-80-opa-80-blur)})
:background-color colors/neutral-80-opa-80-blur})
@@ -1,8 +1,8 @@
(ns status-im.contexts.onboarding.common.background.view
(:require
[oops.core :refer [oget]]
[quo.core :as quo]
[react-native.async-storage :as async-storage]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
@@ -89,7 +89,7 @@
:gesture :swipeable
:background [background-image (* 4 window-width)]}]
(when dark-overlay?
[quo/blur
[blur/view
{:style style/background-blur-overlay
:blur-amount (if platform/android? 30 20)
:blur-radius (if platform/android? 25 10)
@@ -1,7 +1,6 @@
(ns status-im.contexts.onboarding.common.overlay.style
(:require
[quo.foundations.colors :as colors]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]))
(defn blur-container
@@ -16,4 +15,4 @@
(def blur-style
{:flex 1
:background-color (when platform/ios? colors/neutral-80-opa-80-blur)})
:background-color colors/neutral-80-opa-80-blur})
@@ -1,6 +1,6 @@
(ns status-im.contexts.onboarding.common.overlay.view
(:require
[quo.core :as quo]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.platform :as platform]
[react-native.reanimated :as reanimated]
@@ -65,7 +65,7 @@
[reanimated/view
{:pointer-events :none
:style (style/blur-container opacity)}
[quo/blur
[blur/view
{:blur-amount @blur-amount
:blur-radius (if platform/android? 25 10)
:blur-type :transparent
@@ -4,6 +4,7 @@
[oops.core :as oops]
[quo.core :as quo]
[quo.foundations.colors :as colors]
[react-native.blur :as blur]
[react-native.core :as rn]
[react-native.hooks :as hooks]
[react-native.platform :as platform]
@@ -42,7 +43,7 @@
[rn/view {:style {:margin-top :auto}}
(cond
(and (> @height 0) show-background?)
[quo/blur
[blur/ios-view
(when keyboard-shown
{:blur-amount 34
:blur-type :transparent
+14 -1
View File
@@ -1,5 +1,6 @@
(ns status-im.contexts.onboarding.events
(:require
[native-module.core :as native-module]
[re-frame.core :as re-frame]
status-im.common.biometric.events
[status-im.constants :as constants]
@@ -8,7 +9,19 @@
[taoensso.timbre :as log]
[utils.i18n :as i18n]
[utils.re-frame :as rf]
[utils.security.core :as security]))
[utils.security.core :as security]
[utils.transforms :as transforms]))
(re-frame/reg-fx
:multiaccount/validate-mnemonic
(fn [[mnemonic on-success on-error]]
(native-module/validate-mnemonic
(security/safe-unmask-data mnemonic)
(fn [result]
(let [{:keys [error keyUID]} (transforms/json->clj result)]
(if (seq error)
(when on-error (on-error error))
(on-success mnemonic keyUID)))))))
(rf/defn profile-data-set
{:events [:onboarding/profile-data-set]}
@@ -1,23 +0,0 @@
(ns status-im.contexts.preview.quo.banners.alert-banner
(:require
[quo.core :as quo]
[reagent.core :as reagent]
[status-im.contexts.preview.quo.preview :as preview]))
(def descriptor
[{:key :text
:type :text}
{:key :button-text
:type :text}
{:key :action?
:type :boolean}])
(defn view
[]
(let [state (reagent/atom {:action? true
:text "Alert text"
:button-text "Button"
:on-button-press #(js/alert "pressed")})]
(fn []
[preview/preview-container {:state state :descriptor descriptor}
[quo/alert-banner @state]])))
@@ -1,6 +1,7 @@
(ns status-im.contexts.preview.quo.gradient.gradient-cover
(:require
[quo.core :as quo]
[react-native.blur :as blur]
[react-native.core :as rn]
[reagent.core :as reagent]
[status-im.common.resources :as resources]
@@ -62,7 +63,7 @@
[rn/image
{:style {:height 332}
:source (resources/get-mock-image :dark-blur-bg)}])
[(if @blur? quo/blur rn/view)
[(if @blur? blur/view rn/view)
{:style {:height 332
:padding-vertical 40}
:blur-type :dark}
+1 -4
View File
@@ -18,7 +18,6 @@
[status-im.contexts.preview.quo.avatars.user-avatar :as user-avatar]
[status-im.contexts.preview.quo.avatars.wallet-user-avatar :as
wallet-user-avatar]
[status-im.contexts.preview.quo.banners.alert-banner :as alert-banner]
[status-im.contexts.preview.quo.banners.banner :as banner]
[status-im.contexts.preview.quo.browser.browser-input :as browser-input]
[status-im.contexts.preview.quo.buttons.button :as button]
@@ -244,9 +243,7 @@
:component collection-avatar/view}
{:name :account-avatar
:component account-avatar/view}]
:banner [{:name :alert-banners
:component alert-banner/view}
{:name :banner
:banner [{:name :banner
:component banner/view}]
:buttons [{:name :button
:component button/view}
@@ -6,6 +6,7 @@
[quo.core :as quo]
[quo.foundations.colors :as colors]
[quo.theme :as quo.theme]
[react-native.blur :as blur]
[react-native.clipboard :as clipboard]
[react-native.core :as rn]
[react-native.safe-area :as safe-area]
@@ -350,7 +351,7 @@
[rn/image
{:source (or image (resources/get-mock-image :dark-blur-bg))
:style {:height "100%" :width "100%"}}]
[quo/blur
[blur/view
(merge {:style {:position :absolute
:top 0
:bottom 0
@@ -57,6 +57,5 @@
[quo/page-top
{:title-accessibility-label :username
:emoji-dash emoji-hash
:description :text
:description-text bio
:description bio
:title full-name}]]))

Some files were not shown because too many files have changed in this diff Show More