Compare commits
6
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ca916bfb3 | ||
|
|
e40664533d | ||
|
|
f152f8156f | ||
|
|
b206a4e955 | ||
|
|
a18c429fee | ||
|
|
420e3f3586 |
+1
-1
@@ -17,4 +17,4 @@ RPC_NETWORKS_ONLY=0
|
||||
PARTITIONED_TOPIC=0
|
||||
CONTRACT_NODES=1
|
||||
ENABLE_ROOT_ALERT=1
|
||||
ENABLE_REFERRAL_INVITE=0
|
||||
ENABLE_REFERRAL_INVITE=1
|
||||
|
||||
+3
-3
@@ -28,8 +28,8 @@ desktop/ @vkjr
|
||||
modules/react-native-desktop*/ @vkjr
|
||||
modules/react-native-desktop*/ @vkjr
|
||||
|
||||
/doc @oskarth @yenda @jeluard
|
||||
/doc @oskarth @yenda @jeluard
|
||||
|
||||
/deployment @vkjr
|
||||
/deployment @vkjr
|
||||
|
||||
/test/appium/ @churik
|
||||
/test/appium/ @antdanchenko @churik
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
@@ -101,14 +101,12 @@ pipeline {
|
||||
} else { /* if no universal is available pick first */
|
||||
env.PKG_URL = urls.first()
|
||||
}
|
||||
jenkins.setBuildDesc(APK: env.PKG_URL)
|
||||
/* e2e builds get tested in SauceLabs */
|
||||
if (utils.isE2EBuild()) {
|
||||
env.SAUCE_URL = android.uploadToSauceLabs()
|
||||
}
|
||||
if (utils.isNightlyBuild()) {
|
||||
env.DIAWI_URL = android.uploadToDiawi()
|
||||
}
|
||||
if (utils.isE2EBuild()) {
|
||||
env.SAUCE_URL = android.uploadToSauceLabs()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
+2
-3
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos-xcode-11.5' }
|
||||
@@ -99,9 +99,8 @@ pipeline {
|
||||
steps {
|
||||
script {
|
||||
env.PKG_URL = s3.uploadArtifact(api)
|
||||
jenkins.setBuildDesc(IPA: env.PKG_URL)
|
||||
/* e2e builds get tested in SauceLabs */
|
||||
if (utils.isE2EBuild()) {
|
||||
if (btype == 'e2e') {
|
||||
env.SAUCE_URL = ios.uploadToSauceLabs()
|
||||
} else {
|
||||
env.DIAWI_URL = ios.uploadToDiawi()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label params.AGENT_LABEL }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'macos' }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
library 'status-react-jenkins@v1.2.5'
|
||||
library 'status-react-jenkins@v1.2.3'
|
||||
|
||||
pipeline {
|
||||
agent { label 'linux' }
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
# Description
|
||||
|
||||
This document describes how to update Status APK builds for the [F-Droid](https://f-droid.org/) Android application catalogue.
|
||||
|
||||
# Intro
|
||||
|
||||
In simplest terms F-Droid requires a YAML file that defines the steps necessary to create a universal unsigned APK build. This is achieved by submitting a new app versions into the `metadata/im.status.ethereum.yml` file in the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
|
||||
The app builds defined this way run on servers that generate the unsigned APKs using the [fdroidserver](https://gitlab.com/fdroid/fdroidserver) software. The [server setup](https://f-droid.org/en/docs/Build_Server_Setup/) is quite involved but is not necessary unless you want to run your own instance. Normally the applications defines in `fdroiddata` are built by servers maintained by [the F-Droid volunteers](https://f-droid.org/en/contribute/).
|
||||
|
||||
First release of Status app was merged in [fdroid/fdroiddata#7179](https://gitlab.com/fdroid/fdroiddata/-/merge_requests/7179).
|
||||
|
||||
# Adding New Versions
|
||||
|
||||
You can find our configuration file at [`metadata/im.status.ethereum.yml`](https://gitlab.com/fdroid/fdroiddata/-/blob/master/metadata/im.status.ethereum.yml)
|
||||
|
||||
The file defines all the necessary metadata like `SourceCode`, `Website`, or `License`, but the most important key is `Builds`, which looks like this:
|
||||
```yml
|
||||
Builds:
|
||||
- versionName: 1.4.1
|
||||
versionCode: 2020070112
|
||||
commit: cfb825a11b61d312af8cb5d36686af540c31f481
|
||||
sudo:
|
||||
- mkdir -m 0755 /nix
|
||||
- chown vagrant /nix
|
||||
init: ./nix/scripts/setup.sh
|
||||
output: ./result/app-release-unsigned.apk
|
||||
scanignore:
|
||||
- android/build.gradle
|
||||
scandelete:
|
||||
- ios
|
||||
build: make release-android BUILD_TYPE=release BUILD_NUMBER=2020070112 ANDROID_APK_SIGNED=false
|
||||
```
|
||||
It contains a list of objects defining each release of the application. In order to add a new release simply copy a previous release object and adjust the following values:
|
||||
|
||||
* `versionName` - String version like `1.4.1`
|
||||
* `versionCode` - Android `versionCode`. We use a timestamp generated by [a script](../scripts/version/gen_build_no.sh)
|
||||
* `commit` - Specific commit SHA1 from which the given release was built
|
||||
* `BUILD_NUMBER` in `build` step - Same value as `versionCode`
|
||||
|
||||
The `versionCode` should be the same as the one in build that was uplodade to Play Store. It can be found in the build logs or by using:
|
||||
```
|
||||
> apkanalyzer manifest version-code StatusIm-v1.4.1.apk
|
||||
2020070112
|
||||
```
|
||||
|
||||
At the bottom of the file you should also update the following keys:
|
||||
|
||||
* `CurrentVersion` - Same as the new `versionName` added
|
||||
* `CurrentVersionCode` - Same as the `versionCode` added
|
||||
|
||||
Then submit a merge request to the [fdroid/fdroiddata](https://gitlab.com/fdroid/fdroiddata) repository.
|
||||
|
||||
# Checking Builds
|
||||
|
||||
The simplest way to test if the app builds via F-Droid is to use the Docker image:
|
||||
https://gitlab.com/fdroid/docker-executable-fdroidserver
|
||||
|
||||
Which is available under `registry.gitlab.com/fdroid/docker-executable-fdroidserver:latest`.
|
||||
|
||||
Because we use Nix to build the mobile app we need to slightly modify the image with this `Dockerfile`:
|
||||
```Dockerfile
|
||||
FROM registry.gitlab.com/fdroid/docker-executable-fdroidserver:latest
|
||||
ARG BUILDER_UID=1000
|
||||
ENV BUILDER_USER=vagrant
|
||||
RUN useradd -u $BUILDER_UID $BUILDER_USER
|
||||
RUN mkdir -m 0755 /nix /home/$BUILDER_USER \
|
||||
&& chown -R $BUILDER_USER /nix /home/$BUILDER_USER
|
||||
```
|
||||
Build it using:
|
||||
```
|
||||
docker build --build-arg=BUILDER_UID=$UID -t statusteam/docker-executable-fdroidserver:latest .
|
||||
```
|
||||
Then clone the [fdroiddata](https://gitlab.com/fdroid/fdroiddata) and [fdroidserver](https://gitlab.com/fdroid/fdroidserver) repos and use it to test the build of a specific Status Android app version: `1.4.1`
|
||||
```
|
||||
docker run --rm \
|
||||
-u $UID:$GID \
|
||||
-v $(pwd)/nix:/nix \
|
||||
-v $(pwd)/fdroiddata:/repo \
|
||||
-v $(pwd)/fdroidserver:/fdroidserver \
|
||||
statusteam/docker-executable-fdroidserver:latest \
|
||||
build im.status.ethereum:1.4.1
|
||||
```
|
||||
We have to create a user and specify the UID because Nix cannot run as `root` and that is the default user for the F-Droid Docker image. By adding our own user and setting the UID we also make it possible to mount folders like `fdroiddata` and `fdroidserver`.
|
||||
|
||||
You can specify a `--vebose` flag for `build` command for additional information.
|
||||
|
||||
You should also run `lint im.status.ethereum` to verify the YAML format is correct.
|
||||
|
||||
# Details
|
||||
|
||||
The original research was done in [#8512](https://github.com/status-im/status-react/issues/8512).
|
||||
|
||||
Normally F-Droid server wants to run Gradle itself, but we do not specify the `gradle` key in order to run `make release-android` ourselves in `build` step.
|
||||
@@ -1,12 +1,12 @@
|
||||
Status es una herramienta de comunicación segura y privada. Chatea con amigos, almacena activos y explora el futuro de la web sin ser explotado por tu información personal.
|
||||
Status é uma ferramenta de comunicação segura e privada. Converse com os seus amigos, armazene ativos e explore o futuro da web sem que os seus dados sejam explorados.
|
||||
|
||||
Solo tú controlas tu información, con Status.
|
||||
Com a Status, apenas você controlas as suas informações.
|
||||
|
||||
CHAT
|
||||
Status quita de en medio terceros centralizados a tus mensajes. No sólo tu contenido es protegido, sino también tu metadata: por máxima privacidad.
|
||||
CONVERSA
|
||||
A Status remove terceiros centralizados das suas mensagens. Não é apenas o seu conteúdo que está protegido, mas também os seus metadados - para uma privacidade máxima.
|
||||
|
||||
TRANSFIERE
|
||||
Almacena activos digitales en tu monedero Status (ERC20 and ERC721). Envía y recibe monedas de tus amigos, o transfiere activos con aplicaciónes descentralizadas.
|
||||
TRANSACIONA
|
||||
Armazene ativos digitais na sua carteira Status. Envie e solicite tokens aos seus amigos, ou transacione com aplicações descentralizadas.
|
||||
|
||||
EXPLORA
|
||||
Accede a aplicaciones basadas en Ethereum de la Web3. Juega, intercambia bienes digitales y más.
|
||||
Acesse à aplicações baseadas na Ethereum na web3. Joge jogos, troce ativos digitais e muito mais.
|
||||
@@ -1 +1 @@
|
||||
Chatea y transfiere de forma segura
|
||||
Converse e faça transações de uma forma segura
|
||||
@@ -1 +1 @@
|
||||
Status - Comunicación Privada
|
||||
Status - Comunição Privada
|
||||
+7
-7
@@ -334,7 +334,7 @@ PODS:
|
||||
- React
|
||||
- RNFS (2.16.6):
|
||||
- React
|
||||
- RNGestureHandler (1.8.0):
|
||||
- RNGestureHandler (1.6.1):
|
||||
- React
|
||||
- RNImageCropPicker (0.31.1):
|
||||
- React-Core
|
||||
@@ -353,9 +353,9 @@ PODS:
|
||||
- React
|
||||
- RNReactNativeHapticFeedback (1.9.0):
|
||||
- React
|
||||
- RNReanimated (1.13.0):
|
||||
- RNReanimated (1.8.0):
|
||||
- React
|
||||
- RNScreens (2.10.1):
|
||||
- RNScreens (2.5.0):
|
||||
- React
|
||||
- RNSVG (9.13.6):
|
||||
- React
|
||||
@@ -601,7 +601,7 @@ SPEC CHECKSUMS:
|
||||
Flipper-RSocket: 64e7431a55835eb953b0bf984ef3b90ae9fdddd7
|
||||
FlipperKit: afd4259ef9eadeeb2d30250b37d95cb3b6b97a69
|
||||
Folly: 30e7936e1c45c08d884aa59369ed951a8e68cf51
|
||||
glog: d6cca0516fb0ca3697a5b2e199ea83dfc7133411
|
||||
glog: 1f3da668190260b06b429bb211bfbee5cd790c28
|
||||
OpenSSL-Universal: 8b48cc0d10c1b2923617dfe5c178aa9ed2689355
|
||||
Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b
|
||||
Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c
|
||||
@@ -643,14 +643,14 @@ SPEC CHECKSUMS:
|
||||
RNCPushNotificationIOS: c145c6253ea016e5efeff604f2720736b4a596f7
|
||||
RNDeviceInfo: b6e650fbd234732c759544218657d549b4339038
|
||||
RNFS: 2bd9eb49dc82fa9676382f0585b992c424cd59df
|
||||
RNGestureHandler: 7a5833d0f788dbd107fbb913e09aa0c1ff333c39
|
||||
RNGestureHandler: 8f09cd560f8d533eb36da5a6c5a843af9f056b38
|
||||
RNImageCropPicker: 38865ab4af1b0b2146ad66061196bc0184946855
|
||||
RNKeychain: 216f37338fcb9e5c3a2530f1e3295f737a690cb1
|
||||
RNLanguages: 962e562af0d34ab1958d89bcfdb64fafc37c513e
|
||||
RNPermissions: ad71dd4f767ec254f2cd57592fbee02afee75467
|
||||
RNReactNativeHapticFeedback: 2566b468cc8d0e7bb2f84b23adc0f4614594d071
|
||||
RNReanimated: 89f5e0a04d1dd52fbf27e7e7030d8f80a646a3fc
|
||||
RNScreens: b748efec66e095134c7166ca333b628cd7e6f3e2
|
||||
RNReanimated: 955cf4068714003d2f1a6e2bae3fb1118f359aff
|
||||
RNScreens: ac02d0e4529f08ced69f5580d416f968a6ec3a1d
|
||||
RNSVG: 8ba35cbeb385a52fd960fd28db9d7d18b4c2974f
|
||||
SQLCipher: f9fcf29b2e59ced7defc2a2bdd0ebe79b40d4990
|
||||
SSZipArchive: 62d4947b08730e4cda640473b0066d209ff033c9
|
||||
|
||||
-45
@@ -9,7 +9,6 @@ import android.content.SharedPreferences;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.core.content.FileProvider;
|
||||
@@ -17,15 +16,9 @@ import androidx.core.content.FileProvider;
|
||||
import android.util.Log;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.webkit.WebView;
|
||||
import android.webkit.CookieManager;
|
||||
import android.webkit.CookieSyncManager;
|
||||
import android.webkit.WebStorage;
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
import android.widget.EditText;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
|
||||
import com.facebook.react.bridge.Arguments;
|
||||
import com.facebook.react.bridge.Callback;
|
||||
@@ -37,9 +30,6 @@ import com.facebook.react.bridge.ReadableMap;
|
||||
import com.facebook.react.bridge.ReadableArray;
|
||||
import com.facebook.react.bridge.WritableMap;
|
||||
import com.facebook.react.modules.core.DeviceEventManagerModule;
|
||||
import com.facebook.react.uimanager.UIManagerModule;
|
||||
import com.facebook.react.uimanager.UIBlock;
|
||||
import com.facebook.react.uimanager.NativeViewHierarchyManager;
|
||||
|
||||
import statusgo.SignalHandler;
|
||||
import statusgo.Statusgo;
|
||||
@@ -1052,22 +1042,6 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void toggleWebviewDebug(final boolean val) {
|
||||
Log.d(TAG, "toggleWebviewDebug");
|
||||
final Activity activity = getCurrentActivity();
|
||||
if (activity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
activity.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
WebView.setWebContentsDebuggingEnabled(val);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void clearStorageAPIs() {
|
||||
Log.d(TAG, "clearStorageAPIs");
|
||||
@@ -1412,24 +1386,5 @@ class StatusModule extends ReactContextBaseJavaModule implements LifecycleEventL
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ReactMethod
|
||||
public void resetKeyboardInputCursor(final int reactTagToReset, final int selection) {
|
||||
UIManagerModule uiManager = getReactApplicationContext().getNativeModule(UIManagerModule.class);
|
||||
uiManager.addUIBlock(new UIBlock() {
|
||||
@Override
|
||||
public void execute(NativeViewHierarchyManager nativeViewHierarchyManager) {
|
||||
InputMethodManager imm = (InputMethodManager) getReactApplicationContext().getBaseContext().getSystemService(Context.INPUT_METHOD_SERVICE);
|
||||
if (imm != null) {
|
||||
View viewToReset = nativeViewHierarchyManager.resolveView(reactTagToReset);
|
||||
imm.restartInput(viewToReset);
|
||||
try {
|
||||
EditText textView = (EditText) viewToReset;
|
||||
textView.setSelection(selection);
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+51
-61
@@ -3668,16 +3668,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "commons-codec/commons-codec/1.15/commons-codec-1.15",
|
||||
"path": "commons-codec/commons-codec/1.14/commons-codec-1.14",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "c08f2dcdbba1a9466f3f9fa05e669fd61c3a47b7",
|
||||
"sha256": "0n5b40x4wsmygna7fivix3cy9rs2yv5ikx30g141adsslfcf2vn8"
|
||||
"sha1": "3e98fb226cb1c6a9caa5fdb2a522ba42f4ea16d2",
|
||||
"sha256": "19mp203aw77s79mv7gqcqdg0i8mww4dcih66pvw6z5s9z31611cn"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "49d94806b6e3dc933dacbd8acb0fdbab8ebd1e5d",
|
||||
"sha256": "0qzd8v96j4x7jjcfpvvdh9ar1xhwxpxi2rh51nzhj0br7bbgdsdk"
|
||||
"sha1": "3cb1181b2141a7e752f5bdc998b7ef1849f726cf",
|
||||
"sha256": "1s9kmlbms3hbmvp3rd4ff45h61ly05rjikv4xlfkirdb7zwy8a51"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5676,16 +5676,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/squareup/okhttp3/okhttp/4.9.0/okhttp-4.9.0",
|
||||
"path": "com/squareup/okhttp3/okhttp/4.8.1/okhttp-4.8.1",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "8806abdf57ce7ec2d72b5a89eb79ec8907af7eb0",
|
||||
"sha256": "125x8lm1iz2hf9dsxhd25dgpw4x70s2bravwj609wl44wzfr52ag"
|
||||
"sha1": "06674a5ab0fe82b134a2fe02a18ccf9c51e9a0b2",
|
||||
"sha256": "08dyq3vxk27na7d5g3p100vi5ihplf6ylrsyibg7lzfc4sxdawmc"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "08e17601d3bdc8cf57902c154de021931d2c27c1",
|
||||
"sha256": "0z0zaw06f2ihgs1rik50b4y3sjkgk6nwqqv20ksbj0mhxh2bphnv"
|
||||
"sha1": "dd36d61fbfa0a33c805e3d92f64e0832234c56c6",
|
||||
"sha256": "1scg21n0a41rhv2n4crx62kmfl5yavj45hgl97acw3c7kccgaggi"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -5724,16 +5724,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "com/squareup/okio/okio/2.8.0/okio-2.8.0",
|
||||
"path": "com/squareup/okio/okio/2.7.0/okio-2.7.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "db3559887f215bc3cdbb4ad37d246d04fbbdff8e",
|
||||
"sha256": "10clihpazwlsml3jhn2pqi8w37cs5a07d1gyr1x46zsczml40896"
|
||||
"sha1": "c171afa3f9084ec998ad1ff7b24e7b857b5bdf24",
|
||||
"sha256": "1p1fnhr6rbry0r1y97mwr5fmb6ld5bf7gd7234yafjj3fhjvh1hw"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "49b64e09d81c0cc84b267edd0c2fd7df5a64c78c",
|
||||
"sha256": "1j5v14ps6s5c9i2ran6zcm2gmqicvzjlcgrrlpccsbwqfdpb15j4"
|
||||
"sha1": "1181a029fa94760ccf46f264bc06ca2e60262f8f",
|
||||
"sha256": "1fc65k52z6zxrbahs0fzigpyb0290870fwxslgc5c0hdvsx05ck3"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6699,16 +6699,6 @@
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/apache/23/apache-23",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "0404949e96725e63a10a6d8f9d9b521948d170d5",
|
||||
"sha256": "07298c2jfkdb6gaxidig2pnl0ckdjfi9qqy5z9vnbwr30r76445w"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
@@ -6866,12 +6856,12 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/apache/commons/commons-parent/52/commons-parent-52",
|
||||
"path": "org/apache/commons/commons-parent/50/commons-parent-50",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "004ee86dedc66d0010ccdc29e5a4ce014c057854",
|
||||
"sha256": "0bjhnkdhdsdcc12daiqhbwxwvjxlkqplmbns8bzw7r4q9vryinvm"
|
||||
"sha1": "b47c55b7ee647e1c78546791e7f4fe59b842c320",
|
||||
"sha256": "01kz260pqzil5h2rv1rjvrpf4aq7r3pxalzmcxc4n1s7yyrjsykv"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7368,16 +7358,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/checkerframework/checker-qual/3.6.1/checker-qual-3.6.1",
|
||||
"path": "org/checkerframework/checker-qual/3.6.0/checker-qual-3.6.0",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "5a9e629db8b2dc58bf7199c4c5a9c2aa3226540f",
|
||||
"sha256": "0x2fg03ccsrzhh2x5jknqm9g4cszcyqm9wasm69pwzvai1a23pbs"
|
||||
"sha1": "cc9a54c245d87d07533a5534ec607d88a66ea82a",
|
||||
"sha256": "16hhzdvv7jlwzvfjaf5f2l4b7n0lbwnwgkbfhx3i6r7zgpw320yl"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "52ca62b41f68584c4d2de39d6176758e9383d0b6",
|
||||
"sha256": "0a7q2lhqbrgf5ll16zqima1q6rpn6x2m5fnli21ahlc1b4n4dl3w"
|
||||
"sha1": "b39405a5894b39073ad0e70671edd39b673e259a",
|
||||
"sha256": "0c751lskwkdkkl9ch6scfcxim2sn0knl6mmwzskfq2dpdb4djkrv"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7774,12 +7764,12 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jacoco/org.jacoco.build/0.8.6/org.jacoco.build-0.8.6",
|
||||
"path": "org/jacoco/org.jacoco.build/0.8.5/org.jacoco.build-0.8.5",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "pom",
|
||||
"pom": {
|
||||
"sha1": "3fb028eaf46f792cfd65b2d65be7e5d175623378",
|
||||
"sha256": "1yahzgqvhsghcvss2nm9pjm53qypv07fr8ndni2irkdqskzpf56r"
|
||||
"sha1": "ad6a35af94c242182132ceba52f07620ca80832a",
|
||||
"sha256": "1jn13ax45dyp6j5ly95p4z8qd6990884v8279zmxnzb44z940vmd"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -7798,16 +7788,16 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jacoco/org.jacoco.core/0.8.6/org.jacoco.core-0.8.6",
|
||||
"path": "org/jacoco/org.jacoco.core/0.8.5/org.jacoco.core-0.8.5",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "6f4a9abb3333a92f028bf444b596a7b7648db111",
|
||||
"sha256": "1pk3rwz5fm9ns70rf4r2nyly56xg5kq10hqqamzsyrvh57ggxfx3"
|
||||
"sha1": "dc976cf0d68a488c893d9b7957d63e61d597c85a",
|
||||
"sha256": "1vvlncgffkg9yv1djlnmv6vsi6pmzwx393bv9xdxyc87csz9pxrd"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "8c20544d06b8a54de1a585e4fcd0b101c0b433d9",
|
||||
"sha256": "1zxn67mkafvk9x5vjdryyzn25yvmk7vgnfp3f2mpdyh1piiwnjwn"
|
||||
"sha1": "1ac96769aa83e5492d1a1a694774f6baec4eb704",
|
||||
"sha256": "1p8d3x473wi3ccpd1kigfps4sfxqn9l9a279kqsh777qa38ihn4l"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8260,30 +8250,30 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.3.70/kotlin-stdlib-common-1.3.70",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "03055a223c66d74a15ae3f53870e910e769483ff",
|
||||
"sha256": "02mx38iv2y3afvmv7bgmqrzsfgz5bm484ryf264gaj1jb929mrcq"
|
||||
"sha1": "bd1d0642aedfd3780a730235af7499706225ccb3",
|
||||
"sha256": "1qr8i917sznbmrdsvk8q4ggjic8k7qsij4337zyrfs3mmby2n5kn"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "1c752cce0ead8d504ccc88a4fed6471fd83ab0dd",
|
||||
"sha256": "1lgpr4rrvmnm4j4v10jhykgy8b281drkmi7nf7lfajsdsw2f00c6"
|
||||
"sha1": "3fa8dd6c896d635e78201e5e811545f3846dec04",
|
||||
"sha256": "0l1sylyady51n9c882l67w72a2sp7c9ip5998jr2z3w9qk7pf8vf"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.4.10/kotlin-stdlib-common-1.4.10",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib-common/1.3.72/kotlin-stdlib-common-1.3.72",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "a7a2da276e4c795619d6dd862cf8db356906ca3c",
|
||||
"sha256": "002xa53xg74zhfsgh6p17xzs6k2lbzj91zx694mp9pnllxr0wj33"
|
||||
"sha1": "c4e521d2c0af9e771afbfc11fff4b2f5111b2678",
|
||||
"sha256": "1p79gfryfclii2cjda1rc8a0swcy3f8wibyw614q0d09bggiwy14"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "6229be3465805c99db1142ad75e6c6ddeac0b04c",
|
||||
"sha256": "1zkl29qhssa8m3k92z7nl2fjyf71b1byv12xb4ipb3566vag50a6"
|
||||
"sha1": "6ca8bee3d88957eaaaef077c41c908c9940492d8",
|
||||
"sha256": "0fi0f98xmb05b8hhc093nzsjky0f4g73kk5i50b0qj1yhr91azay"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -8484,30 +8474,30 @@
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.4.0/kotlin-stdlib-1.4.0",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.70/kotlin-stdlib-1.3.70",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "4758d9ec733fd494e6e67fe493d6ac60cd30659d",
|
||||
"sha256": "0jkdpk6qkhf8jwqp6jrwwqnr39p8z56kmnyg6dg03f92qjppvdix"
|
||||
"sha1": "018c32fc0020da57fc1ea22f6d276d672ea91ab1",
|
||||
"sha256": "0j2hs6zpcrnllx3pzp0nqfz7snsqb75135mb4h4jx33kqlahnhgz"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "63e75298e93d4ae0b299bb869cf0c627196f8843",
|
||||
"sha256": "1cbyxn0wwjcawl6klm2dgcxxhl3xgj4f5w8nk8bqy1g9wvk16sk1"
|
||||
"sha1": "e5d97e25bb5b30dcfc022ec1c8f3959a875257fb",
|
||||
"sha256": "0crjz4wykw5qrb5mxg5nsl06crlfnawvwsld53g1qa1alc73q11j"
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10",
|
||||
"path": "org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72",
|
||||
"host": "https://repo.maven.apache.org/maven2",
|
||||
"type": "jar",
|
||||
"pom": {
|
||||
"sha1": "1ae8d0e617a4e272ce07664ad928c57b171e31f9",
|
||||
"sha256": "0qi77kk5dssssijv0j4fav5zgh5rbxvjrm943spj79dx9fxwzfd4"
|
||||
"sha1": "aecbe532bd46a37d2217a63cc0fed4eca0bd71cc",
|
||||
"sha256": "10cl234gh961grj2rmvq89cb9azzscg3w5lac92kracyjr55f3ag"
|
||||
},
|
||||
"jar": {
|
||||
"sha1": "ea29e063d2bbe695be13e9d044dcfb0c7add398e",
|
||||
"sha256": "1aldbd3x859ldvyhlh05bllhnd48l4hwz6l3q4qvjhn0habv1v01"
|
||||
"sha1": "8032138f12c0180bc4e51fe139d4c52b46db6109",
|
||||
"sha256": "0sxisi1q565c8nwvd4pacjjwbhjdkknjyaw0wqdnvkdskqsafmiq"
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
+11
-12
@@ -260,7 +260,7 @@ https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.4/commons-cod
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.6/commons-codec-1.6.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.9/commons-codec-1.9.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.10/commons-codec-1.10.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.15/commons-codec-1.15.pom
|
||||
https://repo.maven.apache.org/maven2/commons-codec/commons-codec/1.14/commons-codec-1.14.pom
|
||||
https://repo.maven.apache.org/maven2/commons-io/commons-io/2.4/commons-io-2.4.pom
|
||||
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.pom
|
||||
https://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.2/commons-logging-1.2.pom
|
||||
@@ -410,11 +410,11 @@ https://repo.maven.apache.org/maven2/com/squareup/javapoet/1.8.0/javapoet-1.8.0.
|
||||
https://repo.maven.apache.org/maven2/com/squareup/javawriter/2.5.0/javawriter-2.5.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/3.12.1/okhttp-urlconnection-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/3.12.1/okhttp-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.9.0/okhttp-4.9.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.8.1/okhttp-4.8.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okhttp3/parent/3.12.1/parent-3.12.1.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio-parent/1.15.0/okio-parent-1.15.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/1.15.0/okio-1.15.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/2.8.0/okio-2.8.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/squareup/okio/okio/2.7.0/okio-2.7.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/all/1.2.0/all-1.2.0.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/all/2.0.0-RC3/all-2.0.0-RC3.pom
|
||||
https://repo.maven.apache.org/maven2/com/sun/activation/jakarta.activation/2.0.0-RC3/jakarta.activation-2.0.0-RC3.pom
|
||||
@@ -494,7 +494,6 @@ https://repo.maven.apache.org/maven2/org/apache/apache/15/apache-15.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/16/apache-16.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/18/apache-18.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/21/apache-21.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/apache/23/apache-23.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.8.1/commons-compress-1.8.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.12/commons-compress-1.12.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-lang3/3.3.2/commons-lang3-3.3.2.pom
|
||||
@@ -509,7 +508,7 @@ https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/34/common
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/35/commons-parent-35.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/39/commons-parent-39.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/48/commons-parent-48.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/52/commons-parent-52.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/commons/commons-parent/50/commons-parent-50.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.2.6/httpclient-4.2.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/apache/httpcomponents/httpclient/4.5.2/httpclient-4.5.2.pom
|
||||
@@ -550,7 +549,7 @@ https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.56/bcprov
|
||||
https://repo.maven.apache.org/maven2/org/bouncycastle/bcprov-jdk15on/1.60/bcprov-jdk15on-1.60.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-compat-qual/2.5.5/checker-compat-qual-2.5.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/2.5.2/checker-qual-2.5.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.6.1/checker-qual-3.6.1.pom
|
||||
https://repo.maven.apache.org/maven2/org/checkerframework/checker-qual/3.6.0/checker-qual-3.6.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/4/codehaus-parent-4.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/groovy/groovy-all/2.4.15/groovy-all-2.4.15.pom
|
||||
https://repo.maven.apache.org/maven2/org/codehaus/mojo/animal-sniffer-annotations/1.14/animal-sniffer-annotations-1.14.pom
|
||||
@@ -583,9 +582,9 @@ https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-core/2.2/hamcrest-cor
|
||||
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest-parent/1.3/hamcrest-parent-1.3.pom
|
||||
https://repo.maven.apache.org/maven2/org/hamcrest/hamcrest/2.2/hamcrest-2.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.7.4.201502262128/org.jacoco.build-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.8.6/org.jacoco.build-0.8.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.build/0.8.5/org.jacoco.build-0.8.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.7.4.201502262128/org.jacoco.core-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.8.6/org.jacoco.core-0.8.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.core/0.8.5/org.jacoco.core-0.8.5.pom
|
||||
https://repo.maven.apache.org/maven2/org/jacoco/org.jacoco.report/0.7.4.201502262128/org.jacoco.report-0.7.4.201502262128.pom
|
||||
https://repo.maven.apache.org/maven2/org/jdom/jdom2/2.0.6/jdom2-2.0.6.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/annotations/13.0/annotations-13.0.pom
|
||||
@@ -618,8 +617,8 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.20/kotlin-stdlib-common-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.31/kotlin-stdlib-common-1.3.31.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.50/kotlin-stdlib-common-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.0/kotlin-stdlib-common-1.4.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.4.10/kotlin-stdlib-common-1.4.10.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.70/kotlin-stdlib-common-1.3.70.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.3.72/kotlin-stdlib-common-1.3.72.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.2.71/kotlin-stdlib-jdk7-1.2.71.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.20/kotlin-stdlib-jdk7-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.3.50/kotlin-stdlib-jdk7-1.3.50.pom
|
||||
@@ -634,8 +633,8 @@ https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.0/ko
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.20/kotlin-stdlib-1.3.20.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.31/kotlin-stdlib-1.3.31.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.50/kotlin-stdlib-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.0/kotlin-stdlib-1.4.0.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.4.10/kotlin-stdlib-1.4.10.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.70/kotlin-stdlib-1.3.70.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib/1.3.72/kotlin-stdlib-1.3.72.pom
|
||||
https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-util-io/1.3.50/kotlin-util-io-1.3.50.pom
|
||||
https://repo.maven.apache.org/maven2/org/junit/jupiter/junit-jupiter-api/5.5.2/junit-jupiter-api-5.5.2.pom
|
||||
https://repo.maven.apache.org/maven2/org/junit/platform/junit-platform-commons/1.5.2/junit-platform-commons-1.5.2.pom
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Helper for verifying an environment variable is set
|
||||
name: ''
|
||||
if [[ -z ''$${name} ]]; then
|
||||
echo 'WARNING! Env var not set: ${name}' >&2
|
||||
echo 'Not env var set: ${name}' >&2
|
||||
exit 1
|
||||
fi
|
||||
''
|
||||
+1
-1
@@ -4,5 +4,5 @@
|
||||
getConfig = import ./getConfig.nix { inherit lib config; };
|
||||
mkFilter = import ./mkFilter.nix { inherit lib; };
|
||||
mergeSh = import ./mergeSh.nix { inherit lib; };
|
||||
checkEnvVarSet = import ./checkEnvVarSet.nix;
|
||||
assertEnvVarSet = import ./assertEnvVarSet.nix;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,6 @@
|
||||
|
||||
{ stdenv, lib, deps, pkgs }:
|
||||
|
||||
# Path to the file containing secret environment variables
|
||||
{ secretsFile ? "" }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "status-react-build-jsbundle-android";
|
||||
src =
|
||||
@@ -39,19 +36,8 @@ stdenv.mkDerivation {
|
||||
};
|
||||
};
|
||||
buildInputs = with pkgs; [ clojure nodejs bash git openjdk];
|
||||
phases = [
|
||||
"unpackPhase" "secretsPhase" "patchPhase"
|
||||
"configurePhase" "buildPhase" "installPhase"
|
||||
];
|
||||
|
||||
# For optional INFURA_TOKEN variable
|
||||
secretsPhase = if (secretsFile != "") then ''
|
||||
source "${secretsFile}"
|
||||
${lib.checkEnvVarSet "INFURA_TOKEN"}
|
||||
'' else ''
|
||||
echo "No secrets provided!"
|
||||
'';
|
||||
|
||||
phases = [ "unpackPhase" "patchPhase" "configurePhase" "buildPhase" "installPhase" ];
|
||||
# Patching shadow-cljs.edn so it uses the local maven repo of dependencies provided by Nix
|
||||
patchPhase =
|
||||
let anchor = ''{:source-paths ["src" "test/cljs"]'';
|
||||
|
||||
@@ -17,10 +17,7 @@ assert (lib.stringLength watchmanSockPath) > 0 -> stdenv.isDarwin;
|
||||
let
|
||||
inherit (lib)
|
||||
toLower optionalString stringLength assertMsg
|
||||
getConfig makeLibraryPath checkEnvVarSet elem;
|
||||
|
||||
# Pass secretsFile for INFURA_TOKEN to jsbundle build
|
||||
builtJsBundle = jsbundle { inherit secretsFile; };
|
||||
getConfig makeLibraryPath assertEnvVarSet elem;
|
||||
|
||||
buildType = getConfig "build-type" "release";
|
||||
buildNumber = getConfig "build-number" 9999;
|
||||
@@ -87,8 +84,8 @@ in stdenv.mkDerivation rec {
|
||||
STATUS_GO_ANDROID_LIBDIR = "${status-go}";
|
||||
|
||||
phases = [
|
||||
"unpackPhase" "secretsPhase" "keystorePhase"
|
||||
"buildPhase" "checkPhase" "installPhase"
|
||||
"unpackPhase" "secretsPhase" "secretsCheckPhase"
|
||||
"keystorePhase" "buildPhase" "checkPhase" "installPhase"
|
||||
];
|
||||
|
||||
unpackPhase = ''
|
||||
@@ -101,7 +98,7 @@ in stdenv.mkDerivation rec {
|
||||
cp -bf ./${envFileName} ./.env
|
||||
|
||||
# Copy index.js and app/ input files
|
||||
cp -ra --no-preserve=ownership ${builtJsBundle}/* ./
|
||||
cp -ra --no-preserve=ownership ${jsbundle}/* ./
|
||||
|
||||
# Copy android/ directory
|
||||
mkdir -p ./android/build
|
||||
@@ -119,9 +116,6 @@ in stdenv.mkDerivation rec {
|
||||
# if secretsFile is not set we use generate keystore
|
||||
secretsPhase = if (secretsFile != "") then ''
|
||||
source "${secretsFile}"
|
||||
${checkEnvVarSet "KEYSTORE_ALIAS"}
|
||||
${checkEnvVarSet "KEYSTORE_PASSWORD"}
|
||||
${checkEnvVarSet "KEYSTORE_KEY_PASSWORD"}
|
||||
'' else keystore.shellHook;
|
||||
|
||||
# if keystorePath is set copy it into build directory
|
||||
@@ -131,6 +125,11 @@ in stdenv.mkDerivation rec {
|
||||
export KEYSTORE_PATH="$PWD/status-im.keystore"
|
||||
cp -a --no-preserve=ownership "${keystorePath}" "$KEYSTORE_PATH"
|
||||
'';
|
||||
secretsCheckPhase = ''
|
||||
${assertEnvVarSet "KEYSTORE_ALIAS"}
|
||||
${assertEnvVarSet "KEYSTORE_PASSWORD"}
|
||||
${assertEnvVarSet "KEYSTORE_KEY_PASSWORD"}
|
||||
'';
|
||||
buildPhase = let
|
||||
adhocEnvVars = optionalString stdenv.isLinux
|
||||
"LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${makeLibraryPath [ pkgs.zlib ]}";
|
||||
|
||||
+8
-8
@@ -19,9 +19,9 @@
|
||||
"@react-native-community/netinfo": "^4.4.0",
|
||||
"@react-native-community/push-notification-ios": "^1.4.1",
|
||||
"@react-native-community/slider": "^3.0.0",
|
||||
"@react-navigation/bottom-tabs": "^5.8.0",
|
||||
"@react-navigation/native": "^5.7.3",
|
||||
"@react-navigation/stack": "^5.9.0",
|
||||
"@react-navigation/bottom-tabs": "^5.7.0",
|
||||
"@react-navigation/native": "^5.7.0",
|
||||
"@react-navigation/stack": "^5.7.0",
|
||||
"bignumber.js": "git+https://github.com/status-im/bignumber.js.git#v4.0.2-status",
|
||||
"buffer": "^5.4.2",
|
||||
"chance": "^1.1.0",
|
||||
@@ -43,7 +43,7 @@
|
||||
"react-native-dialogs": "^1.0.4",
|
||||
"react-native-fetch-polyfill": "^1.1.2",
|
||||
"react-native-fs": "^2.14.1",
|
||||
"react-native-gesture-handler": "^1.8.0",
|
||||
"react-native-gesture-handler": "^1.6.0",
|
||||
"react-native-haptic-feedback": "^1.9.0",
|
||||
"react-native-image-crop-picker": "^0.31.1",
|
||||
"react-native-image-resizer": "^1.2.3",
|
||||
@@ -53,16 +53,16 @@
|
||||
"react-native-mail": "git+https://github.com/status-im/react-native-mail.git#v4.0.0-status",
|
||||
"react-native-navigation-bar-color": "^2.0.1",
|
||||
"react-native-permissions": "^2.1.5",
|
||||
"react-native-reanimated": "^1.13.0",
|
||||
"react-native-reanimated": "^1.7.0",
|
||||
"react-native-redash": "^14.2.2",
|
||||
"react-native-safe-area-context": "^2.0.0",
|
||||
"react-native-screens": "^2.10.1",
|
||||
"react-native-screens": "^2.3.0",
|
||||
"react-native-shake": "^3.3.1",
|
||||
"react-native-splash-screen": "^3.2.0",
|
||||
"react-native-status-keycard": "git+https://github.com/status-im/react-native-status-keycard.git#v2.5.23",
|
||||
"react-native-svg": "^9.8.4",
|
||||
"react-native-touch-id": "^4.4.1",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#v10.9.2",
|
||||
"react-native-webview": "git+https://github.com/status-im/react-native-webview.git#v10.2.3_7",
|
||||
"tdigest": "^0.1.1",
|
||||
"web3-utils": "^1.2.1"
|
||||
},
|
||||
@@ -78,6 +78,6 @@
|
||||
"nyc": "^14.1.1",
|
||||
"process": "0.11.10",
|
||||
"rn-snoopy": "git+https://github.com/status-im/rn-snoopy.git#v2.0.2-status",
|
||||
"shadow-cljs": "^2.10.14"
|
||||
"shadow-cljs": "2.9.2"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,11 +160,6 @@
|
||||
return sendAPIrequest('qr-code', {regex: regex});
|
||||
};
|
||||
|
||||
EthereumProvider.prototype.on = function (type, handler)
|
||||
{
|
||||
console.log("Not supported by Status")
|
||||
}
|
||||
|
||||
EthereumProvider.prototype.request = function (requestArguments)
|
||||
{
|
||||
if (!requestArguments) {
|
||||
|
||||
+13
-20
@@ -7,19 +7,20 @@ GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
|
||||
source "${GIT_ROOT}/scripts/colors.sh"
|
||||
|
||||
function must_get_env() {
|
||||
declare -n VAR_VALUE="$1"
|
||||
if [[ -n "${VAR_VALUE}" ]]; then
|
||||
echo "${VAR_VALUE}"
|
||||
declare -n VAR_NAME="$1"
|
||||
if [[ -n "${VAR_NAME}" ]]; then
|
||||
echo "${VAR_NAME}"
|
||||
return
|
||||
fi
|
||||
echo -e "${RED}No required env variable:${RST} ${BLD}${!VAR_VALUE}${RST}" 1>&2
|
||||
echo -e "${RED}No required env variable:${RST} ${BLD}${!VAR_NAME}${RST}" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
function append_env_export() {
|
||||
VAR_NAME=${1}
|
||||
VAR_VALUE=$(must_get_env "${VAR_NAME}")
|
||||
echo "export ${VAR_NAME}=\"${VAR_VALUE}\";" >> "${SECRETS_FILE_PATH}"
|
||||
ENV_VAR_NAME=${1}
|
||||
if [[ -n "${!ENV_VAR_NAME}" ]]; then
|
||||
echo "export ${ENV_VAR_NAME}=\"${!ENV_VAR_NAME}\";" >> "${SECRETS_FILE_PATH}"
|
||||
fi
|
||||
}
|
||||
|
||||
config=''
|
||||
@@ -37,23 +38,15 @@ config+="status-im.android.abi-split=\"$(must_get_env ANDROID_ABI_SPLIT)\";"
|
||||
config+="status-im.android.abi-include=\"$(must_get_env ANDROID_ABI_INCLUDE)\";"
|
||||
nixOpts=()
|
||||
|
||||
# We create if now so the trap knows its location
|
||||
export SECRETS_FILE_PATH=$(mktemp)
|
||||
chmod 644 ${SECRETS_FILE_PATH}
|
||||
# If secrets file was created we want to remove it.
|
||||
trap "rm -vf ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT
|
||||
# Secrets like this can't be passed via args or they end up in derivation.
|
||||
# If no secrets were passed there's no need to pass the 'secretsFile'
|
||||
if [[ -n "${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}${KEYSTORE_ALIAS}" ]]; then
|
||||
# WARNING: All three have to be set!
|
||||
# Secrets like this can't be passed via args or they end up in derivation
|
||||
SECRETS_FILE_PATH=$(mktemp)
|
||||
trap "rm -f ${SECRETS_FILE_PATH}" EXIT ERR INT QUIT
|
||||
chmod 644 ${SECRETS_FILE_PATH}
|
||||
append_env_export 'KEYSTORE_PASSWORD'
|
||||
append_env_export 'KEYSTORE_ALIAS'
|
||||
append_env_export 'KEYSTORE_KEY_PASSWORD'
|
||||
fi
|
||||
if [[ -n "${INFURA_TOKEN}" ]]; then
|
||||
append_env_export 'INFURA_TOKEN'
|
||||
fi
|
||||
# If no secrets were passed there's no need to pass the 'secretsFile'.
|
||||
if [[ -s "${SECRETS_FILE_PATH}" ]]; then
|
||||
nixOpts+=("--argstr" "secretsFile" "${SECRETS_FILE_PATH}")
|
||||
fi
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ if [[ ! -x "$(command -v nix-prefetch-url)" ]] && [[ -z "${IN_NIX_SHELL}" ]]; th
|
||||
exit 1
|
||||
fi
|
||||
|
||||
set -ef
|
||||
set -eof pipefail
|
||||
|
||||
GIT_ROOT="$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)"
|
||||
VERSION_FILE="${GIT_ROOT}/status-go-version.json"
|
||||
@@ -20,7 +20,6 @@ HELP_MESSAGE=$(cat <<-END
|
||||
This is a tool for upgrading status-go to a given version in:
|
||||
${VERSION_FILE}
|
||||
Which is then used by Nix derivations to build status-go for the app.
|
||||
If the given name matches both a branch and a tag the tag is used.
|
||||
|
||||
Usage:
|
||||
${SCRIPT_FILE} {version}
|
||||
@@ -56,18 +55,7 @@ if [[ "${STATUS_GO_VERSION}" = PR-* ]]; then
|
||||
fi
|
||||
|
||||
# ls-remote finds only tags, branches, and pull requests, but can't find commits
|
||||
STATUS_GO_MATCHING_REFS=$(git ls-remote ${REPO_URL} ${STATUS_GO_VERSION})
|
||||
|
||||
# It's possible that there's both a branch and a tag matching the given version
|
||||
STATUS_GO_TAG_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/tags' | cut -f1)
|
||||
STATUS_GO_BRANCH_SHA1=$(echo "${STATUS_GO_MATCHING_REFS}" | grep 'refs/heads' | cut -f1)
|
||||
|
||||
# Prefer tag over branch if both are found
|
||||
if [[ -n "${STATUS_GO_TAG_SHA1}" ]]; then
|
||||
STATUS_GO_COMMIT_SHA1="${STATUS_GO_TAG_SHA1}"
|
||||
else
|
||||
STATUS_GO_COMMIT_SHA1="${STATUS_GO_BRANCH_SHA1}"
|
||||
fi
|
||||
STATUS_GO_COMMIT_SHA1=$(git ls-remote ${REPO_URL} ${STATUS_GO_VERSION} | cut -f1)
|
||||
|
||||
if [[ -z "${STATUS_GO_COMMIT_SHA1}" ]]; then
|
||||
echo "ERROR: Failed to find a SHA1 for rev '${STATUS_GO_VERSION}'."
|
||||
|
||||
+5
-9
@@ -38,23 +38,19 @@
|
||||
{:target :react-native
|
||||
:output-dir "app"
|
||||
:init-fn status-im.core/init
|
||||
:closure-defines {"status-im.utils.config/INFURA_TOKEN" #shadow/env "INFURA_TOKEN"}
|
||||
:dev {:devtools {:after-load status-im.reloader/reload
|
||||
:build-notify status-im.reloader/build-notify
|
||||
:preloads [re-frisk-remote.preload]}
|
||||
:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es5
|
||||
:closure-defines
|
||||
:compiler-options {:closure-defines
|
||||
{re-frame.trace/trace-enabled? true}
|
||||
:source-map false
|
||||
:infer-externs true}
|
||||
:source-map false}
|
||||
;; if you want to use a real device, set your local ip
|
||||
;; in the SHADOW_HOST env variable to make sure that
|
||||
;; it will use the right interface
|
||||
:local-ip #shadow/env "SHADOW_HOST"}
|
||||
:chunks {:fleets status-im.default-fleet/default-fleets
|
||||
:chats status-im.chat.default-chats/default-chats}
|
||||
:release {:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:compiler-options {:output-feature-set :es6
|
||||
:release {:compiler-options {:output-feature-set :es6
|
||||
;;disable for android build as there
|
||||
;;is an intermittent warning with deftype
|
||||
:warnings-as-errors false
|
||||
@@ -71,8 +67,8 @@
|
||||
{:output-to "target/test/test.js"
|
||||
:output-dir "target/test"
|
||||
:optimizations :simple
|
||||
:target :node-test
|
||||
:closure-defines {status-im.utils.config/INFURA_TOKEN #shadow/env "INFURA_TOKEN"}
|
||||
:target :node-test
|
||||
:compiler-options {;; needed because we override require and it
|
||||
;; messes with source-map which reports callstack
|
||||
;; exceeded exceptions instead of real issues
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
|
||||
(def platform (.-Platform ^js rn))
|
||||
|
||||
(def find-node-handle (.-findNodeHandle ^js rn))
|
||||
|
||||
(def view (reagent/adapt-react-class (.-View ^js rn)))
|
||||
(def image (reagent/adapt-react-class (.-Image rn)))
|
||||
(def text (reagent/adapt-react-class (.-Text ^js rn)))
|
||||
|
||||
@@ -0,0 +1,221 @@
|
||||
(ns shadow.cljs.devtools.client.react-native
|
||||
(:require [cljs.reader :as reader]
|
||||
[clojure.string :as str]
|
||||
[goog.net.XhrIo :as xhr]
|
||||
[shadow.cljs.devtools.client.env :as env]
|
||||
[status-im.reloader :as reloader]))
|
||||
|
||||
(defonce repl-ns-ref (atom nil))
|
||||
|
||||
(defonce socket-ref (volatile! nil))
|
||||
|
||||
(defn ws-msg [msg]
|
||||
(if-let [s @socket-ref]
|
||||
(.send s (pr-str msg))
|
||||
(js/console.warn "WEBSOCKET NOT CONNECTED" (pr-str msg))))
|
||||
|
||||
(defn devtools-msg
|
||||
([x]
|
||||
(js/console.log x))
|
||||
([x y]
|
||||
(js/console.log x y)))
|
||||
|
||||
(defn script-eval [code]
|
||||
(js/goog.global.eval code))
|
||||
|
||||
(defn do-js-load [sources]
|
||||
(doseq [{:keys [resource-name js] :as src} sources]
|
||||
(devtools-msg "load JS" resource-name)
|
||||
(env/before-load-src src)
|
||||
(script-eval (str js "\n//# sourceURL=" resource-name))))
|
||||
|
||||
(defn do-js-reload [msg sources complete-fn]
|
||||
(env/do-js-reload
|
||||
(assoc msg
|
||||
:log-missing-fn
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "can't find fn " fn-sym)))
|
||||
:log-call-async
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "call async " fn-sym)))
|
||||
:log-call
|
||||
(fn [fn-sym]
|
||||
(devtools-msg (str "call " fn-sym))))
|
||||
#(do-js-load sources)
|
||||
complete-fn))
|
||||
|
||||
(defn load-sources [sources callback]
|
||||
(if (empty? sources)
|
||||
(callback [])
|
||||
(xhr/send
|
||||
(env/files-url)
|
||||
(fn [_]
|
||||
(this-as ^goog req
|
||||
(let [content
|
||||
(-> req
|
||||
(.getResponseText)
|
||||
(reader/read-string))]
|
||||
(callback content))))
|
||||
|
||||
"POST"
|
||||
(pr-str {:client :browser
|
||||
:sources (into [] (map :resource-id) sources)})
|
||||
#js {"content-type" "application/edn; charset=utf-8"})))
|
||||
|
||||
(defn noop [& _])
|
||||
|
||||
(defn handle-build-complete [{:keys [info reload-info] :as msg}]
|
||||
(let [{:keys [sources]}
|
||||
info
|
||||
|
||||
warnings
|
||||
(->> (for [{:keys [resource-name warnings] :as src} sources
|
||||
:when (not (:from-jar src))
|
||||
warning warnings]
|
||||
(assoc warning :resource-name resource-name))
|
||||
(distinct)
|
||||
(into []))]
|
||||
(when (seq warnings)
|
||||
(reloader/build-failed))
|
||||
(when (and env/autoload
|
||||
(or (empty? warnings) env/ignore-warnings))
|
||||
(reloader/build-competed)
|
||||
(let [sources-to-get (env/filter-reload-sources info reload-info)]
|
||||
|
||||
(when (seq sources-to-get)
|
||||
(load-sources sources-to-get #(do-js-reload msg % noop)))))))
|
||||
|
||||
(defn repl-error [e]
|
||||
(js/console.error "repl/invoke error" (.-message e) e)
|
||||
(env/repl-error e))
|
||||
|
||||
(defn repl-invoke [{:keys [id js]}]
|
||||
(let [result (env/repl-call #(js/eval js) repl-error)]
|
||||
(-> result
|
||||
(assoc :id id)
|
||||
(ws-msg))))
|
||||
|
||||
(defn repl-require [{:keys [id sources reload-namespaces]} done]
|
||||
(let [sources-to-load
|
||||
(->> sources
|
||||
(remove (fn [{:keys [provides] :as src}]
|
||||
(and (env/src-is-loaded? src)
|
||||
(not (some reload-namespaces provides)))))
|
||||
(into []))]
|
||||
|
||||
(load-sources
|
||||
sources-to-load
|
||||
(fn [sources]
|
||||
(do-js-load sources)
|
||||
(ws-msg {:type :repl/require-complete :id id})
|
||||
(done)))))
|
||||
|
||||
(defn repl-init [{:keys [repl-state id]} done]
|
||||
(reset! repl-ns-ref (get-in repl-state [:current :ns]))
|
||||
(load-sources
|
||||
;; maybe need to load some missing files to init REPL
|
||||
(->> (:repl-sources repl-state)
|
||||
(remove env/src-is-loaded?)
|
||||
(into []))
|
||||
(fn [sources]
|
||||
(do-js-load sources)
|
||||
(ws-msg {:type :repl/init-complete :id id})
|
||||
(devtools-msg "REPL init successful")
|
||||
(done))))
|
||||
|
||||
(defn repl-set-ns [{:keys [id ns]}]
|
||||
(reset! repl-ns-ref ns)
|
||||
(ws-msg {:type :repl/set-ns-complete :id id :ns ns}))
|
||||
|
||||
;; FIXME: core.async-ify this
|
||||
(defn handle-message [{:keys [type] :as msg} done]
|
||||
;; (js/console.log "ws-msg" (pr-str msg))
|
||||
(case type
|
||||
:repl/invoke
|
||||
(repl-invoke msg)
|
||||
|
||||
:repl/require
|
||||
(repl-require msg done)
|
||||
|
||||
:repl/set-ns
|
||||
(repl-set-ns msg)
|
||||
|
||||
:repl/init
|
||||
(repl-init msg done)
|
||||
|
||||
:repl/ping
|
||||
(ws-msg {:type :repl/pong :time-server (:time-server msg) :time-runtime (js/Date.now)})
|
||||
|
||||
:build-complete
|
||||
(handle-build-complete msg)
|
||||
|
||||
:build-failure
|
||||
(reloader/build-failed)
|
||||
|
||||
:build-init
|
||||
nil
|
||||
|
||||
:build-start
|
||||
(reloader/build-start)
|
||||
|
||||
:pong
|
||||
nil
|
||||
|
||||
:client/stale
|
||||
(devtools-msg "Stale Client! You are not using the latest compilation output!")
|
||||
|
||||
:client/no-worker
|
||||
(devtools-msg (str "watch for build \"" env/build-id "\" not running"))
|
||||
|
||||
;; default
|
||||
:ignored)
|
||||
|
||||
(when-not (contains? env/async-ops type)
|
||||
(done)))
|
||||
|
||||
(defn ws-connect []
|
||||
(let [ws-url
|
||||
(env/ws-url :react-native)
|
||||
|
||||
socket
|
||||
(js/WebSocket. ws-url)]
|
||||
|
||||
(vreset! socket-ref socket)
|
||||
(set! (.-onmessage socket)
|
||||
(fn [e]
|
||||
(env/process-ws-msg (. e -data) handle-message)))
|
||||
|
||||
(set! (.-onopen socket)
|
||||
(fn [_]
|
||||
;; :module-format :js already patches provide
|
||||
(when (= "goog" env/module-format)
|
||||
;; patch away the already declared exception
|
||||
(set! (.-provide js/goog) js/goog.constructNamespace_))
|
||||
|
||||
(env/set-print-fns! ws-msg)
|
||||
|
||||
(devtools-msg "WebSocket connected!")))
|
||||
|
||||
(set! (.-onclose socket)
|
||||
(fn [_]
|
||||
;; not a big fan of reconnecting automatically since a disconnect
|
||||
;; may signal a change of config, safer to just reload the page
|
||||
(devtools-msg "WebSocket disconnected!")
|
||||
(vreset! socket-ref nil)
|
||||
(env/reset-print-fns!)))
|
||||
|
||||
(set! (.-onerror socket)
|
||||
(fn [e]
|
||||
(js/console.error (str "WebSocket connect failed:" (.-message e) "\n"
|
||||
"It was trying to connect to: " (subs ws-url 0 (str/index-of ws-url "/" 6)) "\n"))))))
|
||||
|
||||
(when ^boolean env/enabled
|
||||
;; disconnect an already connected socket, happens if this file is reloaded
|
||||
;; pretty much only for me while working on this file
|
||||
(when-let [s @socket-ref]
|
||||
(devtools-msg "connection reset!")
|
||||
(set! (.-onclose s) (fn [_]))
|
||||
(.close s)
|
||||
(vreset! socket-ref nil))
|
||||
|
||||
(ws-connect))
|
||||
@@ -0,0 +1,4 @@
|
||||
(ns status-im.android.platform)
|
||||
|
||||
(def platform-specific
|
||||
{:status-bar-default-height 25})
|
||||
@@ -170,7 +170,7 @@
|
||||
:group-chat true
|
||||
:contacts #{}
|
||||
:public? true
|
||||
:might-have-join-time-messages? (get-in cofx [:db :multiaccount :use-mailservers?])
|
||||
:might-have-join-time-messages? true
|
||||
:unviewed-messages-count 0
|
||||
:loaded-unviewed-messages-ids #{}}
|
||||
nil))
|
||||
|
||||
@@ -30,35 +30,25 @@
|
||||
{:db (assoc-in db [:chat/inputs current-chat-id :input-text] (text->emoji new-input))})
|
||||
|
||||
(fx/defn select-mention
|
||||
[{:keys [db] :as cofx} text-input-ref {:keys [alias name searched-text match] :as user}]
|
||||
[{:keys [db] :as cofx} {:keys [alias name searched-text match] :as user}]
|
||||
(let [chat-id (:current-chat-id db)
|
||||
new-text (mentions/new-input-text-with-mention cofx user)
|
||||
at-sign-idx (get-in db [:chats chat-id :mentions :at-sign-idx])
|
||||
cursor (+ at-sign-idx (count name) 2)]
|
||||
at-sign-idx (get-in db [:chats chat-id :mentions :at-sign-idx])]
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (-> db
|
||||
(assoc-in [:chats/cursor chat-id] cursor)
|
||||
(assoc-in [:chats/cursor chat-id] (+ at-sign-idx (count name) 2))
|
||||
(assoc-in [:chats/mention-suggestions chat-id] nil))}
|
||||
(set-chat-input-text new-text)
|
||||
;; NOTE(rasom): Some keyboards do not react on selection property passed to
|
||||
;; text input (specifically Samsung keyboard with predictive text set on).
|
||||
;; In this case, if the user continues typing after the programmatic change,
|
||||
;; the new text is added to the last known cursor position before
|
||||
;; programmatic change. By calling `reset-text-input-cursor` we force the
|
||||
;; keyboard's cursor position to be changed before the next input.
|
||||
(mentions/reset-text-input-cursor text-input-ref cursor)
|
||||
;; NOTE(roman): on-text-input event is not dispatched when we change input
|
||||
;; programmatically, so we have to call `on-text-input` manually
|
||||
(mentions/on-text-input
|
||||
(let [match-len (count match)
|
||||
searched-text-len (count searched-text)
|
||||
start (inc at-sign-idx)
|
||||
end (+ start match-len)]
|
||||
{:new-text match
|
||||
:previous-text searched-text
|
||||
:start start
|
||||
:end end}))
|
||||
(let [match-len (count match)
|
||||
searched-text-len (count searched-text)]
|
||||
{:new-text (subs match searched-text-len)
|
||||
:previous-text ""
|
||||
:start (+ at-sign-idx searched-text-len 1)
|
||||
:end (+ at-sign-idx match-len 1)}))
|
||||
(mentions/recheck-at-idxs {alias user}))))
|
||||
|
||||
(defn- start-cooldown [{:keys [db]} cooldowns]
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
[status-im.chat.models.reactions :as reactions]
|
||||
[status-im.chat.models.message-list :as message-list]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.chat.models.message-seen :as message-seen]
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
[status-im.chat.models.message-seen :as message-seen]))
|
||||
|
||||
(defn cursor->clock-value
|
||||
[^js cursor]
|
||||
@@ -96,13 +95,11 @@
|
||||
(let [nickname (get-in db [:contacts/contacts from :nickname])]
|
||||
(cond-> acc
|
||||
(and alias (not= alias ""))
|
||||
(update :users assoc from
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname}))
|
||||
(update :users assoc from {:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname})
|
||||
(or (nil? last-clock-value)
|
||||
(> last-clock-value clock-value))
|
||||
(assoc :last-clock-value clock-value)
|
||||
|
||||
@@ -1,174 +1,13 @@
|
||||
(ns status-im.chat.models.mentions
|
||||
(:require [clojure.string :as string]
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.utils.fx :as fx]
|
||||
[status-im.contact.db :as contact.db]
|
||||
[status-im.utils.platform :as platform]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.utils.utils :as utils]
|
||||
[status-im.native-module.core :as status]
|
||||
[quo.react-native :as rn]
|
||||
[quo.react :as react]))
|
||||
[status-im.utils.utils :as utils]))
|
||||
|
||||
(def at-sign "@")
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn re-pos [re s]
|
||||
(loop [res [] s s last-idx 0]
|
||||
(if-let [m (.exec re s)]
|
||||
(let [new-idx (.-index m)
|
||||
idx (+ last-idx new-idx)
|
||||
c (get m 0)]
|
||||
(recur (conj res [idx c]) (subs s (inc new-idx)) (inc idx)))
|
||||
res)))
|
||||
|
||||
(defn check-style-tag [text idxs idx]
|
||||
(let [[pos c] (get idxs idx)
|
||||
[pos2 c2] (get idxs (inc idx))
|
||||
[pos3 c3] (get idxs (+ 2 idx))
|
||||
prev-c (get text (dec pos))
|
||||
len (cond
|
||||
(and (= c c2 c3)
|
||||
(= pos (dec pos2) (- pos3 2)))
|
||||
3
|
||||
(and (= c c2)
|
||||
(= pos (dec pos2)))
|
||||
2
|
||||
:else 1)
|
||||
next-idx (inc (first (get idxs (+ idx (dec len)))))
|
||||
next-c (get text next-idx)
|
||||
can-be-end? (if (= 1 len)
|
||||
(and prev-c
|
||||
(not (string/blank? prev-c))
|
||||
(or (nil? next-c)
|
||||
(string/blank? next-c)))
|
||||
(and prev-c
|
||||
(not (string/blank? prev-c))))
|
||||
can-be-start? (and next-c
|
||||
(not (string/blank? next-c)))]
|
||||
[len can-be-start? can-be-end?]))
|
||||
|
||||
(defn clear-pending-at-signs
|
||||
[data from]
|
||||
(let [{:keys [pending]} (get data at-sign)
|
||||
new-idxs (filter (partial > from) pending)]
|
||||
(-> data
|
||||
(update at-sign dissoc :pending)
|
||||
(update-in [at-sign :checked]
|
||||
(fn [checked]
|
||||
;; NOTE(rasom): there might be stack overflow without doall
|
||||
(doall
|
||||
((fnil concat []) checked new-idxs)))))))
|
||||
|
||||
(defn apply-style-tag [data idx pos c len start? end?]
|
||||
(let [was-started? (get data c)
|
||||
tripple-tilde? (and (= "~" c) (= 3 len))]
|
||||
(cond
|
||||
(and was-started? end?)
|
||||
(let [old-len (:len was-started?)
|
||||
tag-len (cond
|
||||
(and tripple-tilde?
|
||||
(= 3 old-len))
|
||||
2
|
||||
|
||||
(>= old-len len)
|
||||
len
|
||||
|
||||
:else
|
||||
old-len)
|
||||
old-idx (:idx was-started?)]
|
||||
{:data (-> data
|
||||
(dissoc c)
|
||||
(clear-pending-at-signs old-idx))
|
||||
:next-idx (+ idx tag-len)})
|
||||
|
||||
start?
|
||||
{:data (-> data
|
||||
(assoc c {:len len
|
||||
:idx pos})
|
||||
(clear-pending-at-signs pos))
|
||||
:next-idx (+ idx len)}
|
||||
|
||||
:else
|
||||
{:data data
|
||||
:next-idx (+ idx len)})))
|
||||
|
||||
(defn code-tag-len [idxs idx]
|
||||
(let [[pos c] (get idxs idx)
|
||||
[pos2 c2] (get idxs (inc idx))
|
||||
[pos3 c3] (get idxs (+ 2 idx))]
|
||||
(cond
|
||||
(and (= c c2 c3)
|
||||
(= pos (dec pos2) (- pos3 2)))
|
||||
3
|
||||
(and (= c c2)
|
||||
(= pos (dec pos2)))
|
||||
2
|
||||
:else 1)))
|
||||
|
||||
(defn get-at-signs
|
||||
([text]
|
||||
(let [idxs (re-pos #"[@~\\*_\n>`]{1}" text)]
|
||||
(loop [data nil
|
||||
idx 0]
|
||||
(let [quote-started? (get data ">")
|
||||
[pos c] (get idxs idx)
|
||||
styling-tag? (get #{"*" "_" "~"} c)
|
||||
code-tag? (= "`" c)
|
||||
quote? (= ">" c)
|
||||
at-sign? (= at-sign c)
|
||||
newline? (= "\n" c)]
|
||||
(if (nil? c)
|
||||
(let [{:keys [checked pending]} (get data at-sign)]
|
||||
(concat checked pending))
|
||||
(cond
|
||||
newline?
|
||||
(let [prev-newline (first (get data :newline))]
|
||||
(recur
|
||||
(cond-> (update data :newline (fnil conj '()) pos)
|
||||
(and quote-started?
|
||||
prev-newline
|
||||
(string/blank? (subs text prev-newline (dec pos))))
|
||||
(dissoc ">"))
|
||||
(inc idx)))
|
||||
|
||||
quote-started?
|
||||
(recur data (inc idx))
|
||||
|
||||
quote?
|
||||
(let [prev-newlines (take 2 (get data :newline))]
|
||||
(if (or (zero? pos)
|
||||
(and (= 1 (count prev-newlines))
|
||||
(string/blank? (subs text 0 (dec pos))))
|
||||
(and (= 2 (count prev-newlines))
|
||||
(string/blank? (subs text (first prev-newlines) (dec pos)))))
|
||||
(recur (-> data
|
||||
(dissoc :newline "*" "_" "~" "`")
|
||||
(assoc ">" {:idx pos})) (inc idx))
|
||||
(recur data (inc idx))))
|
||||
|
||||
at-sign?
|
||||
(recur (update-in data [at-sign :pending] (fnil conj []) pos)
|
||||
(inc idx))
|
||||
|
||||
code-tag?
|
||||
(let [len (code-tag-len idxs idx)
|
||||
{:keys [data next-idx]}
|
||||
(apply-style-tag data idx pos c len true true)]
|
||||
(recur data next-idx))
|
||||
|
||||
styling-tag?
|
||||
(let [[len can-be-start? can-be-end?]
|
||||
(check-style-tag text idxs idx)
|
||||
{:keys [data next-idx]}
|
||||
(apply-style-tag data idx pos c len can-be-start? can-be-end?)]
|
||||
(recur data next-idx))
|
||||
|
||||
:else (recur data (inc idx)))))))))
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(defn get-mentionable-users
|
||||
[{{:keys [current-chat-id]
|
||||
:contacts/keys [contacts] :as db} :db}]
|
||||
@@ -233,33 +72,25 @@
|
||||
|
||||
(defn get-suggestions [users searched-text]
|
||||
(reduce
|
||||
(fn [acc [k {:keys [alias name nickname searchable-phrases] :as user}]]
|
||||
(fn [acc [k {:keys [alias name nickname] :as user}]]
|
||||
(if-let [match
|
||||
(if (seq searchable-phrases)
|
||||
(when (some
|
||||
(fn [s]
|
||||
(string/starts-with?
|
||||
(string/lower-case s)
|
||||
searched-text))
|
||||
searchable-phrases)
|
||||
(or name alias))
|
||||
(cond
|
||||
(and nickname
|
||||
(string/starts-with?
|
||||
(string/lower-case nickname)
|
||||
searched-text))
|
||||
(or name alias)
|
||||
(cond
|
||||
(and nickname
|
||||
(string/starts-with?
|
||||
(string/lower-case nickname)
|
||||
searched-text))
|
||||
(or alias name)
|
||||
|
||||
(and alias
|
||||
(string/starts-with?
|
||||
(string/lower-case alias)
|
||||
searched-text))
|
||||
alias
|
||||
(and alias
|
||||
(string/starts-with?
|
||||
(string/lower-case alias)
|
||||
searched-text))
|
||||
alias
|
||||
|
||||
(string/starts-with?
|
||||
(string/lower-case name)
|
||||
searched-text)
|
||||
name))]
|
||||
(string/starts-with?
|
||||
(string/lower-case name)
|
||||
searched-text)
|
||||
name)]
|
||||
(assoc acc k (assoc user
|
||||
:match match
|
||||
:searched-text searched-text))
|
||||
@@ -301,13 +132,11 @@
|
||||
|
||||
(defn replace-mentions
|
||||
([text users-fn]
|
||||
(let [idxs (get-at-signs text)]
|
||||
(replace-mentions text users-fn idxs 0)))
|
||||
([text users-fn idxs diff]
|
||||
(if (or (string/blank? text)
|
||||
(empty? idxs))
|
||||
(replace-mentions text users-fn 0))
|
||||
([text users-fn idx]
|
||||
(if (string/blank? text)
|
||||
text
|
||||
(let [mention-key-idx (- (first idxs) diff)]
|
||||
(let [mention-key-idx (string/index-of text at-sign idx)]
|
||||
(if-not mention-key-idx
|
||||
text
|
||||
(let [users (users-fn)]
|
||||
@@ -316,14 +145,14 @@
|
||||
(let [{:keys [public-key match]}
|
||||
(match-mention text users mention-key-idx)]
|
||||
(if-not match
|
||||
(recur text (fn [] users) (rest idxs) diff)
|
||||
(recur text (fn [] users) (inc mention-key-idx))
|
||||
(let [new-text (string/join
|
||||
[(subs text 0 (inc mention-key-idx))
|
||||
public-key
|
||||
(subs text (+ (inc mention-key-idx)
|
||||
(count match)))])]
|
||||
(recur new-text (fn [] users) (rest idxs)
|
||||
(+ diff (- (count text) (count new-text))))))))))))))
|
||||
(count match)))])
|
||||
mention-end (+ (inc mention-key-idx) (count public-key))]
|
||||
(recur new-text (fn [] users) mention-end)))))))))))
|
||||
|
||||
(defn check-mentions [cofx text]
|
||||
(replace-mentions text #(get-mentionable-users cofx)))
|
||||
@@ -621,27 +450,3 @@
|
||||
(calculate-suggestions mentionable-users))
|
||||
(clear-suggestions cofx)))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::reset-text-input-cursor
|
||||
(fn [[ref cursor]]
|
||||
(when ref
|
||||
(status/reset-keyboard-input
|
||||
(rn/find-node-handle (react/current-ref ref))
|
||||
cursor))))
|
||||
|
||||
(fx/defn reset-text-input-cursor
|
||||
[_ ref cursor]
|
||||
{::reset-text-input-cursor [ref cursor]})
|
||||
|
||||
(defn add-searchable-phrases
|
||||
[{:keys [alias name nickname] :as user}]
|
||||
(reduce
|
||||
(fn [user s]
|
||||
(if (nil? s)
|
||||
user
|
||||
(let [new-words (concat
|
||||
[s]
|
||||
(rest (string/split s " ")))]
|
||||
(update user :searchable-phrases (fnil concat []) new-words))))
|
||||
user
|
||||
[alias name nickname]))
|
||||
|
||||
@@ -105,150 +105,4 @@
|
||||
exprected-result (string/join
|
||||
" "
|
||||
(repeat 1000 "@0xpk1 @0xpk2"))]
|
||||
(test/is (= exprected-result result))))
|
||||
(test/testing "markdown"
|
||||
(test/testing "single * case 1"
|
||||
(let [text "*@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 2"
|
||||
(let [text "*@user2 *"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@0xpk2 *") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 3"
|
||||
(let [text "a*@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 4"
|
||||
(let [text "*@user2 foo*foo"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@0xpk2 foo*foo") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 5"
|
||||
(let [text "a *@user2*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 6"
|
||||
(let [text "*@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 7"
|
||||
(let [text "@user2 *@user2 foo* @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "@0xpk2 *@user2 foo* @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "single * case 8"
|
||||
(let [text "*@user2 foo**@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "single * case 9"
|
||||
(let [text "*@user2 foo***@user2 foo* @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "*@user2 foo***@user2 foo* @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 1"
|
||||
(let [text "**@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 2"
|
||||
(let [text "**@user2 **"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@0xpk2 **") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 3"
|
||||
(let [text "a**@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 4"
|
||||
(let [text "**@user2 foo**foo"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@user2 foo**foo") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 5"
|
||||
(let [text "a **@user2**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 6"
|
||||
(let [text "**@user2 foo**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 7"
|
||||
(let [text "@user2 **@user2 foo** @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "@0xpk2 **@user2 foo** @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "double * case 8"
|
||||
(let [text "**@user2 foo****@user2 foo**"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "double * case 9"
|
||||
(let [text "**@user2 foo*****@user2 foo** @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "**@user2 foo*****@user2 foo** @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "tripple * case 1"
|
||||
(let [text "***@user2 foo***@user2 foo*"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "***@user2 foo***@0xpk2 foo*") (pr-str text))))
|
||||
|
||||
(test/testing "tripple ~ case 1"
|
||||
(let [text "~~~@user2 foo~~~@user2 foo~"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 1"
|
||||
(let [text ">@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 2"
|
||||
(let [text "\n>@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 3"
|
||||
(let [text "\n> @user2 \n \n @user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "\n> @user2 \n \n @0xpk2") (pr-str text))))
|
||||
|
||||
(test/testing "quote case 4"
|
||||
(let [text ">@user2\n\n>@user2"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "quote case 5"
|
||||
(let [text "***hey\n\n>@user2\n\n@user2 foo***"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "***hey\n\n>@user2\n\n@0xpk2 foo***")
|
||||
(pr-str text))))
|
||||
|
||||
(test/testing "code case 1"
|
||||
(let [text "` @user2 `"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 2"
|
||||
(let [text "` @user2 `"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 3"
|
||||
(let [text "``` @user2 ```"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result text) (pr-str text))))
|
||||
|
||||
(test/testing "code case 4"
|
||||
(let [text "` ` @user2 ``"
|
||||
result (mentions/replace-mentions text users)]
|
||||
(test/is (= result "` ` @0xpk2 ``") (pr-str text)))))))
|
||||
(test/is (= exprected-result result))))))
|
||||
|
||||
@@ -10,8 +10,7 @@
|
||||
[status-im.transport.message.protocol :as protocol]
|
||||
[status-im.ui.screens.chat.state :as view.state]
|
||||
[status-im.utils.fx :as fx]
|
||||
[taoensso.timbre :as log]
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn- prepare-message
|
||||
[message current-chat?]
|
||||
@@ -68,12 +67,11 @@
|
||||
(let [nickname (get-in db [:contacts/contacts from :nickname])]
|
||||
{:db (update-in db [:chats chat-id :users] assoc
|
||||
from
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname}))})))
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:public-key from
|
||||
:nickname nickname})})))
|
||||
|
||||
(fx/defn add-received-message
|
||||
[{:keys [db] :as cofx}
|
||||
|
||||
@@ -45,12 +45,11 @@
|
||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
:cursor-clock-value 9,
|
||||
:users
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil
|
||||
:searchable-phrases ["alias" "name"]}}}}}}
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil}}}}}}
|
||||
(message/add-received-message
|
||||
cofx
|
||||
message)))))
|
||||
@@ -69,12 +68,11 @@
|
||||
"00000000000000000000000000000000000000000000000000090x0000000000000000000000000000000000000000000000000000000000000000",
|
||||
:cursor-clock-value 9,
|
||||
:users
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil
|
||||
:searchable-phrases ["alias" "name"]}}}}}}
|
||||
{"from" {:alias "alias",
|
||||
:name "name",
|
||||
:identicon "identicon",
|
||||
:public-key "from"
|
||||
:nickname nil}}}}}}
|
||||
(message/add-received-message
|
||||
cofx
|
||||
message)))))
|
||||
|
||||
@@ -35,8 +35,6 @@
|
||||
(def invitation-state-requested 1)
|
||||
(def invitation-state-rejected 2)
|
||||
(def invitation-state-approved 3)
|
||||
(def invitation-state-granted 4)
|
||||
(def invitation-state-removed 5)
|
||||
|
||||
(def message-type-one-to-one 1)
|
||||
(def message-type-public-group 2)
|
||||
@@ -52,7 +50,7 @@
|
||||
(def command-state-transaction-sent 7)
|
||||
|
||||
(def min-password-length 6)
|
||||
(def max-group-chat-participants 20)
|
||||
(def max-group-chat-participants 10)
|
||||
(def default-number-of-messages 20)
|
||||
|
||||
(def mailserver-password "status-offline-inbox")
|
||||
|
||||
@@ -645,7 +645,7 @@
|
||||
:decimals 9
|
||||
:symbol :XRL
|
||||
:name "RIALTO"}
|
||||
{:address "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F"
|
||||
{:address "0xC011A72400E58ecD99Ee497CF89E3775d4bd732F"
|
||||
:decimals 18
|
||||
:symbol :SNX
|
||||
:name "Synthetix Network Token"}
|
||||
@@ -709,7 +709,7 @@
|
||||
:symbol :DTA
|
||||
:name "Data Token"
|
||||
:decimals 18}
|
||||
{:address "0x57Ab1ec28D129707052df4dF418D58a2D46d5f51"
|
||||
{:address "0x57ab1e02fee23774580c119740129eac7081e9d3"
|
||||
:symbol :sUSD
|
||||
:name "Synth sUSD"
|
||||
:decimals 18}
|
||||
|
||||
@@ -228,8 +228,7 @@
|
||||
(conj acc address)
|
||||
acc))
|
||||
#{}
|
||||
transfers))
|
||||
nil))
|
||||
transfers))))
|
||||
|
||||
(< (count transfers) limit)
|
||||
(conj (tx-history-end-reached checksum)))]
|
||||
|
||||
@@ -67,8 +67,7 @@
|
||||
status-im.ui.screens.profile.events
|
||||
status-im.chat.models.images
|
||||
status-im.ui.screens.privacy-and-security-settings.events
|
||||
[status-im.data-store.invitations :as data-store.invitations]
|
||||
[status-im.ui.screens.wallet.events :as wallet.events]))
|
||||
[status-im.data-store.invitations :as data-store.invitations]))
|
||||
|
||||
;; init module
|
||||
(handlers/register-handler-fx
|
||||
@@ -237,11 +236,6 @@
|
||||
(fn [cofx [_ _]]
|
||||
(mailserver/retry-next-messages-request cofx)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:mailserver.ui/use-history-switch-pressed
|
||||
(fn [cofx [_ use-mailservers?]]
|
||||
(mailserver/update-use-mailservers cofx use-mailservers?)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:mailserver/check-connection-timeout
|
||||
(fn [cofx _]
|
||||
@@ -512,8 +506,8 @@
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:chat.ui/select-mention
|
||||
(fn [cofx [_ text-input-ref mention]]
|
||||
(chat.input/select-mention cofx text-input-ref mention)))
|
||||
(fn [cofx [_ mention]]
|
||||
(chat.input/select-mention cofx mention)))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:chat.ui/set-chat-input-text
|
||||
@@ -1262,5 +1256,4 @@
|
||||
;; messages
|
||||
:chat (chat.loading/load-messages %)
|
||||
:multiaccounts (keycard/multiaccounts-screen-did-load %)
|
||||
(:wallet-stack :wallet) (wallet.events/wallet-will-focus %)
|
||||
nil))))
|
||||
|
||||
@@ -168,11 +168,3 @@
|
||||
(assoc acc id inv))
|
||||
%
|
||||
invitations))})
|
||||
|
||||
(defn member-removed? [{:keys [membership-update-events]} pk]
|
||||
(->> membership-update-events
|
||||
(filter #(contains? (set (:members %)) pk))
|
||||
(sort-by :clockValue >)
|
||||
first
|
||||
:type
|
||||
(= constants/invitation-state-removed)))
|
||||
|
||||
@@ -58,10 +58,10 @@
|
||||
::open-multiaccounts #(re-frame/dispatch [::initialize-multiaccounts % {:logout? false}])
|
||||
:ui/listen-to-window-dimensions-change nil
|
||||
::network/listen-to-network-info nil
|
||||
:keycard/register-card-events nil
|
||||
:keycard/check-nfc-support nil
|
||||
:keycard/check-nfc-enabled nil
|
||||
:keycard/retrieve-pairings nil}
|
||||
:keycard/register-card-events nil
|
||||
:keycard/check-nfc-support nil
|
||||
:keycard/check-nfc-enabled nil
|
||||
:keycard/retrieve-pairings nil}
|
||||
(initialize-app-db)))
|
||||
|
||||
(re-frame/reg-fx
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
(ns status-im.ios.platform
|
||||
(:require ["react-native" :refer (Dimensions)]))
|
||||
|
||||
;; iPhone X dimensions
|
||||
(def x-height 812)
|
||||
(def xs-height 896)
|
||||
|
||||
(defn iphone-x-dimensions? []
|
||||
(let [{:keys [height]} (-> Dimensions
|
||||
(.get "window")
|
||||
(js->clj :keywordize-keys true))]
|
||||
(or (= height x-height) (= height xs-height))))
|
||||
|
||||
(def platform-specific
|
||||
{:status-bar-default-height (if (iphone-x-dimensions?) 0 20)})
|
||||
@@ -148,8 +148,7 @@
|
||||
whisper-private-key
|
||||
encryption-public-key
|
||||
instance-uid
|
||||
key-uid
|
||||
recovered]} multiaccount
|
||||
key-uid]} multiaccount
|
||||
{:keys [pairing paired-on]} secrets
|
||||
{:keys [name photo-path]}
|
||||
(if (nil? name)
|
||||
@@ -168,8 +167,7 @@
|
||||
(assoc-in [:keycard :setup-step] nil)
|
||||
(dissoc :intro-wizard))}
|
||||
(multiaccounts.create/on-multiaccount-created
|
||||
{:recovered (or recovered (get-in db [:intro-wizard :recovering?]))
|
||||
:derived {constants/path-wallet-root-keyword
|
||||
{:derived {constants/path-wallet-root-keyword
|
||||
{:public-key wallet-root-public-key
|
||||
:address (eip55/address->checksum wallet-root-address)}
|
||||
constants/path-whisper-keyword
|
||||
@@ -270,7 +268,6 @@
|
||||
{:db (update-in db [:keycard :multiaccount]
|
||||
(fn [multiacc]
|
||||
(assoc multiacc
|
||||
:recovered true
|
||||
:name whisper-name
|
||||
:photo-path photo-path)))}
|
||||
(create-keycard-multiaccount)))
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
payload (.stringify js/JSON (clj->js args))]
|
||||
(status/call-private-rpc payload
|
||||
(handlers/response-handler
|
||||
#(log/info "mailserver: remove-peer success" %)
|
||||
#(log/debug "mailserver: remove-peer success" %)
|
||||
#(log/error "mailserver: remove-peer error" %)))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
@@ -214,45 +214,27 @@
|
||||
current-request
|
||||
[:from :to :force-to? :topics :chat-id])))
|
||||
|
||||
(fx/defn disconnect-from-mailserver
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
{:keys [peers-summary]} db
|
||||
gap-request? (executing-gap-request? db)]
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))
|
||||
|
||||
:mailserver/remove-peer address}))
|
||||
|
||||
(defn fetch-use-mailservers? [{:keys [db]}]
|
||||
(get-in db [:multiaccount :use-mailservers?]))
|
||||
|
||||
(fx/defn connect-to-mailserver
|
||||
"Add mailserver as a peer using `::add-peer` cofx and generate sym-key when
|
||||
it doesn't exists
|
||||
Peer summary will change and we will receive a signal from status go when
|
||||
this is successful
|
||||
A connection-check is made after `connection timeout` is reached and
|
||||
mailserver-state is changed to error if it is not connected by then
|
||||
No attempt is made if mailserver usage is disabled"
|
||||
mailserver-state is changed to error if it is not connected by then"
|
||||
{:events [:mailserver.ui/reconnect-mailserver-pressed]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
{:keys [peers-summary]} db
|
||||
use-mailservers? (fetch-use-mailservers? cofx)
|
||||
added? (registered-peer? peers-summary address)
|
||||
gap-request? (executing-gap-request? db)]
|
||||
(when use-mailservers?
|
||||
(fx/merge cofx
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))}
|
||||
(if added?
|
||||
(mark-trusted-peer)
|
||||
(add-peer))))))
|
||||
added? (registered-peer? peers-summary address)
|
||||
gap-request? (executing-gap-request? db)]
|
||||
(fx/merge cofx
|
||||
{:db (cond-> (dissoc db :mailserver/current-request)
|
||||
gap-request?
|
||||
(-> (assoc :mailserver/fetching-gaps-in-progress {})
|
||||
(dissoc :mailserver/planned-gap-requests)))}
|
||||
(if added?
|
||||
(mark-trusted-peer)
|
||||
(add-peer)))))
|
||||
|
||||
(defn pool-size [fleet-size]
|
||||
(.ceil js/Math (/ fleet-size 4)))
|
||||
@@ -317,7 +299,7 @@
|
||||
(mark-trusted-peer cofx)
|
||||
mailserver-removed?
|
||||
(connect-to-mailserver cofx)))
|
||||
;; if there is no current mailserver defined
|
||||
;; if there is no current mailserver defined,
|
||||
;; we set it first
|
||||
(set-current-mailserver cofx))))
|
||||
|
||||
@@ -464,7 +446,6 @@
|
||||
(when (and
|
||||
(:filters/initialized db)
|
||||
(mobile-network-utils/syncing-allowed? cofx)
|
||||
(fetch-use-mailservers? cofx)
|
||||
(not (:mailserver/current-request db)))
|
||||
(when-let [mailserver (get-mailserver-when-ready cofx)]
|
||||
(let [request-to (or (:mailserver/request-to db)
|
||||
@@ -508,24 +489,11 @@
|
||||
dissoc :generating-sym-key?))}
|
||||
(process-next-messages-request))))
|
||||
|
||||
(fx/defn update-use-mailservers
|
||||
[cofx use-mailservers?]
|
||||
(fx/merge cofx
|
||||
(multiaccounts.update/multiaccount-update :use-mailservers? use-mailservers? {})
|
||||
(if use-mailservers?
|
||||
(connect-to-mailserver)
|
||||
(disconnect-from-mailserver))))
|
||||
|
||||
(fx/defn change-mailserver
|
||||
"mark mailserver status as `:error` if custom mailserver is used
|
||||
otherwise try to reconnect to another mailserver"
|
||||
[{:keys [db] :as cofx}]
|
||||
(when (and (fetch-use-mailservers? cofx)
|
||||
;; For some reason the tests are checking
|
||||
;; for non-zero, so nil value is ok, not
|
||||
;; sure is intentional, but will leave it as it is
|
||||
;; instead of using pos?
|
||||
(not (zero? (:peers-count db))))
|
||||
(when-not (zero? (:peers-count db))
|
||||
(if-let [preferred-mailserver (preferred-mailserver-id db)]
|
||||
(let [current-fleet (node/current-fleet-key db)]
|
||||
{:db
|
||||
@@ -557,8 +525,7 @@
|
||||
;; check if logged into multiaccount
|
||||
(when (contains? db :multiaccount)
|
||||
(let [last-connection-attempt (:mailserver/last-connection-attempt db)]
|
||||
(when (and (fetch-use-mailservers? cofx)
|
||||
(<= (- now last-connection-attempt)))
|
||||
(when (<= (- now last-connection-attempt))
|
||||
(fx/merge cofx
|
||||
(when (not= :connected (:mailserver/state db))
|
||||
(change-mailserver)))))))
|
||||
@@ -1157,14 +1124,11 @@
|
||||
(let [{:keys [address]} (fetch-current db)
|
||||
pinned-mailservers (get-in db [:multiaccount :pinned-mailservers])
|
||||
;; Check if previous mailserver was pinned
|
||||
pinned? (get pinned-mailservers current-fleet)
|
||||
use-mailservers? (fetch-use-mailservers? cofx)]
|
||||
pinned? (get pinned-mailservers current-fleet)]
|
||||
(fx/merge cofx
|
||||
{:db (assoc db :mailserver/current-id mailserver-id)
|
||||
:mailserver/remove-peer address}
|
||||
|
||||
(when use-mailservers? (connect-to-mailserver))
|
||||
|
||||
(connect-to-mailserver)
|
||||
(when pinned?
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:pinned-mailservers (assoc pinned-mailservers
|
||||
|
||||
@@ -35,14 +35,12 @@
|
||||
(deftest change-mailserver
|
||||
(testing "we are offline"
|
||||
(testing "it does not change mailserver"
|
||||
(is (not (mailserver/change-mailserver {:db {:multiaccount {:use-mailservers? true}
|
||||
:peers-count 0}})))))
|
||||
(is (not (mailserver/change-mailserver {:db {:peers-count 0}})))))
|
||||
(testing "we are online"
|
||||
(testing "there's a preferred mailserver"
|
||||
(testing "it shows the popup"
|
||||
(is (:ui/show-confirmation (mailserver/change-mailserver
|
||||
{:db {:multiaccount {:fleet :staging
|
||||
:use-mailservers? true
|
||||
:pinned-mailservers {:staging "id"}}
|
||||
:peers-count 1}})))))
|
||||
(testing "there's not a preferred mailserver"
|
||||
@@ -51,14 +49,12 @@
|
||||
(get-in
|
||||
(mailserver/change-mailserver
|
||||
{:db {:mailserver/mailservers {:staging {:a "b"}}
|
||||
:multiaccount {:use-mailservers? true
|
||||
:fleet :staging}
|
||||
:multiaccount {:fleet :staging}
|
||||
:peers-count 1}})
|
||||
[::json-rpc/call 0 :method]))))
|
||||
(testing "it does not show the popup"
|
||||
(is (not (:ui/show-confirmation (mailserver/change-mailserver
|
||||
{:db {:multiaccount {:use-mailservers? true}
|
||||
:peers-count 1}}))))))))
|
||||
{:db {:peers-count 1}}))))))))
|
||||
|
||||
(deftest test-registered-peer?
|
||||
(testing "Peer is registered"
|
||||
@@ -338,8 +334,7 @@
|
||||
:peers-summary (if registered-peer?
|
||||
[{:id "mailserver-id" :enode "enode://mailserver-id@ip"}]
|
||||
[])
|
||||
:multiaccount {:fleet :eth.staging
|
||||
:use-mailservers? true}
|
||||
:multiaccount {:fleet :eth.staging}
|
||||
:mailserver/current-id "mailserver-a"
|
||||
:mailserver/mailservers {:eth.staging {"mailserver-a" {:sym-key-id sym-key
|
||||
:address "enode://mailserver-id@ip"}}}}})
|
||||
@@ -359,8 +354,7 @@
|
||||
(testing "it changes mailserver"
|
||||
(is (= "mailservers_ping"
|
||||
(-> (mailserver/resend-request
|
||||
{:db {:multiaccount {:use-mailservers? true}
|
||||
:mailserver/current-request
|
||||
{:db {:mailserver/current-request
|
||||
{:attempts constants/maximum-number-of-attempts}}}
|
||||
{})
|
||||
::json-rpc/call
|
||||
@@ -617,8 +611,7 @@
|
||||
:password "mailserver-password"}}}
|
||||
:multiaccount
|
||||
{:fleet :eth.staging
|
||||
:pinned-mailservers {:eth.staging "mailserverid"}
|
||||
:use-mailservers? true}}]
|
||||
:pinned-mailservers {:eth.staging "mailserverid"}}}]
|
||||
(testing "it adds the peer"
|
||||
(is (= "mailserver-address"
|
||||
(:mailserver/add-peer (mailserver/connect-to-mailserver {:db db})))))
|
||||
@@ -632,12 +625,7 @@
|
||||
"somesymkeyid")]
|
||||
(testing "it does not generate a sym key if already present"
|
||||
(is (not (-> (mailserver/connect-to-mailserver {:db mailserver-with-sym-key-db})
|
||||
:shh/generate-sym-key-from-password)))))
|
||||
|
||||
(testing "it returns noops when use-mailservers? is false"
|
||||
(let [no-mailservers-cofx {:db (assoc-in db [:multiaccount :use-mailservers?] false)}]
|
||||
(is (= (mailserver/connect-to-mailserver no-mailservers-cofx)
|
||||
nil))))))
|
||||
:shh/generate-sym-key-from-password)))))))
|
||||
|
||||
(deftest check-existing-gaps
|
||||
(testing "no gaps"
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
[status-im.utils.theme :as utils.theme]
|
||||
[status-im.theme.core :as theme]
|
||||
[status-im.utils.utils :as utils]
|
||||
[quo.platform :as platform]
|
||||
[clojure.string :as string]))
|
||||
|
||||
(defn contact-names
|
||||
@@ -66,12 +65,6 @@
|
||||
(fn [on]
|
||||
(native-module/chaos-mode-update on (constantly nil))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::webview-debug-changed
|
||||
(fn [value]
|
||||
(when platform/android?
|
||||
(native-module/toggle-webview-debug value))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::blank-preview-flag-changed
|
||||
(fn [flag]
|
||||
@@ -93,15 +86,6 @@
|
||||
:dev-mode? dev-mode?
|
||||
{}))
|
||||
|
||||
(fx/defn switch-webview-debug
|
||||
{:events [:multiaccounts.ui/switch-webview-debug]}
|
||||
[{:keys [db] :as cofx} value]
|
||||
(fx/merge cofx
|
||||
{::webview-debug-changed value}
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:webview-debug (boolean value)
|
||||
{})))
|
||||
|
||||
(fx/defn switch-chaos-mode
|
||||
[{:keys [db] :as cofx} chaos-mode?]
|
||||
(when (:multiaccount db)
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
(fx/defn on-multiaccount-created
|
||||
[{:keys [signing-phrase random-guid-generator db] :as cofx}
|
||||
{:keys [address chat-key keycard-instance-uid key-uid
|
||||
keycard-pairing keycard-paired-on mnemonic recovered]
|
||||
keycard-pairing keycard-paired-on mnemonic public-key]
|
||||
:as multiaccount}
|
||||
password
|
||||
{:keys [save-mnemonic? login?] :or {login? true save-mnemonic? false}}]
|
||||
@@ -252,10 +252,7 @@
|
||||
:latest-derived-path 0
|
||||
:signing-phrase signing-phrase
|
||||
:send-push-notifications? true
|
||||
:installation-id (random-guid-generator)
|
||||
;; default mailserver (history node) setting
|
||||
:use-mailservers? true
|
||||
:recovered (or recovered (get-in db [:intro-wizard :recovering?]))}
|
||||
:installation-id (random-guid-generator)}
|
||||
constants/default-multiaccount)
|
||||
;; The address from which we derive any chat
|
||||
;; account/encryption keys
|
||||
|
||||
@@ -55,14 +55,14 @@
|
||||
|
||||
(fx/defn initialize-wallet
|
||||
{:events [::initialize-wallet]}
|
||||
[{:keys [db] :as cofx} accounts custom-tokens favourites new-account?]
|
||||
[{:keys [db] :as cofx} accounts custom-tokens favourites]
|
||||
(fx/merge
|
||||
cofx
|
||||
{:db (assoc db :multiaccount/accounts
|
||||
(rpc->accounts accounts))}
|
||||
(wallet/initialize-tokens custom-tokens)
|
||||
(wallet/initialize-favourites favourites)
|
||||
(wallet/update-balances nil new-account?)
|
||||
(wallet/update-balances nil)
|
||||
(prices/update-prices)))
|
||||
|
||||
(fx/defn login
|
||||
@@ -250,7 +250,9 @@
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [multiaccount multiaccounts :multiaccount/accounts]} db
|
||||
{:keys [creating?]} (:multiaccounts/login db)
|
||||
recovering? (get-in db [:intro-wizard :recovering?])
|
||||
first-account? (and creating?
|
||||
(not recovering?)
|
||||
(empty? multiaccounts))]
|
||||
(fx/merge cofx
|
||||
{:db (-> db
|
||||
@@ -264,7 +266,6 @@
|
||||
;;so here we set it at 1 already so that it passes the check once it has
|
||||
;;been initialized
|
||||
:filters/initialized 1))
|
||||
:dispatch-later [{:ms 2000 :dispatch [::initialize-wallet accounts nil nil (:recovered multiaccount)]}]
|
||||
:filters/load-filters [[]]}
|
||||
(finish-keycard-setup)
|
||||
(when first-account?
|
||||
@@ -274,7 +275,8 @@
|
||||
:mailserver-topics {}
|
||||
:default-mailserver true})
|
||||
(multiaccounts/switch-preview-privacy-mode-flag)
|
||||
(logging/set-log-level (:log-level multiaccount)))))
|
||||
(logging/set-log-level (:log-level multiaccount))
|
||||
(initialize-wallet accounts nil nil))))
|
||||
|
||||
(defn- keycard-setup? [cofx]
|
||||
(boolean (get-in cofx [:db :keycard :flow])))
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
[status-im.native-module.core :as status]
|
||||
[status-im.transport.core :as transport]
|
||||
[status-im.utils.fx :as fx]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.utils.keychain.core :as keychain]
|
||||
[status-im.notifications.core :as notifications]))
|
||||
|
||||
@@ -14,10 +13,9 @@
|
||||
[{:keys [db] :as cofx} {:keys [auth-method logout?]}]
|
||||
(let [key-uid (get-in db [:multiaccount :key-uid])]
|
||||
(fx/merge cofx
|
||||
{::logout nil
|
||||
::multiaccounts/webview-debug-changed false
|
||||
:keychain/clear-user-password key-uid
|
||||
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
||||
{::logout nil
|
||||
:keychain/clear-user-password key-uid
|
||||
::init/open-multiaccounts #(re-frame/dispatch [::init/initialize-multiaccounts % {:logout? logout?}])}
|
||||
(notifications/logout-disable)
|
||||
(keychain/save-auth-method key-uid auth-method)
|
||||
(transport/stop-whisper)
|
||||
|
||||
@@ -308,10 +308,6 @@
|
||||
(log/debug "[native-module] chaos-mode-update")
|
||||
(.chaosModeUpdate ^js (status) on on-result))
|
||||
|
||||
(defn toggle-webview-debug [on]
|
||||
(log/debug "[native-module] toggle-webview-debug" on)
|
||||
(.toggleWebviewDebug ^js (status) on))
|
||||
|
||||
(defn get-nodes-from-contract
|
||||
[rpc-endpoint contract-address on-result]
|
||||
(log/debug "[native-module] get-nodes-from-contract")
|
||||
@@ -384,8 +380,3 @@
|
||||
(defn deactivate-keep-awake []
|
||||
(log/debug "[native-module] deactivateKeepAwake")
|
||||
(.deactivateKeepAwake ^js (status)))
|
||||
|
||||
(defn reset-keyboard-input [input selection]
|
||||
(log/debug "[native-module] resetKeyboardInput")
|
||||
(when platform/android?
|
||||
(.resetKeyboardInputCursor ^js (status) input selection)))
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
{:db (assoc db :network-status (if is-connected? :online :offline))}
|
||||
(when is-connected?
|
||||
(if-not (= (count (get-in db [:wallet :accounts])) (count (get db :multiaccount/accounts)))
|
||||
(wallet/update-balances nil nil)))))
|
||||
(wallet/update-balances nil)))))
|
||||
|
||||
(fx/defn change-network-type
|
||||
[{:keys [db] :as cofx} old-network-type network-type expensive?]
|
||||
|
||||
@@ -23,11 +23,9 @@
|
||||
(reset! warning? false)
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-failed [warnings]
|
||||
(defn build-failed []
|
||||
(reset! warning? true)
|
||||
(reset! label (str "building failed"
|
||||
(when (seq warnings)
|
||||
(str "\n" (count warnings) " warnings"))))
|
||||
(reset! label "building failed")
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-start []
|
||||
@@ -35,15 +33,6 @@
|
||||
(reset! label "building")
|
||||
(reset! visible true))
|
||||
|
||||
(defn build-notify [{:keys [type info]}]
|
||||
(cond (= :build-start type)
|
||||
(build-start)
|
||||
(or (= :build-failure type)
|
||||
(and (= :build-complete type) (seq (:warnings info))))
|
||||
(build-failed (:warnings info))
|
||||
(= :build-complete type)
|
||||
(build-competed)))
|
||||
|
||||
(defn reload-view [_]
|
||||
(fn [cnt]
|
||||
(when @timeout (js/clearTimeout @timeout))
|
||||
|
||||
+12
-23
@@ -15,7 +15,6 @@
|
||||
[status-im.ethereum.transactions.core :as transactions]
|
||||
[status-im.fleet.core :as fleet]
|
||||
[status-im.group-chats.db :as group-chats.db]
|
||||
[status-im.group-chats.core :as group-chat]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.multiaccounts.core :as multiaccounts]
|
||||
[status-im.multiaccounts.db :as multiaccounts.db]
|
||||
@@ -43,8 +42,7 @@
|
||||
status-im.ui.screens.keycard.subs
|
||||
status-im.ui.screens.keycard.settings.subs
|
||||
status-im.ui.screens.keycard.pin.subs
|
||||
status-im.ui.screens.keycard.setup.subs
|
||||
[status-im.chat.models.mentions :as mentions]))
|
||||
status-im.ui.screens.keycard.setup.subs))
|
||||
|
||||
;; TOP LEVEL ===========================================================================================================
|
||||
|
||||
@@ -868,13 +866,6 @@
|
||||
(fn [[invitations]]
|
||||
(filter #(= constants/invitation-state-requested (:state %)) invitations)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:group-chat/removed-from-current-chat?
|
||||
:<- [:chats/current-raw-chat]
|
||||
:<- [:multiaccount/public-key]
|
||||
(fn [[current-chat pk]]
|
||||
(group-chat/member-removed? current-chat pk)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:chats/transaction-status
|
||||
;;TODO address here for transactions
|
||||
@@ -899,12 +890,11 @@
|
||||
(not (contact.db/blocked? contact)))
|
||||
(let [name (utils/safe-replace name ".stateofus.eth" "")]
|
||||
(assoc acc public-key
|
||||
(mentions/add-searchable-phrases
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:public-key key})))
|
||||
{:alias alias
|
||||
:name (or name alias)
|
||||
:identicon identicon
|
||||
:nickname nickname
|
||||
:public-key key}))
|
||||
acc))
|
||||
{}
|
||||
contacts)))
|
||||
@@ -919,11 +909,10 @@
|
||||
(apply dissoc
|
||||
(-> users
|
||||
(merge contacts)
|
||||
(assoc public-key (mentions/add-searchable-phrases
|
||||
{:alias name
|
||||
:name (or preferred-name name)
|
||||
:identicon photo-path
|
||||
:public-key public-key})))
|
||||
(assoc public-key {:alias name
|
||||
:name (or preferred-name name)
|
||||
:identicon photo-path
|
||||
:public-key public-key}))
|
||||
blocked)))
|
||||
|
||||
(re-frame/reg-sub
|
||||
@@ -1285,9 +1274,9 @@
|
||||
|
||||
(defn get-asset-amount [balances sym]
|
||||
(reduce #(if-let [^js bl (get %2 sym)]
|
||||
(.plus ^js (or ^js %1 ^js (money/bignumber 0)) bl)
|
||||
(.plus ^js %1 bl)
|
||||
%1)
|
||||
nil
|
||||
^js (money/bignumber 0)
|
||||
balances))
|
||||
|
||||
(re-frame/reg-sub
|
||||
|
||||
@@ -255,14 +255,13 @@
|
||||
[rn/view {:style {:flex-direction :row
|
||||
:justify-content :center}}
|
||||
[rn/view {:style (styles/home-tokens-icons (count tokens))}
|
||||
(doall
|
||||
(for [[{name :name
|
||||
{source :source} :icon} _ i] tokens]
|
||||
^{:key name}
|
||||
[rn/view {:style (styles/home-token-icon-style i)}
|
||||
[rn/image {:source (if (fn? source) (source) source)
|
||||
:style {:width 20
|
||||
:height 20}}]]))]
|
||||
(for [[{name :name
|
||||
{source :source} :icon} _ i] tokens]
|
||||
^{:key name}
|
||||
[rn/view {:style (styles/home-token-icon-style i)}
|
||||
[rn/image {:source (if (fn? source) (source) source)
|
||||
:style {:width 20
|
||||
:height 20}}]])]
|
||||
[quo/text {:align :center}
|
||||
(i18n/label :t/invite-reward)]])]])))
|
||||
|
||||
|
||||
@@ -11,8 +11,7 @@
|
||||
(defn- normal-mode-settings-data [{:keys [network-name
|
||||
current-log-level
|
||||
waku-bloom-filter-mode
|
||||
current-fleet
|
||||
webview-debug]}]
|
||||
current-fleet]}]
|
||||
[{:size :small
|
||||
:title (i18n/label :t/network)
|
||||
:accessibility-label :network-button
|
||||
@@ -64,15 +63,6 @@
|
||||
#(re-frame/dispatch [:navigate-to :notifications-advanced-settings])
|
||||
:chevron true})
|
||||
{:size :small
|
||||
:title "Webview debug"
|
||||
:accessibility-label :webview-debug-switch
|
||||
:container-margin-bottom 8
|
||||
:on-press
|
||||
#(re-frame/dispatch
|
||||
[:multiaccounts.ui/switch-webview-debug (not webview-debug)])
|
||||
:accessory :switch
|
||||
:active webview-debug}
|
||||
{:size :small
|
||||
:title (i18n/label :t/waku-bloom-filter-mode)
|
||||
:accessibility-label :waku-bloom-filter-mode-settings-switch
|
||||
:container-margin-bottom 8
|
||||
@@ -81,7 +71,7 @@
|
||||
[:multiaccounts.ui/waku-bloom-filter-mode-switched (not waku-bloom-filter-mode)])
|
||||
:accessory :switch
|
||||
:active waku-bloom-filter-mode}
|
||||
#_{:size :small
|
||||
#_{:size :small
|
||||
:title :t/dev-mode
|
||||
:accessibility-label :dev-mode-settings-switch
|
||||
:container-margin-bottom 8
|
||||
@@ -129,7 +119,7 @@
|
||||
[quo/list-item props]))
|
||||
|
||||
(views/defview advanced-settings []
|
||||
(views/letsubs [{:keys [chaos-mode? webview-debug]} [:multiaccount]
|
||||
(views/letsubs [{:keys [chaos-mode?]} [:multiaccount]
|
||||
network-name [:network-name]
|
||||
waku-bloom-filter-mode [:waku/bloom-filter-mode]
|
||||
current-log-level [:log-level/current-log-level]
|
||||
@@ -143,7 +133,6 @@
|
||||
:current-fleet current-fleet
|
||||
:dev-mode? false
|
||||
:waku-bloom-filter-mode waku-bloom-filter-mode
|
||||
:webview-debug webview-debug
|
||||
:chaos-mode? chaos-mode?})
|
||||
:key-fn (fn [_ i] (str i))
|
||||
:render-fn render-item}]]))
|
||||
|
||||
@@ -197,7 +197,7 @@
|
||||
input-with-mentions)]]))
|
||||
|
||||
(defn mention-item
|
||||
[text-input-ref [_ {:keys [identicon alias name nickname] :as user}]]
|
||||
[[_ {:keys [identicon alias name nickname] :as user}]]
|
||||
(let [ens-name? (not= alias name)]
|
||||
[list-item/list-item
|
||||
(cond-> {:icon
|
||||
@@ -233,14 +233,14 @@
|
||||
:title-text-weight :medium
|
||||
:on-press
|
||||
(fn []
|
||||
(re-frame/dispatch [:chat.ui/select-mention text-input-ref user]))}
|
||||
(re-frame/dispatch [:chat.ui/select-mention user]))}
|
||||
|
||||
ens-name?
|
||||
(assoc :subtitle alias))]))
|
||||
|
||||
(def chat-input-height (reagent/atom nil))
|
||||
|
||||
(defn autocomplete-mentions [text-input-ref]
|
||||
(defn autocomplete-mentions []
|
||||
(let [suggestions @(re-frame/subscribe [:chat/mention-suggestions])]
|
||||
(when (and (seq suggestions) @chat-input-height)
|
||||
(let [height (+ 16 (* 52 (min 4.5 (count suggestions))))]
|
||||
@@ -254,7 +254,7 @@
|
||||
:header [rn/view {:style {:height 8}}]
|
||||
:data suggestions
|
||||
:key-fn first
|
||||
:render-fn #(mention-item text-input-ref %)}]]]))))
|
||||
:render-fn #(mention-item %)}]]]))))
|
||||
|
||||
(defn chat-input
|
||||
[{:keys [set-active-panel active-panel on-send-press reply
|
||||
|
||||
@@ -19,11 +19,12 @@
|
||||
(i18n/label :t/join-group-chat)])
|
||||
|
||||
(defn decline-chat [chat-id]
|
||||
[quo/button
|
||||
{:type :secondary
|
||||
:accessibility-label :decline-chat-button
|
||||
:on-press #(debounce/dispatch-and-chill [:group-chats.ui/leave-chat-confirmed chat-id] 2000)}
|
||||
(i18n/label :t/group-chat-decline-invitation)])
|
||||
[react/touchable-highlight
|
||||
{:on-press
|
||||
#(debounce/dispatch-and-chill [:group-chats.ui/leave-chat-confirmed chat-id] 2000)
|
||||
:accessibility-label :decline-chat-button}
|
||||
[react/text {:style style/decline-chat}
|
||||
(i18n/label :t/group-chat-decline-invitation)]])
|
||||
|
||||
(defn request-membership [{:keys [state introduction-message] :as invitation}]
|
||||
(let [{:keys [message retry?]} @(re-frame/subscribe [:chats/current-chat-membership])]
|
||||
@@ -63,11 +64,10 @@
|
||||
(defview group-chat-footer
|
||||
[chat-id invitation-admin]
|
||||
(letsubs [{:keys [joined?]} [:group-chat/inviter-info chat-id]
|
||||
removed? [:group-chat/removed-from-current-chat?]
|
||||
invitations [:group-chat/invitations-by-chat-id chat-id]]
|
||||
(if invitation-admin
|
||||
[request-membership (first invitations)]
|
||||
(when (and (not joined?) (not removed?))
|
||||
(when-not joined?
|
||||
[react/view {:style style/group-chat-join-footer}
|
||||
[react/view {:style style/group-chat-join-container}
|
||||
[join-chat-button chat-id]
|
||||
|
||||
@@ -42,8 +42,7 @@
|
||||
from
|
||||
contact-name
|
||||
current-public-key
|
||||
(partial style/quoted-message-author outgoing)
|
||||
outgoing]]
|
||||
(partial style/quoted-message-author outgoing)]]
|
||||
(if (and image
|
||||
;; Disabling images for public-chats
|
||||
(not public?))
|
||||
|
||||
@@ -104,10 +104,13 @@
|
||||
|
||||
(def group-chat-join-container
|
||||
{:flex 1
|
||||
:padding-bottom 40
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def decline-chat
|
||||
{:color colors/blue
|
||||
:margin-bottom 40})
|
||||
|
||||
(def are-you-friends-bubble
|
||||
{:border-radius 8
|
||||
:border-width 1
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
:font-weight "400"}}
|
||||
first-name]))))
|
||||
|
||||
(defn format-reply-author [from username current-public-key style outgoing]
|
||||
(defn format-reply-author [from username current-public-key style]
|
||||
(let [contact-name (str reply-symbol username)]
|
||||
(or (and (= from current-public-key)
|
||||
[react/text {:style (style true)}
|
||||
@@ -43,9 +43,7 @@
|
||||
:line-height 18
|
||||
:font-weight "500"})}
|
||||
(or (stateofus/username trimmed-name) trimmed-name)])
|
||||
[react/text {:style (merge {:color (if outgoing
|
||||
colors/white-transparent-70-persist
|
||||
colors/gray)
|
||||
[react/text {:style (merge {:color colors/gray
|
||||
:font-size 12
|
||||
:line-height 18
|
||||
:font-weight "400"})}
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
;; :always doesn't work and keyboard is hidden on pressing suggestion.
|
||||
;; Scrolling of suggestions doesn't work neither in this case.
|
||||
(when platform/android?
|
||||
[components/autocomplete-mentions text-input-ref])
|
||||
[components/autocomplete-mentions])
|
||||
(when show-input?
|
||||
[accessory/view {:y position-y
|
||||
:pan-state pan-state
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
[react/view styles/multiaccounts-container
|
||||
[list/flat-list {:data (vals multiaccounts)
|
||||
:contentContainerStyle styles/multiaccounts-list-container
|
||||
:key-fn (comp str :address)
|
||||
:key-fn :address
|
||||
:render-fn multiaccount-view}]]
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
|
||||
@@ -5,10 +5,15 @@
|
||||
(def wrapper
|
||||
{:flex 1})
|
||||
|
||||
(styles/defn mailserver-item []
|
||||
(def mailserver-item-inner
|
||||
{:padding-horizontal 16})
|
||||
|
||||
(styles/defn mailserver-item [pinned?]
|
||||
{:flex-direction :row
|
||||
:align-items :center
|
||||
:justify-content :space-between
|
||||
:opacity (if pinned?
|
||||
1
|
||||
0.4)
|
||||
:padding-horizontal 16
|
||||
:ios {:height 64}
|
||||
:android {:height 56}})
|
||||
@@ -26,24 +31,21 @@
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def switch-container
|
||||
{:height 52})
|
||||
(defn mailserver-icon [connected?]
|
||||
(hash-map :color
|
||||
(if connected? colors/white-persist colors/gray)))
|
||||
|
||||
(def automatic-selection-container
|
||||
{:border-top-width 1
|
||||
:border-top-color colors/gray-lighter
|
||||
:margin-top 16})
|
||||
(def mailserver-pinned
|
||||
{:padding-horizontal 16
|
||||
:flex-direction :row
|
||||
:align-items :center
|
||||
:padding-vertical 5})
|
||||
|
||||
(def explanation-text
|
||||
{:color colors/gray})
|
||||
(def mailserver-pinned-checkbox-container
|
||||
{:width 40
|
||||
:height 40
|
||||
:align-items :center
|
||||
:justify-content :center})
|
||||
|
||||
(def use-history-explanation-text-container
|
||||
{:margin-right 16
|
||||
:margin-left 16
|
||||
:margin-top 8
|
||||
:margin-bottom 16})
|
||||
|
||||
(def history-nodes-label
|
||||
{:color colors/gray
|
||||
:padding-horizontal 16
|
||||
:margin-top 48})
|
||||
(def mailserver-pinned-text-container
|
||||
{:padding-horizontal 15})
|
||||
|
||||
@@ -2,78 +2,60 @@
|
||||
(:require-macros [status-im.utils.views :as views])
|
||||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.i18n :as i18n]
|
||||
[status-im.ui.components.checkbox.view :as checkbox.views]
|
||||
[status-im.ui.components.icons.vector-icons :as vector-icons]
|
||||
[status-im.ui.components.list.views :as list]
|
||||
[status-im.ui.components.react :as react]
|
||||
[status-im.ui.components.radio :as radio]
|
||||
[status-im.ui.components.colors :as colors]
|
||||
[status-im.ui.screens.offline-messaging-settings.styles :as styles]
|
||||
[status-im.ui.screens.profile.components.views :as profile.components]
|
||||
[status-im.ui.components.topbar :as topbar]))
|
||||
|
||||
(defn- mailserver-icon [connected?]
|
||||
[react/view (styles/mailserver-icon-container connected?)
|
||||
[vector-icons/icon :main-icons/mailserver
|
||||
(styles/mailserver-icon connected?)]])
|
||||
|
||||
(defn pinned-state [pinned?]
|
||||
[react/view {:style styles/automatic-selection-container}
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/mailserver-automatic
|
||||
:value (not pinned?)
|
||||
:action-fn #(if pinned?
|
||||
(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
(re-frame/dispatch [:mailserver.ui/pin-pressed]))}]]
|
||||
[react/view {:style {:padding-horizontal 16}}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/mailserver-automatic-switch-explanation)]]])
|
||||
[react/touchable-highlight {:on-press (if pinned?
|
||||
#(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
#(re-frame/dispatch [:mailserver.ui/pin-pressed]))}
|
||||
[react/view {:style styles/mailserver-pinned}
|
||||
[checkbox.views/checkbox
|
||||
{:checked? (not pinned?)
|
||||
:style styles/mailserver-pinned-checkbox-container
|
||||
:on-value-change (if pinned?
|
||||
#(re-frame/dispatch [:mailserver.ui/unpin-pressed])
|
||||
#(re-frame/dispatch [:mailserver.ui/pin-pressed]))}]
|
||||
[react/view {:style styles/mailserver-pinned-text-container}
|
||||
[react/text (i18n/label :t/mailserver-automatic)]]]])
|
||||
|
||||
(defn render-row [current-mailserver-id pinned?]
|
||||
(fn [{:keys [name id user-defined]}]
|
||||
(let [connected? (= id current-mailserver-id)
|
||||
visible? (or pinned? ; show everything when auto selection is turned off
|
||||
(and (not pinned?) ; auto selection turned on
|
||||
(= current-mailserver-id id) ; show only the selected server
|
||||
))]
|
||||
(when visible?
|
||||
[react/touchable-highlight
|
||||
{:on-press (when pinned? #(if user-defined
|
||||
(re-frame/dispatch [:mailserver.ui/user-defined-mailserver-selected id])
|
||||
(re-frame/dispatch [:mailserver.ui/default-mailserver-selected id])))
|
||||
:accessibility-label :mailserver-item}
|
||||
[react/view (styles/mailserver-item)
|
||||
[react/text {:style styles/mailserver-item-name-text}
|
||||
name]
|
||||
|
||||
(if pinned?
|
||||
[radio/radio connected?]
|
||||
[vector-icons/icon :check {:color colors/blue}])]]))))
|
||||
(let [connected? (= id current-mailserver-id)]
|
||||
[react/touchable-highlight
|
||||
{:on-press (when pinned? #(if user-defined
|
||||
(re-frame/dispatch [:mailserver.ui/user-defined-mailserver-selected id])
|
||||
(re-frame/dispatch [:mailserver.ui/default-mailserver-selected id])))
|
||||
:accessibility-label :mailserver-item}
|
||||
[react/view (styles/mailserver-item pinned?)
|
||||
[mailserver-icon connected?]
|
||||
[react/view styles/mailserver-item-inner
|
||||
[react/text {:style styles/mailserver-item-name-text}
|
||||
name]]]])))
|
||||
|
||||
(views/defview offline-messaging-settings []
|
||||
(views/letsubs [current-mailserver-id [:mailserver/current-id]
|
||||
preferred-mailserver-id [:mailserver/preferred-id]
|
||||
mailservers [:mailserver/fleet-mailservers]
|
||||
{:keys [use-mailservers?]} [:multiaccount]]
|
||||
[react/view {:style styles/wrapper}
|
||||
(views/letsubs [current-mailserver-id [:mailserver/current-id]
|
||||
preferred-mailserver-id [:mailserver/preferred-id]
|
||||
mailservers [:mailserver/fleet-mailservers]]
|
||||
[react/view {:flex 1}
|
||||
[topbar/topbar
|
||||
{:title (i18n/label :t/offline-messaging-settings)
|
||||
{:title (i18n/label :t/offline-messaging-settings)
|
||||
:right-accessories
|
||||
[{:icon :main-icons/add-circle
|
||||
[{:icon :main-icons/add
|
||||
:on-press #(re-frame/dispatch [:mailserver.ui/add-pressed])}]}]
|
||||
|
||||
[react/view {:style styles/switch-container}
|
||||
[profile.components/settings-switch-item
|
||||
{:label-kw :t/offline-messaging-use-history-nodes
|
||||
:value use-mailservers?
|
||||
:action-fn #(re-frame/dispatch [:mailserver.ui/use-history-switch-pressed (not use-mailservers?)])}]]
|
||||
[react/view {:style styles/use-history-explanation-text-container}
|
||||
[react/text {:style styles/explanation-text}
|
||||
(i18n/label :t/offline-messaging-use-history-explanation)]]
|
||||
|
||||
(when use-mailservers?
|
||||
[:<>
|
||||
[pinned-state preferred-mailserver-id]
|
||||
|
||||
[react/text {:style styles/history-nodes-label}
|
||||
(i18n/label :t/history-nodes)]
|
||||
[list/flat-list {:data (vals mailservers)
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn (render-row current-mailserver-id
|
||||
preferred-mailserver-id)}]])]))
|
||||
[react/view styles/wrapper
|
||||
[pinned-state preferred-mailserver-id]
|
||||
[list/flat-list {:data (vals mailservers)
|
||||
:default-separator? false
|
||||
:key-fn :name
|
||||
:render-fn (render-row current-mailserver-id
|
||||
preferred-mailserver-id)}]]]))
|
||||
|
||||
@@ -81,7 +81,6 @@
|
||||
(re-frame/dispatch
|
||||
[::delete-profile/delete-profile @password])
|
||||
(reset! password nil))
|
||||
:theme :negative
|
||||
:accessibility-label :delete-profile-confirm
|
||||
:theme :negative
|
||||
:disabled ((complement valid-password?) @password)}
|
||||
(i18n/label :t/delete-profile)]]])]]))))
|
||||
|
||||
@@ -195,16 +195,16 @@
|
||||
:subtitle second-name})}
|
||||
|
||||
[react/view {:padding-top 12}
|
||||
(for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)
|
||||
:when label]
|
||||
(for [{:keys [label subtext accessibility-label icon action disabled?]} (actions contact)]
|
||||
^{:key label}
|
||||
[quo/list-item {:theme :accent
|
||||
:title label
|
||||
:subtitle subtext
|
||||
:icon icon
|
||||
:accessibility-label accessibility-label
|
||||
:disabled disabled?
|
||||
:on-press action}])]
|
||||
(when label
|
||||
[quo/list-item {:theme :accent
|
||||
:title label
|
||||
:subtitle subtext
|
||||
:icon icon
|
||||
:accessibility-label accessibility-label
|
||||
:disabled disabled?
|
||||
:on-press action}]))]
|
||||
[react/view styles/contact-profile-details-container
|
||||
[profile-details contact]
|
||||
[chat-settings contact]]
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
[status-im.ui.screens.routing.intro-login-stack :as intro-login-stack]
|
||||
[status-im.ui.screens.routing.chat-stack :as chat-stack]
|
||||
[status-im.ui.screens.routing.wallet-stack :as wallet-stack]
|
||||
[status-im.ui.screens.wallet.events :as wallet.events]
|
||||
[status-im.ui.screens.group.views :as group-chat]
|
||||
[status-im.ui.screens.group.events :as group.events]
|
||||
[status-im.ui.screens.routing.profile-stack :as profile-stack]
|
||||
@@ -42,6 +43,7 @@
|
||||
:insets {:top false}
|
||||
:component browser-stack/browser-stack}
|
||||
{:name :wallet-stack
|
||||
:on-focus [::wallet.events/wallet-stack]
|
||||
:insets {:top false}
|
||||
:component wallet-stack/wallet-stack}
|
||||
{:name :profile-stack
|
||||
|
||||
@@ -8,8 +8,7 @@
|
||||
[status-im.ui.components.topbar :as topbar]))
|
||||
|
||||
(views/defview sync-settings []
|
||||
(views/letsubs [{:keys [syncing-on-mobile-network?
|
||||
use-mailservers?]} [:multiaccount]
|
||||
(views/letsubs [{:keys [syncing-on-mobile-network?]} [:multiaccount]
|
||||
mailserver-id [:mailserver/current-id]]
|
||||
[react/view {:style {:flex 1 :background-color colors/white}}
|
||||
[topbar/topbar {:title (i18n/label :t/sync-settings)}]
|
||||
@@ -29,7 +28,7 @@
|
||||
:title (i18n/label :t/offline-messaging)
|
||||
:on-press #(re-frame/dispatch [:navigate-to :offline-messaging-settings])
|
||||
:accessory :text
|
||||
:accessory-text (when use-mailservers? mailserver-id)
|
||||
:accessory-text mailserver-id
|
||||
:chevron true}]
|
||||
;; TODO(Ferossgp): Devider componemt
|
||||
[react/view {:height 1
|
||||
|
||||
@@ -18,13 +18,6 @@
|
||||
:accessibility-label :wallet-manage-assets
|
||||
:on-press #(hide-sheet-and-dispatch
|
||||
[:navigate-to :wallet-settings-assets])}]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/scan-tokens)
|
||||
:icon :main-icons/refresh
|
||||
:accessibility-label :wallet-scan-token
|
||||
:on-press #(hide-sheet-and-dispatch
|
||||
[:wallet/update-balances nil true])}]
|
||||
[quo/list-item
|
||||
{:theme :accent
|
||||
:title (i18n/label :t/set-currency)
|
||||
|
||||
@@ -74,14 +74,12 @@
|
||||
[quo/list-item
|
||||
(merge {:title [quo/text {:weight :medium}
|
||||
[quo/text {:weight :inherit}
|
||||
(str (if amount
|
||||
(wallet.utils/format-amount amount decimals)
|
||||
"...")
|
||||
(str (wallet.utils/format-amount amount decimals)
|
||||
" ")]
|
||||
[quo/text {:color :secondary
|
||||
:weight :inherit}
|
||||
(wallet.utils/display-symbol token)]]
|
||||
:subtitle (str (if value value "...") " " currency)
|
||||
:subtitle (str (if value value "0.00") " " currency)
|
||||
:accessibility-label (str (:symbol token) "-asset-value")
|
||||
:icon (if icon
|
||||
[list/item-image icon]
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
(ns status-im.ui.screens.wallet.events
|
||||
(:require [status-im.ui.screens.wallet.signing-phrase.views :as signing-phrase]
|
||||
[status-im.utils.handlers :as handlers]
|
||||
[status-im.utils.fx :as fx]))
|
||||
[status-im.utils.handlers :as handlers]))
|
||||
|
||||
(fx/defn wallet-will-focus
|
||||
{:events [::wallet-stack]}
|
||||
[{:keys [db]}]
|
||||
(let [wallet-set-up-passed? (get-in db [:multiaccount :wallet-set-up-passed?])
|
||||
sign-phrase-showed? (get db :wallet/sign-phrase-showed?)]
|
||||
{:dispatch [:wallet.ui/pull-to-refresh] ;TODO temporary simple fix for v1
|
||||
:db (if (or wallet-set-up-passed? sign-phrase-showed?)
|
||||
db
|
||||
(assoc db :popover/popover {:view [signing-phrase/signing-phrase]}
|
||||
:wallet/sign-phrase-showed? true))}))
|
||||
(handlers/register-handler-fx
|
||||
::wallet-stack
|
||||
(fn [{:keys [db]}]
|
||||
(let [wallet-set-up-passed? (get-in db [:multiaccount :wallet-set-up-passed?])
|
||||
sign-phrase-showed? (get db :wallet/sign-phrase-showed?)]
|
||||
{:dispatch [:wallet.ui/pull-to-refresh] ;TODO temporary simple fix for v1
|
||||
:db (if (or wallet-set-up-passed? sign-phrase-showed?)
|
||||
db
|
||||
(assoc db :popover/popover {:view [signing-phrase/signing-phrase]}
|
||||
:wallet/sign-phrase-showed? true))})))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
::wallet-add-custom-token
|
||||
|
||||
@@ -89,6 +89,7 @@
|
||||
:subtitle second-name
|
||||
:on-press #(do
|
||||
(some-> ^js @scroll-view-ref (.scrollTo #js {:x 0 :animated true}))
|
||||
(re-frame/dispatch [:wallet.recipient/focus-input])
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed name]))
|
||||
:icon [chat-icon/contact-icon-contacts-tab
|
||||
(multiaccounts/displayed-photo contact)]}]))
|
||||
@@ -118,7 +119,9 @@
|
||||
[quo/list-item
|
||||
{:title [quo/text {:monospace true}
|
||||
(utils/get-shortened-checksum-address address)]
|
||||
:on-press #(re-frame/dispatch [:wallet.recipient/address-changed address])
|
||||
:on-press #(do
|
||||
(re-frame/dispatch [:wallet.recipient/focus-input])
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed address]))
|
||||
:size :small
|
||||
:accessory [react/text {:style {:flex-shrink 1
|
||||
:color colors/gray}}
|
||||
@@ -224,17 +227,15 @@
|
||||
:align-items :center :height 40 :margin-vertical 8}
|
||||
[quo/text (i18n/label :t/address-or-ens-name)]]
|
||||
[quo/text-input
|
||||
{:multiline true
|
||||
:default-value resolved-address
|
||||
:height 70
|
||||
:editable false
|
||||
:accessibility-label :fav-address}]]
|
||||
{:multiline true
|
||||
:default-value resolved-address
|
||||
:height 70
|
||||
:editable false}]]
|
||||
[react/view {:height 16}]
|
||||
[quo/list-header (i18n/label :t/name-optional)]
|
||||
[react/view {:padding-horizontal 16}
|
||||
[quo/text-input {:show-cancel false
|
||||
:accessibility-label :fav-name
|
||||
:on-change-text #(reset! fav-name %)}]]]
|
||||
[quo/text-input {:show-cancel false
|
||||
:on-change-text #(reset! fav-name %)}]]]
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:center
|
||||
@@ -245,8 +246,9 @@
|
||||
(i18n/label :t/add)]}]]]))
|
||||
|
||||
(views/defview recipient []
|
||||
(views/letsubs [{:keys [address resolved-address searching]} [:wallet/recipient]
|
||||
search-filter [:search/recipient-filter]]
|
||||
(views/letsubs [{:keys [address resolved-address searching] :as recip} [:wallet/recipient]
|
||||
search-filter [:search/recipient-filter]
|
||||
input-focused? (reagent/atom false)]
|
||||
(let [disabled? (or searching (not resolved-address))]
|
||||
[kb-presentation/keyboard-avoiding-view {:style {:flex 1}}
|
||||
[react/view {:flex 1}
|
||||
@@ -266,6 +268,10 @@
|
||||
(i18n/label :t/paste)]]
|
||||
[quo/text-input
|
||||
{:multiline true
|
||||
:get-ref #(when (and recip %)
|
||||
(re-frame/dispatch [:set-in [:wallet/recipient :inp-ref] %]))
|
||||
:on-focus #(reset! input-focused? true)
|
||||
:on-blur #(reset! input-focused? false)
|
||||
:default-value address
|
||||
:height 70
|
||||
:placeholder (i18n/label :t/recipient-code-placeholder)
|
||||
@@ -289,20 +295,21 @@
|
||||
:color :inherit}
|
||||
(utils/get-shortened-address resolved-address)]]))]
|
||||
[accordion search-filter]]]
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:left
|
||||
[quo/button
|
||||
{:accessibility-label :participant-add-to-favs
|
||||
:type :secondary
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-favourite])}
|
||||
(i18n/label :t/add-to-favourites)]
|
||||
:right
|
||||
[quo/button
|
||||
{:accessibility-label :participant-done
|
||||
:type :secondary
|
||||
:after :main-icons/next
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:wallet.send/set-recipient resolved-address])}
|
||||
(i18n/label :t/done)]}]]])))
|
||||
(when @input-focused?
|
||||
[toolbar/toolbar
|
||||
{:show-border? true
|
||||
:left
|
||||
[quo/button
|
||||
{:accessibility-label :participant-add-to-favs
|
||||
:type :secondary
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:navigate-to :new-favourite])}
|
||||
(i18n/label :t/add-to-favourites)]
|
||||
:right
|
||||
[quo/button
|
||||
{:accessibility-label :participant-done
|
||||
:type :secondary
|
||||
:after :main-icons/next
|
||||
:disabled disabled?
|
||||
:on-press #(re-frame/dispatch [:wallet.send/set-recipient resolved-address])}
|
||||
(i18n/label :t/done)]}])]])))
|
||||
@@ -17,7 +17,7 @@
|
||||
;; NOTE(oskarth): Feature flag deprecation lifecycles. We want to make sure
|
||||
;; flags stay up to date and are removed once behavior introduced is stable.
|
||||
|
||||
(goog-define INFURA_TOKEN "d3633f237cbd4649a639067d1807584c")
|
||||
(goog-define INFURA_TOKEN "40ec14d9d9384d52b7fbcfecdde4e2c0")
|
||||
|
||||
(def bootnodes-settings-enabled? (enabled? (get-config :BOOTNODES_SETTINGS_ENABLED "1")))
|
||||
(def rpc-networks-only? (enabled? (get-config :RPC_NETWORKS_ONLY "1")))
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
(ns status-im.utils.platform
|
||||
(:require ["react-native" :as react-native :refer (Dimensions)]))
|
||||
(:require [status-im.ios.platform :as ios]
|
||||
["react-native" :as react-native]))
|
||||
|
||||
(def platform
|
||||
(.-Platform react-native))
|
||||
@@ -12,19 +13,9 @@
|
||||
(when platform
|
||||
(.-Version ^js platform)))
|
||||
|
||||
;; iPhone X dimensions
|
||||
(def x-height 812)
|
||||
(def xs-height 896)
|
||||
|
||||
(defn iphone-x-dimensions? []
|
||||
(let [{:keys [height]} (-> Dimensions
|
||||
(.get "window")
|
||||
(js->clj :keywordize-keys true))]
|
||||
(or (= height x-height) (= height xs-height))))
|
||||
|
||||
(def android? (= os "android"))
|
||||
(def ios? (= os "ios"))
|
||||
(def iphone-x? (and ios? (iphone-x-dimensions?)))
|
||||
(def iphone-x? (and ios? (ios/iphone-x-dimensions?)))
|
||||
|
||||
(defn no-backup-directory []
|
||||
(cond
|
||||
|
||||
@@ -201,7 +201,7 @@
|
||||
(fx/merge cofx
|
||||
{:db (update-in db [:add-account :account] merge account)}
|
||||
(save-new-account)
|
||||
(wallet/update-balances nil true)
|
||||
(wallet/update-balances nil)
|
||||
(prices/update-prices)
|
||||
(navigation/navigate-back)))))
|
||||
|
||||
|
||||
@@ -81,7 +81,9 @@
|
||||
(if address
|
||||
(if (:wallet/recipient db)
|
||||
{:db (update db :wallet/recipient assoc :resolved-address address
|
||||
:address address)}
|
||||
:address address)
|
||||
;;android
|
||||
:dispatch-later [{:ms 1000 :dispatch [:wallet.recipient/focus-input]}]}
|
||||
(if (:wallet/prepare-transaction db)
|
||||
{:db (update db :wallet/prepare-transaction assoc
|
||||
:to address :to-name (find-address-name db address))}
|
||||
|
||||
@@ -218,14 +218,15 @@
|
||||
favourites))})
|
||||
|
||||
(fx/defn update-balances
|
||||
{:events [:wallet/update-balances]}
|
||||
[{{:keys [network-status :wallet/all-tokens
|
||||
multiaccount :multiaccount/accounts] :as db} :db
|
||||
:as cofx} addresses init?]
|
||||
:as cofx} addresses]
|
||||
(let [addresses (or addresses (map (comp string/lower-case :address) accounts))
|
||||
{:keys [:wallet/visible-tokens]} multiaccount
|
||||
chain (ethereum/chain-keyword db)
|
||||
assets (get visible-tokens chain)
|
||||
init? (or (empty? assets)
|
||||
(= assets (constants/default-visible-tokens chain)))
|
||||
tokens (->> (vals all-tokens)
|
||||
(remove #(or (:hidden? %)
|
||||
;;if not init remove not visible tokens
|
||||
@@ -266,14 +267,12 @@
|
||||
[{{:keys [multiaccount] :as db} :db :as cofx} symbol checked?]
|
||||
(let [chain (ethereum/chain-keyword db)
|
||||
visible-tokens (get multiaccount :wallet/visible-tokens)]
|
||||
(fx/merge cofx
|
||||
(multiaccounts.update/multiaccount-update
|
||||
:wallet/visible-tokens (update visible-tokens
|
||||
chain
|
||||
#(set-checked % symbol checked?))
|
||||
{})
|
||||
#(when checked?
|
||||
(update-balances % nil nil)))))
|
||||
(multiaccounts.update/multiaccount-update
|
||||
cofx
|
||||
:wallet/visible-tokens (update visible-tokens
|
||||
chain
|
||||
#(set-checked % symbol checked?))
|
||||
{})))
|
||||
|
||||
(fx/defn toggle-visible-token
|
||||
[cofx symbol checked?]
|
||||
@@ -316,7 +315,9 @@
|
||||
|
||||
(fx/defn add-custom-token
|
||||
[cofx {:keys [symbol]}]
|
||||
(update-toggle-in-settings cofx symbol true))
|
||||
(fx/merge cofx
|
||||
(update-toggle-in-settings symbol true)
|
||||
(update-balances nil)))
|
||||
|
||||
(fx/defn remove-custom-token
|
||||
[cofx {:keys [symbol]}]
|
||||
|
||||
@@ -23,14 +23,35 @@
|
||||
|
||||
(re-frame/reg-fx
|
||||
:wallet.recipient/address-paste
|
||||
(fn []
|
||||
(fn [inp-ref]
|
||||
(react/get-from-clipboard
|
||||
#(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)]))))
|
||||
#(do
|
||||
(when inp-ref (.focus inp-ref))
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)])))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:wallet.recipient/address-paste
|
||||
(fn [inp-ref]
|
||||
(react/get-from-clipboard
|
||||
#(do
|
||||
(when inp-ref (.focus inp-ref))
|
||||
(re-frame/dispatch [:wallet.recipient/address-changed (string/trim %)])))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
::focus-input
|
||||
(fn [inp-ref]
|
||||
(when inp-ref
|
||||
(.focus inp-ref))))
|
||||
|
||||
(fx/defn focus-input
|
||||
{:events [:wallet.recipient/focus-input]}
|
||||
[{:keys [db]}]
|
||||
{::focus-input (get-in db [:wallet/recipient :inp-ref])})
|
||||
|
||||
(fx/defn address-paste-pressed
|
||||
{:events [:wallet.recipient/address-paste-pressed]}
|
||||
[_]
|
||||
{:wallet.recipient/address-paste nil})
|
||||
[{:keys [db]}]
|
||||
{:wallet.recipient/address-paste (get-in db [:wallet/recipient :inp-ref])})
|
||||
|
||||
(fx/defn set-recipient
|
||||
{:events [::recipient-address-resolved]}
|
||||
@@ -56,8 +77,7 @@
|
||||
:number-of-retries 3}))
|
||||
{:ui/show-error (i18n/label :t/wallet-invalid-address-checksum {:data recipient})
|
||||
:db (assoc-in db [:wallet/recipient :searching] false)}))
|
||||
(and (not (string/blank? recipient)) (not (string/starts-with? recipient "0x"))
|
||||
(ens/valid-eth-name-prefix? recipient))
|
||||
(and (not (string/blank? recipient)) (ens/valid-eth-name-prefix? recipient))
|
||||
(let [ens-name (if (= (.indexOf ^js recipient ".") -1)
|
||||
(stateofus/subdomain recipient)
|
||||
recipient)]
|
||||
@@ -92,6 +112,8 @@
|
||||
:name (or name "")}]
|
||||
(fx/merge cofx
|
||||
{:db (assoc-in db [:wallet/favourites address] new-favourite)
|
||||
;;android
|
||||
:dispatch-later [{:ms 1000 :dispatch [:wallet.recipient/focus-input]}]
|
||||
::json-rpc/call [{:method "wallet_addFavourite"
|
||||
:params [new-favourite]
|
||||
:on-success #()}]}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"_comment": "DO NOT EDIT THIS FILE BY HAND. USE 'scripts/update-status-go.sh <tag>' instead",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.62.11",
|
||||
"commit-sha1": "4ecca1169d2e0a07b4e0cf5a7a3f4044216c678f",
|
||||
"src-sha256": "189igps203m2yf3gcqjrghqnncf7vgl3p3bjcrk5dp2ym00jfr9f"
|
||||
"version": "v0.62.3.hotfix.1",
|
||||
"commit-sha1": "feaaed2f7687dc5bb0ca38921305a616a275b9a7
|
||||
feaaed2f7687dc5bb0ca38921305a616a275b9a7",
|
||||
"src-sha256": "000f5ykx9wwsk6lklzg2i46f0ms872kiidrz7lcnj5n6gr5yr8m2"
|
||||
}
|
||||
|
||||
@@ -32,19 +32,13 @@ class NetworkApi(object):
|
||||
return requests.request('GET', url=method, headers=self.headers).json()['result']
|
||||
except TypeError as e:
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
|
||||
def get_token_transactions(self, address: str) -> List[dict]:
|
||||
method = self.network_url + 'module=account&action=tokentx&address=0x%s&sort=desc&apikey=%s' % (address, self.api_key)
|
||||
try:
|
||||
return requests.request('GET', url=method, headers=self.headers).json()['result']
|
||||
except TypeError as e:
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % str(e))
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
self.log("Check response from etherscan API. Returned values do not match expected. %s" % e)
|
||||
|
||||
def is_transaction_successful(self, transaction_hash: str) -> int:
|
||||
method = self.network_url + 'module=transaction&action=getstatus&txhash=%s' % transaction_hash
|
||||
@@ -54,13 +48,10 @@ class NetworkApi(object):
|
||||
method = self.network_url + 'module=account&action=balance&address=0x%s&tag=latest&apikey=%s' % (address , self.api_key)
|
||||
for i in range(5):
|
||||
try:
|
||||
self.log('Trying to get balance for %s, attempt %s' % (address, i + 1))
|
||||
balance = requests.request('GET', method, headers=self.headers).json()["result"]
|
||||
self.log('Balance is %s Gwei' % balance)
|
||||
return int(balance)
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
return int(requests.request('GET', method, headers=self.headers).json()["result"])
|
||||
except ValueError:
|
||||
time.sleep(5)
|
||||
pass
|
||||
|
||||
def get_latest_block_number(self) -> int:
|
||||
method = self.network_url + 'module=proxy&action=eth_blockNumber'
|
||||
@@ -138,20 +129,10 @@ class NetworkApi(object):
|
||||
errors.append('Recipients balance is not updated on etherscan')
|
||||
|
||||
def faucet(self, address):
|
||||
try:
|
||||
self.log("Trying to get funds from %s" % self.faucet_url)
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_url, address)).json()
|
||||
|
||||
def faucet_backup(self, address):
|
||||
try:
|
||||
self.log("Trying to get funds from %s" % self.faucet_backup_url)
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_backup_url, address)).json()
|
||||
except JSONDecodeError as e:
|
||||
self.log(str(e))
|
||||
pass
|
||||
return requests.request('GET', '%s/0x%s' % (self.faucet_backup_url, address)).json()
|
||||
|
||||
def get_donate(self, address, external_faucet=True, wait_time=300):
|
||||
initial_balance = self.get_balance(address)
|
||||
|
||||
@@ -60,7 +60,6 @@ connection_is_secure_text = "Connection is secure. Make sure you really trust th
|
||||
"before signing transactions or entering personal data."
|
||||
recorded_error = "You have to give permission to send audio messages"
|
||||
|
||||
test_dapp_web_url = "status-im.github.io/dapp"
|
||||
test_dapp_url = 'simpledapp.eth'
|
||||
test_dapp_name = 'simpledapp.eth'
|
||||
|
||||
|
||||
@@ -450,7 +450,6 @@ class TestProfileSingleDevice(SingleDeviceTestCase):
|
||||
|
||||
@marks.critical
|
||||
@marks.testrail_id(5419)
|
||||
@marks.flaky
|
||||
def test_logcat_backup_recovery_phrase(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
sign_in_view.create_user()
|
||||
@@ -807,16 +806,15 @@ class TestProfileMultipleDevice(MultipleDeviceTestCase):
|
||||
profile_1.mail_server_address_input.clear()
|
||||
profile_1.mail_server_address_input.set_value(mailserver_address)
|
||||
profile_1.save_button.click()
|
||||
profile_1.mail_server_by_name(server_name).click()
|
||||
profile_1.mail_server_connect_button.click()
|
||||
profile_1.confirm_button.click()
|
||||
if profile_1.element_by_text_part("Error connecting").is_element_displayed(40):
|
||||
profile_1.retry_to_connect_to_mailserver()
|
||||
profile_1.get_back_to_home_view()
|
||||
profile_1.home_button.click()
|
||||
|
||||
# TODO: disabled due to 10065
|
||||
# profile_1.mail_server_by_name(server_name).click()
|
||||
# profile_1.mail_server_connect_button.click()
|
||||
# profile_1.confirm_button.click()
|
||||
# if profile_1.element_by_text_part("Error connecting").is_element_displayed(40):
|
||||
# profile_1.retry_to_connect_to_mailserver()
|
||||
# profile_1.get_back_to_home_view()
|
||||
# profile_1.home_button.click()
|
||||
|
||||
|
||||
# profile_1.just_fyi('start chat with user2 and check that all messages are delivered')
|
||||
# chat_1 = home_1.add_contact(public_key)
|
||||
# message = 'test message'
|
||||
|
||||
@@ -208,7 +208,6 @@ class TestWalletManagement(SingleDeviceTestCase):
|
||||
profile = home_view.profile_button.click()
|
||||
wallet_view = profile.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.scan_tokens()
|
||||
wallet_view.accounts_status_account.click()
|
||||
wallet_view.collectibles_button.click()
|
||||
if not wallet_view.element_by_text('KDO').is_element_displayed():
|
||||
|
||||
@@ -21,7 +21,7 @@ class TestCommandsMultipleDevices(MultipleDeviceTestCase):
|
||||
home_1, home_2 = device_1_sign_in.get_home_view(), device_2_sign_in.get_home_view()
|
||||
profile_2 = home_2.profile_button.click()
|
||||
device_2_username = profile_2.default_username_text.text
|
||||
profile_2.switch_network()
|
||||
profile_2.switch_network('Mainnet with upstream RPC')
|
||||
|
||||
chat_2 = home_2.add_contact(sender['public_key'])
|
||||
chat_2.send_message("Hey there!")
|
||||
|
||||
@@ -503,7 +503,7 @@ class TestGroupChatMultipleDevice(MultipleDeviceTestCase):
|
||||
device_1_chat.chat_message_input.click()
|
||||
for chat in device_1_chat, device_2_chat, device_3_chat:
|
||||
if not chat.play_pause_audio_message_button.is_element_displayed():
|
||||
self.errors.append('Audio message is not shown in chat after sending!')
|
||||
self.errors.append('Audio message is not shown in chat after sending for sender')
|
||||
|
||||
device_1.just_fyi('Send sticker to group chat and verify it on all devices')
|
||||
device_1_chat.profile_button.click()
|
||||
|
||||
@@ -2,6 +2,7 @@ from tests import marks, connection_not_secure_text, connection_is_secure_text,
|
||||
from tests.base_test_case import SingleDeviceTestCase
|
||||
from views.sign_in_view import SignInView
|
||||
from views.dapps_view import DappsView
|
||||
from time import sleep
|
||||
|
||||
|
||||
class TestBrowsing(SingleDeviceTestCase):
|
||||
@@ -72,19 +73,15 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||
def test_open_blocked_site(self):
|
||||
home_view = SignInView(self.driver).create_user()
|
||||
daap_view = home_view.dapp_tab_button.click()
|
||||
for url in ('metamask.site', 'https://www.cryptokitties.domainname'):
|
||||
dapp_detail = daap_view.open_url(url)
|
||||
dapp_detail.find_text_part('This site is blocked')
|
||||
if dapp_detail.browser_refresh_page_button.is_element_displayed():
|
||||
self.errors.append("Refresh button is present in blocked site")
|
||||
dapp_detail.go_back_button.click()
|
||||
daap_view.element_by_text("Browser").click()
|
||||
dapp_detail.continue_anyway_button.click()
|
||||
if dapp_detail.element_by_text('This site is blocked').is_element_displayed():
|
||||
self.errors.append("Failed to open Dapp after 'Continue anyway' tapped for %s" % url)
|
||||
daap_view.cross_icon.click()
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
dapp_detail = daap_view.open_url('https://www.cryptokitties.domainname')
|
||||
dapp_detail.find_text_part('This site is blocked')
|
||||
if dapp_detail.browser_refresh_page_button.is_element_displayed():
|
||||
self.driver.fail("Refresh button is present in blocked site")
|
||||
dapp_detail.go_back_button.click()
|
||||
daap_view.element_by_text("Browser").click()
|
||||
dapp_detail.continue_anyway_button.click()
|
||||
if not dapp_detail.element_by_text("Unable to load page").is_element_displayed():
|
||||
self.driver.fail("Failed to open Dapp after 'Continue anyway' tapped")
|
||||
|
||||
#TODO: waiting mode
|
||||
@marks.testrail_id(6300)
|
||||
@@ -157,7 +154,7 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||
home_view = sign_in.create_user()
|
||||
dapp_view = home_view.dapp_tab_button.click()
|
||||
browsing_view = dapp_view.open_url('google.com')
|
||||
browsing_view.back_button.click()
|
||||
browsing_view.cross_icon.click()
|
||||
dapp_view = DappsView(self.driver)
|
||||
browser_entry = dapp_view.remove_browser_entry_long_press('Google')
|
||||
home_view.relogin()
|
||||
@@ -166,7 +163,7 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||
self.errors.append('The browser entry is present after re-login')
|
||||
for entry in ('google.com', 'status.im'):
|
||||
browsing_view = dapp_view.open_url(entry)
|
||||
browsing_view.back_button.click()
|
||||
browsing_view.cross_icon.click()
|
||||
dapp_view.remove_browser_entry_long_press('status', clear_all=True)
|
||||
home_view.relogin()
|
||||
home_view.dapp_tab_button.click()
|
||||
@@ -205,15 +202,11 @@ class TestBrowsing(SingleDeviceTestCase):
|
||||
def test_refresh_button_browsing_app_webview(self):
|
||||
sign_in_view = SignInView(self.driver)
|
||||
home_view = sign_in_view.create_user()
|
||||
daap_view = home_view.dapp_tab_button.click()
|
||||
browsing_view = daap_view.open_url('app.uniswap.org')
|
||||
browsing_view.allow_button.click()
|
||||
browsing_view.find_full_text('Select a token').click()
|
||||
browsing_view.find_text_part("Token Name")
|
||||
browsing_view.browser_refresh_page_button.click()
|
||||
if browsing_view.element_by_text_part("Token Name").is_element_displayed():
|
||||
self.driver.fail("Page failed to be refreshed")
|
||||
|
||||
status_test_dapp = home_view.open_status_test_dapp()
|
||||
status_test_dapp.transactions_button.click()
|
||||
status_test_dapp.find_full_text('Sign message')
|
||||
status_test_dapp.browser_refresh_page_button.click()
|
||||
status_test_dapp.find_full_text('defaultAccount')
|
||||
|
||||
@marks.testrail_id(5456)
|
||||
@marks.medium
|
||||
|
||||
@@ -51,7 +51,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
sign_in_view.just_fyi('Go back to online and check that balance is updated')
|
||||
sign_in_view.toggle_airplane_mode()
|
||||
wallet_view.wait_balance_is_changed('ETH')
|
||||
wallet_view.scan_tokens('STT')
|
||||
wallet_view.wait_balance_is_changed('STT')
|
||||
|
||||
sign_in_view.just_fyi('Send some tokens to other account')
|
||||
recipient = "0x" + basic_user['address']
|
||||
|
||||
@@ -78,7 +78,7 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
sign_in_view.just_fyi('Go back to online and check that balance is updated')
|
||||
sign_in_view.toggle_airplane_mode()
|
||||
wallet_view.wait_balance_is_changed('ETH')
|
||||
wallet_view.scan_tokens('STT')
|
||||
wallet_view.wait_balance_is_changed('STT')
|
||||
|
||||
sign_in_view.just_fyi('Send some tokens to other account')
|
||||
recipient = "0x" + basic_user['address']
|
||||
@@ -479,91 +479,6 @@ class TestTransactionWalletSingleDevice(SingleDeviceTestCase):
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(6328)
|
||||
@marks.medium
|
||||
def test_send_transaction_set_recipient_options(self):
|
||||
sender = wallet_users['D']
|
||||
sign_in_view = SignInView(self.driver)
|
||||
sign_in_view.recover_access(sender['passphrase'])
|
||||
home_view = sign_in_view.get_home_view()
|
||||
nickname = 'my_some_nickname'
|
||||
account_name = 'my_acc_name'
|
||||
account_address = '0x8c2E3Cd844848E79cFd4671cE45C12F210b630d7'
|
||||
recent_add_to_fav_name = 'my_Recent_STT'
|
||||
recent_add_to_fav_address = '0xc039f82eceda458b63a0f327b7b0c20def5903d7'
|
||||
basic_add_to_fav_name = 'my_basic_address'
|
||||
|
||||
home_view.just_fyi('Add new account and new ENS contact for recipient')
|
||||
chat = home_view.add_contact(ens_user_ropsten['ens'])
|
||||
chat.chat_options.click()
|
||||
chat.view_profile_button.click_until_presence_of_element(chat.remove_from_contacts)
|
||||
chat.set_nickname(nickname)
|
||||
wallet_view = home_view.wallet_button.click()
|
||||
wallet_view.set_up_wallet()
|
||||
wallet_view.add_account(account_name=account_name)
|
||||
wallet_view.accounts_status_account.click()
|
||||
send_transaction = wallet_view.send_transaction_button.click()
|
||||
|
||||
send_transaction.just_fyi('Set one of my accounts')
|
||||
send_transaction.chose_recipient_button.click()
|
||||
send_transaction.element_by_text('My accounts').click()
|
||||
send_transaction.element_by_text(account_name).click()
|
||||
if send_transaction.enter_recipient_address_text.text != \
|
||||
send_transaction.get_formatted_recipient_address(account_address):
|
||||
self.errors.append('Added account is not resolved as recipient')
|
||||
|
||||
send_transaction.just_fyi('Set contact')
|
||||
send_transaction.chose_recipient_button.click()
|
||||
send_transaction.element_by_text('Contacts').scroll_and_click()
|
||||
send_transaction.element_by_text(nickname).scroll_and_click()
|
||||
send_transaction.recipient_done.click()
|
||||
if send_transaction.enter_recipient_address_text.text != \
|
||||
send_transaction.get_formatted_recipient_address(ens_user_ropsten['address']):
|
||||
self.errors.append('ENS from contact is not resolved as recipient')
|
||||
|
||||
send_transaction.just_fyi('Set contract address from recent and check smart contract error')
|
||||
send_transaction.chose_recipient_button.click()
|
||||
send_transaction.element_by_text('Recent').click()
|
||||
send_transaction.element_by_text('↑ 0 ETHro').click()
|
||||
if not send_transaction.element_by_text_part('is a smart contract').is_element_displayed():
|
||||
self.driver.fail('No warning is shown at attempt to set as recipient smart contract')
|
||||
send_transaction.ok_button.click()
|
||||
send_transaction.element_by_text('↑ 2 STT').scroll_and_click()
|
||||
send_transaction.add_to_favorites(recent_add_to_fav_name)
|
||||
wallet_view.element_by_text('Recent').click()
|
||||
|
||||
send_transaction.just_fyi('Scan code, add it to favorites and recheck that it is preserved')
|
||||
send_transaction.scan_qr_code_button.click()
|
||||
send_transaction.allow_button.click(1)
|
||||
wallet_view.enter_qr_edit_box.set_value(basic_user['address'])
|
||||
wallet_view.ok_button.click()
|
||||
send_transaction.add_to_favorites(basic_add_to_fav_name)
|
||||
send_transaction.element_by_text('Favourites').scroll_and_click()
|
||||
for name in (recent_add_to_fav_name, basic_add_to_fav_name):
|
||||
if not send_transaction.element_by_text(name).is_element_displayed():
|
||||
self.errors.append('%s was not added to Favourites' % name)
|
||||
send_transaction.element_by_text(recent_add_to_fav_name).click()
|
||||
if str(send_transaction.enter_recipient_address_text.text).lower() != \
|
||||
send_transaction.get_formatted_recipient_address(recent_add_to_fav_address):
|
||||
self.errors.append('Recent address that was added to favourites was not resolved correctly')
|
||||
|
||||
send_transaction.just_fyi('Check search and set address from search')
|
||||
send_transaction.chose_recipient_button.click()
|
||||
send_transaction.search_by_keyword(ens_user_ropsten['ens'][:2])
|
||||
if not send_transaction.element_by_text('@' + ens_user_ropsten['ens']).is_element_displayed():
|
||||
self.errors.append('ENS address from contacts is not shown in search')
|
||||
send_transaction.cancel_button.click()
|
||||
send_transaction.search_by_keyword('my')
|
||||
for name in (nickname, account_name, recent_add_to_fav_name, basic_add_to_fav_name):
|
||||
if not send_transaction.element_by_text(name).is_element_displayed():
|
||||
self.errors.append('%s is not shown in search when searching by namepart' % name)
|
||||
send_transaction.element_by_text(basic_add_to_fav_name).click()
|
||||
if send_transaction.enter_recipient_address_text.text!= send_transaction.get_formatted_recipient_address('0x' + basic_user['address']):
|
||||
self.errors.append('QR scanned address that was added to favourites was not resolved correctly')
|
||||
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
|
||||
@marks.testrail_id(5437)
|
||||
@marks.medium
|
||||
def test_validation_amount_errors(self):
|
||||
|
||||
@@ -59,7 +59,7 @@ class AbstractTestCase:
|
||||
desired_caps['build'] = pytest_config_global['build']
|
||||
desired_caps['name'] = test_suite_data.current_test.name
|
||||
desired_caps['platformName'] = 'Android'
|
||||
desired_caps['appiumVersion'] = '1.18.1'
|
||||
desired_caps['appiumVersion'] = '1.16.0'
|
||||
desired_caps['platformVersion'] = '10.0'
|
||||
desired_caps['deviceName'] = 'Android GoogleAPI Emulator'
|
||||
desired_caps['deviceOrientation'] = "portrait"
|
||||
|
||||
@@ -18,7 +18,6 @@ ens_user['address'] = '0x1eE3058Bd300246B4B20E687Efc9Eba81FF7814b'
|
||||
ens_user_ropsten = dict()
|
||||
ens_user_ropsten['ens'] = 'nastya'
|
||||
ens_user_ropsten['username'] = 'Thoughtful Stupendous Graywolf'
|
||||
ens_user_ropsten['address'] = '0x58d8c3D70ce4FA4b9fb10a665C8712238746F2ff'
|
||||
|
||||
dummy_user = dict()
|
||||
dummy_user['username'] = "Vain Wordy Hagfish"
|
||||
|
||||
@@ -125,10 +125,6 @@ class BaseElement(object):
|
||||
raise NoSuchElementException(
|
||||
"Device %s: '%s' is not found on the screen" % (self.driver.number, self.name)) from None
|
||||
|
||||
def scroll_and_click(self):
|
||||
self.scroll_to_element()
|
||||
self.click()
|
||||
|
||||
def is_element_present(self, sec=5):
|
||||
try:
|
||||
self.driver.info('Wait for %s' % self.name)
|
||||
|
||||
@@ -652,8 +652,6 @@ class BaseView(object):
|
||||
|
||||
def close_share_popup(self):
|
||||
TouchAction(self.driver).tap(None, 255, 104, 1).perform()
|
||||
time.sleep(3)
|
||||
|
||||
|
||||
def get_public_key_and_username(self, return_username=False):
|
||||
profile_view = self.profile_button.click()
|
||||
|
||||
@@ -127,7 +127,6 @@ class DappsView(BaseView):
|
||||
self.enter_url_editbox.click()
|
||||
self.enter_url_editbox.send_keys(url)
|
||||
self.confirm()
|
||||
self.progress_bar.wait_for_invisibility_of_element(50)
|
||||
return self.get_base_web_view()
|
||||
|
||||
def get_browser_entry(self, name):
|
||||
|
||||
@@ -244,9 +244,9 @@ class HomeView(BaseView):
|
||||
self.confirm_until_presence_of_element(chat_view.chat_message_input)
|
||||
return chat_view
|
||||
|
||||
def open_status_test_dapp(self, url=test_dapp_url, allow_all=True):
|
||||
def open_status_test_dapp(self, allow_all=True):
|
||||
dapp_view = self.dapp_tab_button.click()
|
||||
dapp_view.open_url(url)
|
||||
dapp_view.open_url(test_dapp_url)
|
||||
status_test_dapp = dapp_view.get_status_test_dapp_view()
|
||||
status_test_dapp.allow_button.wait_for_element(20)
|
||||
if allow_all:
|
||||
|
||||
@@ -573,7 +573,7 @@ class DeleteMyProfilePasswordInput(BaseEditBox):
|
||||
class DeleteProfileButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(DeleteProfileButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('delete-profile-confirm')
|
||||
self.locator = self.Locator.xpath_selector('(//*[@text="Delete profile"])[2]')
|
||||
|
||||
class UseMobileDataToggle(BaseButton):
|
||||
def __init__(self, driver):
|
||||
|
||||
@@ -69,10 +69,6 @@ class ChooseRecipientButton(BaseButton):
|
||||
super(ChooseRecipientButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('choose-recipient-button')
|
||||
|
||||
def click(self):
|
||||
self.click_until_presence_of_element(AccountsButton(self.driver))
|
||||
return self.navigate()
|
||||
|
||||
|
||||
class AccountsButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
@@ -200,39 +196,19 @@ class ValidationErrorOnSendTransaction(BaseButton):
|
||||
super(ValidationErrorOnSendTransaction, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector("//*[@text='%s']/../*[@content-desc='icon']" % field)
|
||||
|
||||
|
||||
class ValidationIconOnSendTransaction(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(ValidationIconOnSendTransaction, self).__init__(driver)
|
||||
self.locator = self.Locator.xpath_selector('//*[@content-desc="custom-gas-fee"]/../android.view.ViewGroup//*[@content-desc="icon"]')
|
||||
|
||||
|
||||
|
||||
class ShareButton(BaseButton):
|
||||
|
||||
def __init__(self, driver):
|
||||
super(ShareButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('share-address-button')
|
||||
|
||||
class RecipientAddToFavoritesButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(RecipientAddToFavoritesButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('participant-add-to-favs')
|
||||
|
||||
class RecipientDoneButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(RecipientDoneButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('participant-done')
|
||||
|
||||
|
||||
class NewFavoriteNameInput(BaseEditBox):
|
||||
def __init__(self, driver):
|
||||
super(NewFavoriteNameInput, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('fav-name')
|
||||
|
||||
|
||||
class NewFavoriteAddFavorite(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(NewFavoriteAddFavorite, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('add-fav')
|
||||
|
||||
class OnboardingMessage(BaseElement):
|
||||
def __init__(self, driver):
|
||||
@@ -359,12 +335,6 @@ class SendTransactionView(BaseView):
|
||||
self.select_button = SelectButton(self.driver)
|
||||
self.request_transaction_button = RequestTransactionButtonBottomSheet(self.driver)
|
||||
|
||||
# Elements on set recipient screen
|
||||
self.recipient_add_to_favorites = RecipientAddToFavoritesButton(self.driver)
|
||||
self.recipient_done = RecipientDoneButton(self.driver)
|
||||
self.new_favorite_name_input = NewFavoriteNameInput(self.driver)
|
||||
self.new_favorite_add_favorite = NewFavoriteAddFavorite(self.driver)
|
||||
|
||||
def complete_onboarding(self):
|
||||
if self.onboarding_message.is_element_displayed():
|
||||
from views.wallet_view import WalletView
|
||||
@@ -425,8 +395,3 @@ class SendTransactionView(BaseView):
|
||||
data['gas_price'] = self.gas_price_input.text
|
||||
self.cancel_button.click()
|
||||
return data
|
||||
|
||||
def add_to_favorites(self, name):
|
||||
self.recipient_add_to_favorites.click()
|
||||
self.new_favorite_name_input.set_value(name)
|
||||
self.new_favorite_add_favorite.click()
|
||||
@@ -262,7 +262,7 @@ class SignInView(BaseView):
|
||||
def create_user(self, password=common_password, keycard=False, enable_notifications=False):
|
||||
self.get_started_button.click()
|
||||
self.generate_key_button.click_until_presence_of_element(self.next_button)
|
||||
self.next_button.click_until_absense_of_element(self.element_by_text_part('Choose a chat name'))
|
||||
self.next_button.click()
|
||||
if keycard:
|
||||
keycard_flow = self.keycard_storage_button.click()
|
||||
keycard_flow.confirm_pin_and_proceed()
|
||||
|
||||
@@ -97,12 +97,6 @@ class ManageAssetsButton(BaseButton):
|
||||
self.locator = self.Locator.accessibility_id('wallet-manage-assets')
|
||||
|
||||
|
||||
class ScanTokensButton(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(ScanTokensButton, self).__init__(driver)
|
||||
self.locator = self.Locator.accessibility_id('wallet-scan-token')
|
||||
|
||||
|
||||
class STTCheckBox(BaseButton):
|
||||
def __init__(self, driver):
|
||||
super(STTCheckBox, self).__init__(driver)
|
||||
@@ -397,7 +391,6 @@ class WalletView(BaseView):
|
||||
self.send_request_button = SendRequestButton(self.driver)
|
||||
self.options_button = OptionsButton(self.driver)
|
||||
self.manage_assets_button = ManageAssetsButton(self.driver)
|
||||
self.scan_tokens_button = ScanTokensButton(self.driver)
|
||||
self.stt_check_box = STTCheckBox(self.driver)
|
||||
self.all_assets_full_names = AssetFullNameInAssets(self.driver)
|
||||
self.all_assets_symbols = AssetSymbolInAssets(self.driver)
|
||||
@@ -452,13 +445,11 @@ class WalletView(BaseView):
|
||||
def get_account_options_by_name(self, account_name='Status account'):
|
||||
return AccountOptionsButton(self.driver, account_name)
|
||||
|
||||
|
||||
def get_asset_amount_by_name(self, asset: str):
|
||||
asset_value = AssetText(self.driver, asset)
|
||||
asset_value.scroll_to_element()
|
||||
try:
|
||||
return float(asset_value.text.split()[0])
|
||||
except ValueError:
|
||||
return 0.0
|
||||
return float(asset_value.text.split()[0])
|
||||
|
||||
def verify_currency_balance(self, expected_rate: int, errors: list):
|
||||
usd = self.get_usd_total_value()
|
||||
@@ -479,9 +470,9 @@ class WalletView(BaseView):
|
||||
counter += 10
|
||||
time.sleep(10)
|
||||
self.swipe_down()
|
||||
self.driver.info('Waiting %s seconds for %s balance update to be equal to %s' % (counter,asset, expected_balance))
|
||||
self.driver.info('Waiting %s seconds for %s balance update' % (counter,asset))
|
||||
else:
|
||||
self.driver.info('Balance for %s is equal to %s' % (asset, expected_balance))
|
||||
self.driver.info('Transaction received, balance updated!')
|
||||
return
|
||||
|
||||
def wait_balance_is_changed(self, asset ='ETH', initial_balance=0, wait_time=300):
|
||||
@@ -537,26 +528,6 @@ class WalletView(BaseView):
|
||||
self.asset_checkbox_by_name(asset).click()
|
||||
self.cross_icon.click()
|
||||
|
||||
def scan_tokens(self, *args):
|
||||
self.multiaccount_more_options.click()
|
||||
self.scan_tokens_button.click()
|
||||
counter = 0
|
||||
if args:
|
||||
for asset in args:
|
||||
while True:
|
||||
if counter >= 20:
|
||||
self.driver.fail('Balance of %s is not changed during 20 seconds!' % asset)
|
||||
elif self.get_asset_amount_by_name(asset) == 0.0:
|
||||
self.multiaccount_more_options.click()
|
||||
self.scan_tokens_button.click()
|
||||
self.driver.info('Trying to scan for tokens one more time and waiting %s seconds for %s '
|
||||
'to update' % (counter, asset))
|
||||
time.sleep(5)
|
||||
counter += 5
|
||||
else:
|
||||
self.driver.info('Balance of %s is updated!' % asset)
|
||||
return self
|
||||
|
||||
def send_transaction(self, **kwargs):
|
||||
send_transaction_view = self.send_transaction_button.click()
|
||||
send_transaction_view.select_asset_button.click()
|
||||
|
||||
@@ -169,7 +169,6 @@
|
||||
"chat-settings": "إعدادات الدردشة",
|
||||
"chats": "دردشات",
|
||||
"check-on-etherscan": "إبحث في Etherscan ",
|
||||
"check-on-opensea": "تحقق في opensea",
|
||||
"check-your-recovery-phrase": "تحقق من العبارة الأولية الخاصة بك",
|
||||
"choose-authentication-method": "اختر طريقة المصادقة",
|
||||
"clear": "واضح",
|
||||
@@ -574,7 +573,6 @@
|
||||
"hide-content-when-switching-apps": "إخفاء معاينات الحالة عند تبديل التطبيق",
|
||||
"hide-content-when-switching-apps-ios": "إخفاء المعاينة",
|
||||
"history": "التاريخ",
|
||||
"history-nodes": "تاريخ العقد",
|
||||
"hold-card": "امسك البطاقة في الخلف \n من هاتفك",
|
||||
"home": "الصفحة الرئيسية",
|
||||
"hooks": "السنانير",
|
||||
@@ -751,7 +749,6 @@
|
||||
"mail-should-be-configured": "يجب تغيير البريد",
|
||||
"mailserver-address": "عنوان خادم البريد",
|
||||
"mailserver-automatic": "الاختيار التلقائي",
|
||||
"mailserver-automatic-switch-explanation": "اختر أسرع عقدة محفوظات متاحة",
|
||||
"mailserver-connection-error": "لا يمكن الاتصال بـ mailserver",
|
||||
"mailserver-content": "عقدة في شبكة Status تقوم بتوجيه الرسائل وتخزينها لمدة تصل إلى 30 يومًا.",
|
||||
"mailserver-details": "تفاصيل mailserver",
|
||||
@@ -883,9 +880,7 @@
|
||||
"off-status-tree": "خارج شجرة الحالة",
|
||||
"offline": "غير متصل على الانترنت",
|
||||
"offline-messaging": "Mailserver",
|
||||
"offline-messaging-settings": "تاريخ العقد",
|
||||
"offline-messaging-use-history-explanation": "قم بتمكين عُقد السجل لجلب الرسائل التي تم إرسالها أثناء إغلاق التطبيق. عند التمكين ، تحصل عقدة السجل على عنوان IP الخاص بك. عند التعطيل ، لن تتلقى رسائل عند إغلاق التطبيق ولن تراها عند فتح التطبيق لاحقًا.",
|
||||
"offline-messaging-use-history-nodes": "استخدم تاريخ العقد",
|
||||
"offline-messaging-settings": "إعدادات mailserver",
|
||||
"ok": "حسنا",
|
||||
"ok-continue": "حسنا ، تابع",
|
||||
"ok-got-it": "حسنا، حصلت عليه",
|
||||
@@ -1034,7 +1029,6 @@
|
||||
"save-password-unavailable-android": "حفظ كلمه المرور غير متوفر: قد يكون جهازك متجذرا أو يفتقر إلى ميزات الأمان الضرورية.",
|
||||
"scan-qr": "مسح رمز الاستجابة السريعة",
|
||||
"scan-qr-code": "مسح رمز الاستجابة السريعة مع عنوان المحفظة",
|
||||
"scan-tokens": "مسح العملات الرمزية",
|
||||
"search": "البحث",
|
||||
"search-no-chat-found": "لا توجد نتائج بحث. هل تعني",
|
||||
"secret-keys-confirmation-text": "ستحتاجهم إلى الاستمرار في استخدام Keycard في حالة فقدان هاتفك.",
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user