Skip to content

Commit

Permalink
Fix swap steps hanging (#99)
Browse files Browse the repository at this point in the history
* fix some swap steps hanging forever

* fix MakerPaymentSpentByWatcher seen as fail step
  • Loading branch information
naezith authored Jan 24, 2024
1 parent 3a835dc commit 06947f9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/blocs/swap_history_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ class SwapHistoryBloc implements BlocBase {
case 'MakerPaymentSpent':
status = Status.SWAP_SUCCESSFUL;
break;
case 'MakerPaymentSpentByWatcher':
status = Status.SWAP_SUCCESSFUL;
break;
case 'TakerPaymentSpent':
status = Status.SWAP_SUCCESSFUL;
break;
Expand Down
2 changes: 1 addition & 1 deletion lib/model/recent_swaps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ class SwapEEL {
});

factory SwapEEL.fromJson(Map<String, dynamic> json) => SwapEEL(
data: json['data'] == null ? null : SwapEF.fromJson(json['data']),
data: json['data'] is Map ? SwapEF.fromJson(json['data']) : null,
type: json['type'] ?? '',
);

Expand Down
4 changes: 2 additions & 2 deletions lib/screens/dex/orders/swap/detailed_swap_steps.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ class _DetailedSwapStepsState extends State<DetailedSwapSteps> {
if (index + 1 > swap.result.successEvents.length) {
return SwapStepStatus.failed;
}
if (swap.result.events[index].event.type ==
swap.result.successEvents[index]) {
if (swap.result.successEvents
.any((String e) => e == swap.result.events[index].event.type)) {
return SwapStepStatus.success;
} else {
return SwapStepStatus.failed;
Expand Down

0 comments on commit 06947f9

Please sign in to comment.