From 795fde2cc1c7d2a292de559e42c53150d284c54c Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Jan 2024 15:34:55 -0600 Subject: [PATCH 1/2] QoL script fixes --- scripts/android/build_all.sh | 2 +- scripts/android/install_ndk.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/android/build_all.sh b/scripts/android/build_all.sh index 7f448c508..b67cd92a4 100755 --- a/scripts/android/build_all.sh +++ b/scripts/android/build_all.sh @@ -6,7 +6,7 @@ set -e source ../rust_version.sh set_rust_to_1671 -mkdir build +mkdir -p build . ./config.sh ./install_ndk.sh diff --git a/scripts/android/install_ndk.sh b/scripts/android/install_ndk.sh index 7541c1fcd..c36651516 100755 --- a/scripts/android/install_ndk.sh +++ b/scripts/android/install_ndk.sh @@ -1,6 +1,6 @@ #!/bin/sh -mkdir build +mkdir -p build . ./config.sh TOOLCHAIN_DIR=${WORKDIR}/toolchain ANDROID_NDK_SHA256="8381c440fe61fcbb01e209211ac01b519cd6adf51ab1c2281d5daad6ca4c8c8c" From 2c62bbe9afe85eebc45c6edf60dbe0c75ef50e1d Mon Sep 17 00:00:00 2001 From: julian Date: Fri, 19 Jan 2024 15:35:46 -0600 Subject: [PATCH 2/2] set lelantusCoinIsarRescanRequired to false for new/restored from seed wallets --- ...w_wallet_recovery_phrase_warning_view.dart | 55 ++++++++++++++++--- .../restore_wallet_view.dart | 6 ++ 2 files changed, 53 insertions(+), 8 deletions(-) diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart index 23ce0b1a5..9a1303978 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_warning_view/new_wallet_recovery_phrase_warning_view.dart @@ -457,18 +457,57 @@ class _NewWalletRecoveryPhraseWarningViewState ); }, )); + String? otherDataJsonString; + if (widget.coin == Coin.tezos) { + otherDataJsonString = jsonEncode({ + WalletInfoKeys.tezosDerivationPath: + Tezos.standardDerivationPath.value, + }); + // }//todo: probably not needed (broken anyways) + // else if (widget.coin == Coin.epicCash) { + // final int secondsSinceEpoch = + // DateTime.now().millisecondsSinceEpoch ~/ 1000; + // const int epicCashFirstBlock = 1565370278; + // const double overestimateSecondsPerBlock = 61; + // int chosenSeconds = secondsSinceEpoch - epicCashFirstBlock; + // int approximateHeight = chosenSeconds ~/ overestimateSecondsPerBlock; + // / + // // debugPrint( + // // "approximate height: $approximateHeight chosen_seconds: $chosenSeconds"); + // height = approximateHeight; + // if (height < 0) { + // height = 0; + // } + // + // otherDataJsonString = jsonEncode( + // { + // WalletInfoKeys.epiccashData: jsonEncode( + // ExtraEpiccashWalletInfo( + // receivingIndex: 0, + // changeIndex: 0, + // slatesToAddresses: {}, + // slatesToCommits: {}, + // lastScannedBlock: epicCashFirstBlock, + // restoreHeight: height, + // creationHeight: height, + // ).toMap(), + // ), + // }, + // ); + } else if (widget.coin == Coin.firo) { + otherDataJsonString = jsonEncode( + { + WalletInfoKeys + .lelantusCoinIsarRescanRequired: + false, + }, + ); + } final info = WalletInfo.createNew( coin: widget.coin, name: widget.walletName, - otherDataJsonString: coin == Coin.tezos - ? jsonEncode({ - WalletInfoKeys - .tezosDerivationPath: - Tezos.standardDerivationPath - .value, - }) - : null, + otherDataJsonString: otherDataJsonString, ); var node = ref diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index f03a284fd..b88078780 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -250,6 +250,12 @@ class _RestoreWalletViewState extends ConsumerState { ), }, ); + } else if (widget.coin == Coin.firo) { + otherDataJsonString = jsonEncode( + { + WalletInfoKeys.lelantusCoinIsarRescanRequired: false, + }, + ); } // TODO: do actual check to make sure it is a valid mnemonic for monero