Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
2ada2d5
override paste in first text field on mnemonic restore form
julian-CStack Aug 26, 2022
7fa827c
hot reload init fix
julian-CStack Aug 26, 2022
647f1c6
comment out currently unneeded hive test init
julian-CStack Aug 26, 2022
56150fd
adjusted node info
Aug 26, 2022
53ecb19
WIP: firo tests
julian-CStack Aug 26, 2022
0de35c2
possible fix for monero syncing bug
Aug 27, 2022
795626a
UI bugfix for monero
Aug 28, 2022
63231c2
fully fix monero UI issues
Aug 28, 2022
517b4f8
Merge branch 'ui-testing' into staging
Aug 28, 2022
b3ebc99
build lelantus .so in workflow
Aug 28, 2022
2fde8e5
add codecov
Aug 28, 2022
0a0b14c
always run coverage upload
Aug 28, 2022
88d95eb
add coverage badge for main branch
Aug 28, 2022
3b95b08
only pull requests
Aug 28, 2022
249737f
Merge pull request #3 from cypherstack/workflows
msalazarm Aug 28, 2022
99669f1
Merge pull request #4 from cypherstack/main
msalazarm Aug 28, 2022
f82ef72
should deny
Aug 28, 2022
114da77
internal version bump
Aug 29, 2022
7bd2b6b
fixes firo but removes firo testnet
Aug 29, 2022
4075b94
add back firo send test
Aug 29, 2022
78581ff
add back tests on push
Aug 29, 2022
04fc595
Merge pull request #7 from cypherstack/firofix
msalazarm Aug 29, 2022
1aef4cd
possible firo tests threading fix
julian-CStack Aug 29, 2022
8e7357b
Update test.yaml
msalazarm Aug 29, 2022
fe34a0c
Merge pull request #8 from cypherstack/ui-testing
msalazarm Aug 29, 2022
7043ccc
ios fix
Aug 29, 2022
4a50e57
change build
Aug 29, 2022
3764494
Merge branch 'staging' into rylee-tmp
Aug 29, 2022
5a0c66f
Merge pull request #9 from cypherstack/rylee-tmp
ryleedavis Aug 29, 2022
ba576c0
exchange serialization bugfix and partial test coverage
julian-CStack Aug 29, 2022
6b534a4
possible workflow tests fix
julian-CStack Aug 29, 2022
11415d0
Merge pull request #10 from cypherstack/ui-testing
julian-CStack Aug 29, 2022
47bd246
fix firo double-or-int parse bug
julian-CStack Aug 29, 2022
c40f7c0
Merge pull request #11 from cypherstack/ui-testing
ryleedavis Aug 29, 2022
76daae9
change build
Aug 30, 2022
84d75f6
Merge pull request #12 from cypherstack/rylee-tmp
ryleedavis Aug 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#should deny
name: Test
on: [push, pull_request]
on: [pull_request]
jobs:
test:
runs-on: ubuntu-20.04
Expand All @@ -13,6 +14,10 @@ jobs:
uses: subosito/flutter-action@v2
- name: Checkout submodules
run: git submodule update --init --recursive
- name: Build Lelantus
run: |
cd crypto_plugins/flutter_liblelantus/scripts/linux/
./build_all.sh
- name: Get dependencies
run: flutter pub get
- name: Create temp files
Expand Down Expand Up @@ -58,7 +63,13 @@ jobs:
# - name: Analyze
# run: flutter analyze
- name: Test
run: flutter test
run: flutter test --coverage
- name: Upload to code coverage
uses: codecov/codecov-action@v1.2.2
if: success() || failure()
with:
token: ${{secrets.CODECOV_TOKEN}}
file: coverage/lcov.info
- name: Delete temp files
run: |
Remove-Item -Path $env:CHANGE_NOW;
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
[![codecov](https://codecov.io/gh/cypherstack/stack_wallet/branch/main/graph/badge.svg?token=PM1N56UTEW)](https://codecov.io/gh/cypherstack/stack_wallet)

# Stack Wallet
put details here

Expand All @@ -8,6 +10,7 @@ put features here

## Build and run
### Prerequisites
- Flutter 3.0.5
- Flutter SDK Requirement (>=2.12.0, up until <3.0.0)
- Android/iOS dev setup (Android Studio, xCode and subsequent dependencies)

Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ linter:
no_leading_underscores_for_local_identifiers: false
no_leading_underscores_for_library_prefixes: false
avoid_print: true
unawaited_futures: false
unawaited_futures: true
avoid_double_and_int_checks: false
constant_identifier_names: false
# avoid_print: false # Uncomment to disable the `avoid_print` rule
Expand Down
9 changes: 9 additions & 0 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ android {
ndk {
abiFilters "x86_64","armeabi-v7a", "arm64-v8a"
}

externalNativeBuild {
cmake {
arguments "-DANDROID_STL=c++_shared", '-DBUILD_TESTING=OFF', "-DANDROID_TOOLCHAIN=clang -v"
cppFlags "-frtti -fexceptions -v -DANDROID -std=c++17"
// cppFlags "-std=c++11"
version "3.10.2"
}
}
}

signingConfigs {
Expand Down
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -503,7 +503,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
);
MARKETING_VERSION = 1.4.30;
MARKETING_VERSION = 1.4.34;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down Expand Up @@ -633,7 +633,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -687,7 +687,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
);
MARKETING_VERSION = 1.4.30;
MARKETING_VERSION = 1.4.34;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -709,7 +709,7 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 37;
CURRENT_PROJECT_VERSION = 42;
DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand Down Expand Up @@ -763,7 +763,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
);
MARKETING_VERSION = 1.4.30;
MARKETING_VERSION = 1.4.34;
ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand Down
7 changes: 7 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,14 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>

