diff --git a/lib/core/crypto/eosdart/src/numeric.dart b/lib/core/crypto/eosdart/src/numeric.dart index 943030af..c38c102e 100644 --- a/lib/core/crypto/eosdart/src/numeric.dart +++ b/lib/core/crypto/eosdart/src/numeric.dart @@ -89,7 +89,7 @@ Uint8List signedDecimalToBinary(int size, String s) { var result = decimalToBinary(size, s); if (negative) { negate(result); - if (!isNegative(result)) { + if (!isNegative(result) && !isZero(result)) { throw 'negative number is out of range: -$s => $result'; } } else if (isNegative(result)) { diff --git a/lib/core/di/log_module.dart b/lib/core/di/log_module.dart index 85d6bcaa..5a631111 100644 --- a/lib/core/di/log_module.dart +++ b/lib/core/di/log_module.dart @@ -2,7 +2,7 @@ part of 'di_setup.dart'; void _initializeLogSystem() { if (!kReleaseMode) { - Fimber.plantTree(DebugTree()); + Fimber.plantTree(DebugTree(useColors: true)); } // Log Errors to the Crash Reporting Systems if (kReleaseMode) { diff --git a/lib/core/network/api/eos_service.dart b/lib/core/network/api/eos_service.dart index 659b4d28..3a88435d 100644 --- a/lib/core/network/api/eos_service.dart +++ b/lib/core/network/api/eos_service.dart @@ -93,7 +93,9 @@ class EOSService { }) async { /// Note: An EOSTransaction coming from a QR code may be on the incorrect network for the account we are trying to use. if (user.network != eosTransaction.network) { - throw 'Wrong network - transaction on ${eosTransaction.network} cannot be signed by user on network ${user.network}'; + LogHelper.e('Wrong network error'); + return ErrorResult( + 'Wrong network - transaction on ${eosTransaction.network} cannot be signed by user on network ${user.network}'); } final actions = eosTransaction.actions.map((e) => e.toEosAction).toList(); diff --git a/lib/core/network/models/dao_data_model.dart b/lib/core/network/models/dao_data_model.dart index ce1505b4..a2dd0be2 100644 --- a/lib/core/network/models/dao_data_model.dart +++ b/lib/core/network/models/dao_data_model.dart @@ -16,8 +16,12 @@ class DaoData { }); factory DaoData.fromJson(Map json) { + print('DaoData.fromJson ${json}'); final Map settings = json['settings'][0]; - final logoUrlAndType = settings['settings_logo_s']?.split(':') ?? ['', '']; + List? logoUrlAndType = settings['settings_logo_s']?.split(':'); + if (logoUrlAndType == null || logoUrlAndType.length != 2) { + logoUrlAndType = ['', '']; + } return DaoData( docId: json['docId'], detailsDaoName: json['details_daoName_n'], diff --git a/lib/ui/sign_transaction/interactor/sign_transaction_bloc.dart b/lib/ui/sign_transaction/interactor/sign_transaction_bloc.dart index 81e968b9..06afc73a 100644 --- a/lib/ui/sign_transaction/interactor/sign_transaction_bloc.dart +++ b/lib/ui/sign_transaction/interactor/sign_transaction_bloc.dart @@ -1,8 +1,10 @@ import 'dart:async'; import 'package:bloc/bloc.dart'; +import 'package:fimber/fimber.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; import 'package:hypha_wallet/core/crypto/seeds_esr/scan_qr_code_result_data.dart'; +import 'package:hypha_wallet/core/logging/log_helper.dart'; import 'package:hypha_wallet/ui/architecture/interactor/page_states.dart'; import 'package:hypha_wallet/ui/sign_transaction/interactor/data/transaction_action_data.dart'; import 'package:hypha_wallet/ui/sign_transaction/success/sign_transaction_success_page.dart'; @@ -42,6 +44,7 @@ class SignTransactionBloc extends Bloc