Skip to content

Commit 7f09929

Browse files
authored
Merge branch 'develop' into 21233-missing-community-stats
2 parents 9376f9b + 070869b commit 7f09929

File tree

23 files changed

+561
-417
lines changed

23 files changed

+561
-417
lines changed

modules/react-native-status/android/src/main/java/im/status/ethereum/module/LogManager.kt

+10
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
3535
return File(pubDirectory, gethLogFileName)
3636
}
3737

38+
private fun getPreLoginLogFile(): File {
39+
val pubDirectory = utils.getPublicStorageDirectory()
40+
return File(pubDirectory, preLoginLogFileName)
41+
}
42+
3843
fun prepareLogsFile(context: Context): File? {
3944
val logFile = getGethLogFile()
4045

@@ -156,6 +161,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
156161
val statusLogFile = File(logsTempDir, statusLogFileName)
157162
val gethLogFile = getGethLogFile()
158163
val requestLogFile = getRequestLogFile()
164+
val preLoginLogFile = getPreLoginLogFile()
159165

160166
try {
161167
if (zipFile.exists() || zipFile.createNewFile()) {
@@ -175,6 +181,9 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
175181
if (requestLogFile.exists()) {
176182
filesToZip.add(requestLogFile)
177183
}
184+
if (preLoginLogFile.exists()) {
185+
filesToZip.add(preLoginLogFile)
186+
}
178187
val zipped = zip(filesToZip.toTypedArray(), zipFile, errorList)
179188
if (zipped && zipFile.exists()) {
180189
zipFile.setReadable(true, false)
@@ -205,6 +214,7 @@ class LogManager(private val reactContext: ReactApplicationContext) : ReactConte
205214
private const val gethLogFileName = "geth.log"
206215
private const val statusLogFileName = "Status.log"
207216
private const val requestsLogFileName = "api.log"
217+
private const val preLoginLogFileName = "pre_login.log"
208218
private const val logsZipFileName = "Status-debug-logs.zip"
209219
}
210220
}

modules/react-native-status/ios/RCTStatus/LogManager.m

+5
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ @implementation LogManager
3535

3636
NSURL *mainGethLogsFile = [rootUrl URLByAppendingPathComponent:@"geth.log"];
3737
NSURL *mainLogsFile = [logsFolderName URLByAppendingPathComponent:@"geth.log"];
38+
NSURL *preLoginLogFile = [rootUrl URLByAppendingPathComponent:@"pre_login.log"];
3839

3940
NSURL *requestsLogFile = [rootUrl URLByAppendingPathComponent:@"api.log"];
4041

@@ -46,6 +47,10 @@ @implementation LogManager
4647
if ([fileManager fileExistsAtPath:requestsLogFile.path]) {
4748
[fileManager copyItemAtPath:requestsLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"api.log"].path error:nil];
4849
}
50+
51+
if ([fileManager fileExistsAtPath:preLoginLogFile.path]) {
52+
[fileManager copyItemAtPath:preLoginLogFile.path toPath:[logsFolderName URLByAppendingPathComponent:@"pre_login.log"].path error:nil];
53+
}
4954

5055
[SSZipArchive createZipFileAtPath:zipFile.path withContentsOfDirectory:logsFolderName.path];
5156
[fileManager removeItemAtPath:logsFolderName.path error:nil];

nix/deps/gradle/deps_hack.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ readonly FOOJAY_FALLBACK="0.5.0"
66
readonly KOTLIN_FALLBACK="1.8.0"
77
readonly TOOLS_FALLBACK="3.5.4"
88
readonly HERMES_FALLBACK="0.73.5"
9+
readonly GRADLE_LINT_FALLBACK="31.1.1"
910

1011
GIT_ROOT=$(cd "${BASH_SOURCE%/*}" && git rev-parse --show-toplevel)
1112
cd "${GIT_ROOT}"
@@ -25,16 +26,28 @@ get_version() {
2526
echo "$version"
2627
}
2728

29+
# https://github.com/googlesamples/android-custom-lint-rules/blob/be672cd747ecf13844918e1afccadb935f856a72/docs/api-guide/example.md.html#L112-L129
30+
get_gradle_lint_version() {
31+
gradlePluginVersion=$(get_version "./nix/pkgs/aapt2/default.nix" "version =" $GRADLE_LINT_FALLBACK)
32+
major=$(echo "$gradlePluginVersion" | grep -o "^[0-9]*")
33+
# lintVersion = gradlePluginVersion + 23.0.0
34+
major=$((major + 23))
35+
minor=$(echo "$gradlePluginVersion" | grep -o "\.[0-9]*\." | grep -o "[0-9]*")
36+
patch=$(echo "$gradlePluginVersion" | grep -o "[0-9]*$")
37+
38+
echo "$major.$minor.$patch"
39+
}
40+
2841
foojay_version=$(get_version "./node_modules/@react-native/gradle-plugin/settings.gradle.kts" "foojay.*version" "$FOOJAY_FALLBACK")
2942
kotlin_version=$(get_version "./node_modules/@react-native/gradle-plugin/gradle/libs.versions.toml" "kotlin =" "$KOTLIN_FALLBACK")
3043
tools_version=$(get_version "./patches/BlurView-build.gradle.patch" "gradle:" "$TOOLS_FALLBACK")
3144
hermes_version=$(get_version "./node_modules/react-native/ReactAndroid/gradle.properties" "VERSION_NAME" "$HERMES_FALLBACK")
32-
45+
lint_version=$(get_gradle_lint_version)
3346

3447
cat << EOF
3548
org.gradle.toolchains.foojay-resolver-convention:org.gradle.toolchains.foojay-resolver-convention.gradle.plugin:$foojay_version
3649
org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:$kotlin_version
3750
com.android.tools.build:gradle:$tools_version
3851
com.facebook.react:hermes-android:$hermes_version
39-
com.android.tools.lint:lint-gradle:31.1.1
52+
com.android.tools.lint:lint-gradle:$lint_version
4053
EOF

nix/pkgs/aapt2/default.nix

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ let
1010

1111
pname = "aapt2";
1212
# Warning: This must be the same as gradlePluginVersion android/gradle.properties
13+
# also referenced in nix/deps/gradle/deps_hack.sh
1314
version = "8.1.1-10154469";
1415

1516
pkgPath = "com/android/tools/build/aapt2";

src/status_im/constants.cljs

+3
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,10 @@
443443
(def ^:const wallet-account-name-max-length 20)
444444

445445

446+
(def ^:const gas-rate-low 0)
446447
(def ^:const gas-rate-medium 1)
448+
(def ^:const gas-rate-high 2)
449+
(def ^:const gas-rate-custom 3)
447450
(def ^:const send-type-transfer 0)
448451
(def ^:const send-type-bridge 5)
449452
(def ^:const send-type-erc-721-transfer 6)

src/status_im/contexts/wallet/data_store.cljs

+32-28
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
[clojure.string :as string]
66
[status-im.constants :as constants]
77
[status-im.contexts.wallet.collectible.utils :as collectible-utils]
8+
[status-im.contexts.wallet.send.transaction-settings.core :as transaction-settings]
89
[status-im.contexts.wallet.send.utils :as send-utils]
910
[utils.collection :as utils.collection]
1011
[utils.money :as money]
@@ -229,7 +230,8 @@
229230

230231
(defn new->old-route-path
231232
[new-path]
232-
(let [to-bignumber (fn [k] (-> new-path k money/bignumber))]
233+
(let [to-bignumber (fn [k] (-> new-path k money/bignumber))
234+
suggested-levels-for-max-fees-per-gas (:suggested-levels-for-max-fees-per-gas new-path)]
233235
{:approval-fee (to-bignumber :approval-fee)
234236
:approval-l-1-fee (to-bignumber :approval-l-1-fee)
235237
:bonder-fees (to-bignumber :tx-bonder-fees)
@@ -238,35 +240,34 @@
238240
:amount-in-locked (:amount-in-locked new-path)
239241
:amount-in (:amount-in new-path)
240242
:max-amount-in (:max-amount-in new-path)
241-
:gas-fees {:gas-price "0"
242-
:base-fee (send-utils/convert-to-gwei (:tx-base-fee
243-
new-path)
244-
precision)
243+
:gas-fees {:gas-price "0"
244+
:base-fee (send-utils/convert-to-gwei (:tx-base-fee
245+
new-path)
246+
precision)
245247
:max-priority-fee-per-gas (send-utils/convert-to-gwei (:tx-priority-fee
246248
new-path)
247249
precision)
248-
:max-fee-per-gas-low (send-utils/convert-to-gwei
249-
(get-in
250-
new-path
251-
[:suggested-levels-for-max-fees-per-gas
252-
:low])
253-
precision)
254-
:max-fee-per-gas-medium (send-utils/convert-to-gwei
255-
(get-in
256-
new-path
257-
[:suggested-levels-for-max-fees-per-gas
258-
:medium])
259-
precision)
260-
:max-fee-per-gas-high (send-utils/convert-to-gwei
261-
(get-in
262-
new-path
263-
[:suggested-levels-for-max-fees-per-gas
264-
:high])
265-
precision)
266-
:l-1-gas-fee (send-utils/convert-to-gwei (:tx-l-1-fee
267-
new-path)
268-
precision)
269-
:eip-1559-enabled true}
250+
:l-1-gas-fee (send-utils/convert-to-gwei (:tx-l-1-fee
251+
new-path)
252+
precision)
253+
:eip-1559-enabled true
254+
:tx-max-fees-per-gas (send-utils/convert-to-gwei
255+
(:tx-max-fees-per-gas
256+
new-path)
257+
precision)
258+
:suggested-gas-fees-for-setting
259+
{:tx-fee-mode/normal (send-utils/convert-to-gwei
260+
(:low
261+
suggested-levels-for-max-fees-per-gas)
262+
precision)
263+
:tx-fee-mode/fast (send-utils/convert-to-gwei
264+
(:medium
265+
suggested-levels-for-max-fees-per-gas)
266+
precision)
267+
:tx-fee-mode/urgent (send-utils/convert-to-gwei
268+
(:high
269+
suggested-levels-for-max-fees-per-gas)
270+
precision)}}
270271
:bridge-name (:processor-name new-path)
271272
:amount-out (:amount-out new-path)
272273
:approval-contract-address (:approval-contract-address new-path)
@@ -275,7 +276,10 @@
275276
:to (:to-chain new-path)
276277
:approval-amount-required (:approval-amount-required new-path)
277278
;; :cost () ;; tbd not used on desktop
278-
:gas-amount (:tx-gas-amount new-path)}))
279+
:gas-amount (:tx-gas-amount new-path)
280+
:router-input-params-uuid (:router-input-params-uuid new-path)
281+
:tx-fee-mode (transaction-settings/gas-rate->tx-fee-mode (:tx-gas-fee-mode
282+
new-path))}))
279283

280284
(defn tokens-never-loaded?
281285
[db]

0 commit comments

Comments
 (0)