mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 20:09:23 +00:00
do int.parse inside scanOutputs, add import for badHttpAddress
This commit is contained in:
parent
410e0fbb1e
commit
848d45ad72
3 changed files with 25 additions and 26 deletions
|
@ -26,7 +26,6 @@ import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub
|
|||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart';
|
||||
import 'package:stackwallet/route_generator.dart';
|
||||
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
|
||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||
import 'package:stackwallet/services/mixins/paynym_wallet_interface.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.dart';
|
||||
|
@ -37,6 +36,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
|||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/wallets/example/libepiccash.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -89,11 +89,9 @@ class _ConfirmTransactionViewState
|
|||
late final FocusNode _noteFocusNode;
|
||||
late final TextEditingController noteController;
|
||||
|
||||
|
||||
late final FocusNode _onChainNoteFocusNode;
|
||||
late final TextEditingController onChainNoteController;
|
||||
|
||||
|
||||
Future<void> _attemptSend(BuildContext context) async {
|
||||
final manager =
|
||||
ref.read(walletsChangeNotifierProvider).getManager(walletId);
|
||||
|
@ -283,7 +281,8 @@ class _ConfirmTransactionViewState
|
|||
|
||||
_onChainNoteFocusNode = FocusNode();
|
||||
onChainNoteController = TextEditingController();
|
||||
onChainNoteController.text = transactionInfo["onChainNote"] as String? ?? "";
|
||||
onChainNoteController.text =
|
||||
transactionInfo["onChainNote"] as String? ?? "";
|
||||
|
||||
super.initState();
|
||||
}
|
||||
|
@ -885,8 +884,7 @@ class _ConfirmTransactionViewState
|
|||
).copyWith(
|
||||
suffixIcon: onChainNoteController.text.isNotEmpty
|
||||
? Padding(
|
||||
padding:
|
||||
const EdgeInsets.only(right: 0),
|
||||
padding: const EdgeInsets.only(right: 0),
|
||||
child: UnconstrainedBox(
|
||||
child: Row(
|
||||
children: [
|
||||
|
@ -911,7 +909,8 @@ class _ConfirmTransactionViewState
|
|||
height: 12,
|
||||
),
|
||||
Text(
|
||||
(coin == Coin.epicCash) ? "Local Note (optional)"
|
||||
(coin == Coin.epicCash)
|
||||
? "Local Note (optional)"
|
||||
: "Note (optional)",
|
||||
style:
|
||||
STextStyles.desktopTextExtraSmall(context).copyWith(
|
||||
|
|
|
@ -788,11 +788,11 @@ class EpicCashWallet extends CoinServiceAPI
|
|||
level: LogLevel.Info,
|
||||
);
|
||||
|
||||
int nextScannedBlock = int.parse(await epiccash.LibEpiccash.scanOutputs(
|
||||
int nextScannedBlock = await epiccash.LibEpiccash.scanOutputs(
|
||||
wallet: wallet!,
|
||||
startHeight: lastScannedBlock,
|
||||
numberOfBlocks: scanChunkSize,
|
||||
));
|
||||
);
|
||||
|
||||
// update local cache
|
||||
await epicUpdateLastScannedBlock(nextScannedBlock);
|
||||
|
|
|
@ -179,12 +179,12 @@ abstract class LibEpiccash {
|
|||
///
|
||||
/// Scan Epic outputs
|
||||
///
|
||||
static Future<String> scanOutputs({
|
||||
static Future<int> scanOutputs({
|
||||
required String wallet,
|
||||
required int startHeight,
|
||||
required int numberOfBlocks,
|
||||
}) async {
|
||||
return await m.protect(() async {
|
||||
return int.parse(await m.protect(() async {
|
||||
try {
|
||||
return await compute(_scanOutputsWrapper, (
|
||||
wallet: wallet,
|
||||
|
@ -194,7 +194,7 @@ abstract class LibEpiccash {
|
|||
} catch (e) {
|
||||
throw ("Error getting scanning outputs : ${e.toString()}");
|
||||
}
|
||||
});
|
||||
}));
|
||||
}
|
||||
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue