From 987df055a084e183ab5b7af78e69fbd331272807 Mon Sep 17 00:00:00 2001 From: OmarHatem Date: Thu, 15 Dec 2022 00:42:04 +0200 Subject: [PATCH] Return default values for transaction priority instead of throwing an exception --- cw_bitcoin/lib/bitcoin_transaction_priority.dart | 4 ++-- cw_core/lib/monero_transaction_priority.dart | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cw_bitcoin/lib/bitcoin_transaction_priority.dart b/cw_bitcoin/lib/bitcoin_transaction_priority.dart index d82ea429e..6f7164ec3 100644 --- a/cw_bitcoin/lib/bitcoin_transaction_priority.dart +++ b/cw_bitcoin/lib/bitcoin_transaction_priority.dart @@ -22,7 +22,7 @@ class BitcoinTransactionPriority extends TransactionPriority { case 2: return fast; default: - throw Exception('Unexpected token: $raw for BitcoinTransactionPriority deserialize'); + return medium; } } @@ -73,7 +73,7 @@ class LitecoinTransactionPriority extends BitcoinTransactionPriority { case 2: return fast; default: - throw Exception('Unexpected token: $raw for LitecoinTransactionPriority deserialize'); + return medium; } } diff --git a/cw_core/lib/monero_transaction_priority.dart b/cw_core/lib/monero_transaction_priority.dart index cca887398..5219014c5 100644 --- a/cw_core/lib/monero_transaction_priority.dart +++ b/cw_core/lib/monero_transaction_priority.dart @@ -50,7 +50,7 @@ class MoneroTransactionPriority extends TransactionPriority { case 4: return fastest; default: - throw Exception('Unexpected token: $raw for MoneroTransactionPriority deserialize'); + return automatic; } }