late final Completer<void> loadingCompleter;

bool didLoad = false;

Future<void> load() async {
if (didLoad) {
return;
}
didLoad = true;

await DB.instance.init();

_notificationsService = ref.read(notificationsProvider);
Expand Down
11 changes: 2 additions & 9 deletions lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import 'dart:io';

import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart';
Expand All @@ -15,15 +13,10 @@ class AddWalletView extends StatelessWidget {

static const routeName = "/addWallet";

final _coins = Coin.values;

@override
Widget build(BuildContext context) {
List<Coin> coins = _coins;
if (Platform.isIOS) {
coins = _coins;
}
debugPrint("BUILD: $runtimeType");
List<Coin> coins = [...Coin.values];
coins.remove(Coin.firoTestNet);
return Scaffold(
appBar: AppBar(
leading: AppBarBackButton(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:async';
import 'dart:collection';
import 'dart:math';
import 'dart:io';
import 'dart:math';

import 'package:bip39/bip39.dart' as bip39;
import 'package:bip39/src/wordlists/english.dart' as bip39wordlist;
Expand All @@ -26,6 +26,7 @@ import 'package:stackwallet/utilities/barcode_scanner_interface.dart';
import 'package:stackwallet/utilities/cfcolors.dart';
import 'package:stackwallet/utilities/clipboard_interface.dart';
import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/custom_text_selection_controls.dart';
import 'package:stackwallet/utilities/default_nodes.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
Expand Down Expand Up @@ -70,25 +71,61 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
final ScrollController controller = ScrollController();

final List<TextEditingController> _controllers = [];
// late final TextEditingController _heightController;
final List<FormInputStatus> _inputStatuses = [];

// late final FocusNode _heightFocusNode;

late final BarcodeScannerInterface scanner;

late final TextSelectionControls textSelectionControls;

Future<void> onControlsPaste(TextSelectionDelegate delegate) async {
final data = await widget.clipboard.getData(Clipboard.kTextPlain);
if (data?.text == null) {
return;
}

final text = data!.text!.trim();
if (text.isEmpty || _controllers.isEmpty) {
delegate.pasteText(SelectionChangedCause.toolbar);
return;
}

final words = text.split(" ");
if (words.isEmpty) {
delegate.pasteText(SelectionChangedCause.toolbar);
return;
}

if (words.length == 1) {
_controllers.first.text = words.first;
if (_isValidMnemonicWord(words.first.toLowerCase())) {
setState(() {
_inputStatuses.first = FormInputStatus.valid;
});
} else {
setState(() {
_inputStatuses.first = FormInputStatus.invalid;
});
}
return;
}

_clearAndPopulateMnemonic(words);
}

@override
void initState() {
_seedWordCount = widget.seedWordsLength;

// _heightFocusNode = FocusNode();
textSelectionControls = Platform.isIOS
? CustomCupertinoTextSelectionControls(onPaste: onControlsPaste)
: CustomMaterialTextSelectionControls(onPaste: onControlsPaste);

scanner = widget.barcodeScanner;
for (int i = 0; i < _seedWordCount; i++) {
_controllers.add(TextEditingController());
_inputStatuses.add(FormInputStatus.empty);
}
// _heightController = TextEditingController();

super.initState();
}

Expand All @@ -97,8 +134,7 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
for (var element in _controllers) {
element.dispose();
}
// _heightController.dispose();
// _heightFocusNode.dispose();

super.dispose();
}

Expand Down Expand Up @@ -404,6 +440,9 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
_inputStatuses[i] = FormInputStatus.empty;
});
}

controller.animateTo(controller.position.maxScrollExtent,
duration: const Duration(milliseconds: 300), curve: Curves.decelerate);
}

@override
Expand Down Expand Up @@ -442,18 +481,8 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
),
onPressed: () async {
try {
// ref
// .read(shouldShowLockscreenOnResumeStateProvider.state)
// .state = false;
final qrResult = await scanner.scan();

// Future<void>.delayed(
// const Duration(seconds: 2),
// () => ref
// .read(shouldShowLockscreenOnResumeStateProvider.state)
// .state = true,
// );

final results =
AddressUtils.decodeQRSeedData(qrResult.rawContent);

Expand All @@ -474,9 +503,6 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
}
}
} on PlatformException catch (e) {
// ref
// .read(shouldShowLockscreenOnResumeStateProvider.state)
// .state = true;
// likely failed to get camera permissions
Logging.instance.log("Restore wallet qr scan failed: $e",
level: LogLevel.Warning);
Expand Down Expand Up @@ -512,9 +538,6 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
final content = data.text!.trim();
final list = content.split(" ");
_clearAndPopulateMnemonic(list);
controller.animateTo(controller.position.maxScrollExtent,
duration: const Duration(milliseconds: 300),
curve: Curves.decelerate);
}
},
),
Expand Down Expand Up @@ -572,6 +595,8 @@ class _RestoreWalletViewState extends ConsumerState<RestoreWalletView> {
_inputStatuses[i - 1], "$i"),
autovalidateMode:
AutovalidateMode.onUserInteraction,
selectionControls:
i == 1 ? textSelectionControls : null,
onChanged: (value) {
if (value.isEmpty) {
setState(() {
Expand Down
4 changes: 3 additions & 1 deletion lib/pages/address_book_views/address_book_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ class _AddressBookViewState extends ConsumerState<AddressBookView> {
ref.refresh(addressBookFilterProvider);

if (widget.coin == null) {
final coins = Coin.values.where((e) => !(e == Coin.epicCash)).toList();
List<Coin> coins =
Coin.values.where((e) => !(e == Coin.epicCash)).toList();
coins.remove(Coin.firoTestNet);

bool showTestNet = ref.read(prefsChangeNotifierProvider).showTestNetCoins;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ class _AddressBookFilterViewState extends ConsumerState<AddressBookFilterView> {

@override
void initState() {
final coins = Coin.values;
List<Coin> coins = [...Coin.values];
coins.remove(Coin.firoTestNet);

bool showTestNet = ref.read(prefsChangeNotifierProvider).showTestNetCoins;

Expand Down
8 changes: 5 additions & 3 deletions lib/pages/address_book_views/subviews/coin_select_sheet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class CoinSelectSheet extends StatelessWidget {
@override
Widget build(BuildContext context) {
final maxHeight = MediaQuery.of(context).size.height * 0.60;
var coins_ = [...Coin.values];
coins_.remove(Coin.firoTestNet);
return Container(
decoration: const BoxDecoration(
color: CFColors.white,
Expand Down Expand Up @@ -68,10 +70,10 @@ class CoinSelectSheet extends StatelessWidget {
return ListView.builder(
shrinkWrap: true,
itemCount: showTestNet
? Coin.values.length
: Coin.values.length - kTestNetCoinCount,
? coins_.length
: coins_.length - kTestNetCoinCount,
itemBuilder: (builderContext, index) {
final coin = Coin.values[index];
final coin = coins_[index];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 4),
child: RawMaterialButton(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@ class ManageNodesView extends ConsumerStatefulWidget {
}

class _ManageNodesViewState extends ConsumerState<ManageNodesView> {
List<Coin> _coins = Coin.values;
List<Coin> _coins = [...Coin.values];

@override
void initState() {
_coins = _coins.toList();
_coins.remove(Coin.firoTestNet);
super.initState();
}

Expand Down
Loading