Skip to content

Commit

Permalink
Merged main into ltc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mkyq committed May 7, 2021
2 parents 1330966 + d23228a commit 35a76cd
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 26 deletions.
14 changes: 10 additions & 4 deletions cw_monero/lib/account_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:cw_monero/types.dart';
import 'package:cw_monero/monero_api.dart';
import 'package:cw_monero/structs/account_row.dart';
import 'package:flutter/foundation.dart';
import 'package:cw_monero/wallet.dart';

final accountSizeNative = moneroApi
.lookup<NativeFunction<account_size>>('account_size')
Expand Down Expand Up @@ -70,8 +71,13 @@ void _setLabelForAccount(Map<String, dynamic> args) {
setLabelForAccountSync(label: label, accountIndex: accountIndex);
}

Future<void> addAccount({String label}) async => compute(_addAccount, label);
Future<void> addAccount({String label}) async {
await compute(_addAccount, label);
await store();
}

Future<void> setLabelForAccount({int accountIndex, String label}) async =>
compute(
_setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
Future<void> setLabelForAccount({int accountIndex, String label}) async {
await compute(
_setLabelForAccount, {'accountIndex': accountIndex, 'label': label});
await store();
}
21 changes: 13 additions & 8 deletions cw_monero/lib/subaddress_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:cw_monero/signatures.dart';
import 'package:cw_monero/types.dart';
import 'package:cw_monero/monero_api.dart';
import 'package:cw_monero/structs/subaddress_row.dart';
import 'package:cw_monero/wallet.dart';

final subaddressSizeNative = moneroApi
.lookup<NativeFunction<subaddrress_size>>('subaddrress_size')
Expand Down Expand Up @@ -79,14 +80,18 @@ void _setLabelForSubaddress(Map<String, dynamic> args) {
accountIndex: accountIndex, addressIndex: addressIndex, label: label);
}

Future addSubaddress({int accountIndex, String label}) async =>
compute<Map<String, Object>, void>(
Future addSubaddress({int accountIndex, String label}) async {
await compute<Map<String, Object>, void>(
_addSubaddress, {'accountIndex': accountIndex, 'label': label});
await store();
}

Future setLabelForSubaddress(
{int accountIndex, int addressIndex, String label}) =>
compute<Map<String, Object>, void>(_setLabelForSubaddress, {
'accountIndex': accountIndex,
'addressIndex': addressIndex,
'label': label
});
{int accountIndex, int addressIndex, String label}) async {
await compute<Map<String, Object>, void>(_setLabelForSubaddress, {
'accountIndex': accountIndex,
'addressIndex': addressIndex,
'label': label
});
await store();
}
12 changes: 6 additions & 6 deletions ios/Runner.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -375,7 +375,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.1.4;
MARKETING_VERSION = 4.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down Expand Up @@ -501,7 +501,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -518,7 +518,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.1.4;
MARKETING_VERSION = 4.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand All @@ -536,7 +536,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements;
CURRENT_PROJECT_VERSION = 33;
CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = 32J6BB6VUS;
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
Expand All @@ -553,7 +553,7 @@
"$(inherited)",
"$(PROJECT_DIR)/Flutter",
);
MARKETING_VERSION = 4.1.4;
MARKETING_VERSION = 4.1.6;
PRODUCT_BUNDLE_IDENTIFIER = com.fotolockr.cakewallet;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
Expand Down
5 changes: 5 additions & 0 deletions ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>NSCameraUsageDescription</key>
<string>Used for scan QR code</string>
<key>NSDocumentsFolderUsageDescription</key>
Expand Down
2 changes: 1 addition & 1 deletion lib/bitcoin/bitcoin_transaction_priority.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class BitcoinTransactionPriority extends TransactionPriority {

switch (this) {
case BitcoinTransactionPriority.slow:
label = S.current.transaction_priority_slow;
label = '${S.current.transaction_priority_slow} ~24hrs';
break;
case BitcoinTransactionPriority.medium:
label = S.current.transaction_priority_medium;
Expand Down
5 changes: 2 additions & 3 deletions lib/bitcoin/electrum.dart
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class ElectrumClient {
try {
final topDoubleString = await estimatefee(p: 1);
final middleDoubleString = await estimatefee(p: 20);
final bottomDoubleString = await estimatefee(p: 150);
final bottomDoubleString = await estimatefee(p: 100);
final top =
(stringDoubleToBitcoinAmount(topDoubleString.toString()) / 1000)
.round();
Expand All @@ -319,8 +319,7 @@ class ElectrumClient {
(stringDoubleToBitcoinAmount(bottomDoubleString.toString()) / 1000)
.round();

final res = [bottom, middle, top];
return res;
return [bottom, middle, top];
} catch (_) {
return [];
}
Expand Down
2 changes: 0 additions & 2 deletions lib/monero/monero_wallet.dart
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,8 @@ abstract class MoneroWalletBase extends WalletBase<MoneroBalance,

Future<void> init() async {
accountList.update();
accountList.accounts.observe((_) async => await save());
account = accountList.accounts.first;
subaddressList.update(accountIndex: account.id ?? 0);
subaddressList.subaddresses.observe((_) async => await save());
subaddress = subaddressList.getAll().first;
balance = MoneroBalance(
fullBalance: monero_wallet.getFullBalance(accountIndex: account.id),
Expand Down
3 changes: 1 addition & 2 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ description: Cake Wallet.
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 4.1.4+43
publish_to: none
version: 4.1.6+45

environment:
sdk: ">=2.7.0 <3.0.0"
Expand Down

0 comments on commit 35a76cd

Please sign in to comment.