Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugix for set token multipliers transaction #258

Merged
merged 6 commits into from
Sep 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion lib/core/crypto/eosdart/src/numeric.dart
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ Uint8List signedDecimalToBinary(int size, String s) {
var result = decimalToBinary(size, s);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the fix, everything else here is better errors and better logging since this bug kinda fell through and didn't produce any output.

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)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/core/di/log_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ part of 'di_setup.dart';

void _initializeLogSystem() {
if (!kReleaseMode) {
Fimber.plantTree(DebugTree());
Fimber.plantTree(DebugTree(useColors: true));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noice

}
// Log Errors to the Crash Reporting Systems
if (kReleaseMode) {
Expand Down
4 changes: 3 additions & 1 deletion lib/core/network/api/eos_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 5 additions & 1 deletion lib/core/network/models/dao_data_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,12 @@ class DaoData {
});

factory DaoData.fromJson(Map<String, dynamic> json) {
print('DaoData.fromJson ${json}');
final Map<String, dynamic> settings = json['settings'][0];
final logoUrlAndType = settings['settings_logo_s']?.split(':') ?? ['', ''];
List<String>? logoUrlAndType = settings['settings_logo_s']?.split(':');
if (logoUrlAndType == null || logoUrlAndType.length != 2) {
logoUrlAndType = ['', ''];
}
return DaoData(
docId: json['docId'],
detailsDaoName: json['details_daoName_n'],
Expand Down
3 changes: 3 additions & 0 deletions lib/ui/sign_transaction/interactor/sign_transaction_bloc.dart
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -42,6 +44,7 @@ class SignTransactionBloc extends Bloc<SignTransactionEvent, SignTransactionStat
emit(
state.copyWith(command: const PageCommand.navigateToTransactionSuccess(SignSuccessTransactionType.approved)));
} else {
LogHelper.e('Transaction error: ${result.asError?.error.message}');
emit(state.copyWith(command: const PageCommand.navigateToTransactionFailed()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class SignTransactionUseCase extends InputUseCase<HResult.Result<String, HyphaEr
}
return HResult.Result.value(result.asValue!.value as String);
} else {
return HResult.Result.error(HyphaError.api('Error creating singing transaction'));
LogHelper.e('error creating transaction ${result.asError?.error}');
return HResult.Result.error(HyphaError.api('Error creating singing transaction ${result.asError?.error}'));
}
}
}
Expand Down
Loading