From 3c026ab730f1cf3f575e5ec7ad7700ba1d9baadd Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 8 Jun 2023 09:00:55 -0600 Subject: [PATCH] add more logging and return zero fees --- lib/services/coins/banano/banano_wallet.dart | 19 +++++++++++++++---- lib/services/coins/nano/nano_wallet.dart | 15 +++++++++++++-- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/lib/services/coins/banano/banano_wallet.dart b/lib/services/coins/banano/banano_wallet.dart index abba2a86f..7a972ae65 100644 --- a/lib/services/coins/banano/banano_wallet.dart +++ b/lib/services/coins/banano/banano_wallet.dart @@ -293,7 +293,11 @@ class BananoWallet extends CoinServiceAPI Future estimateFeeFor(Amount amount, int feeRate) { // fees are always 0 :) return Future.value( - Amount(rawValue: BigInt.from(0), fractionDigits: coin.decimals)); + Amount( + rawValue: BigInt.from(0), + fractionDigits: coin.decimals, + ), + ); } @override @@ -302,8 +306,15 @@ class BananoWallet extends CoinServiceAPI } @override - // TODO: implement fees - Future get fees => throw UnimplementedError(); + // Banano has no fees + Future get fees async => FeeObject( + numberOfBlocksFast: 1, + numberOfBlocksAverage: 1, + numberOfBlocksSlow: 1, + fast: 0, + medium: 0, + slow: 0, + ); Future updateBalance() async { final body = jsonEncode({ @@ -744,7 +755,7 @@ class BananoWallet extends CoinServiceAPI ); } catch (e, s) { Logging.instance.log( - "Failed to refresh banano wallet \'$walletName\': $e\n$s", + "Failed to refresh banano wallet $walletId: '$walletName': $e\n$s", level: LogLevel.Warning, ); GlobalEventBus.instance.fire( diff --git a/lib/services/coins/nano/nano_wallet.dart b/lib/services/coins/nano/nano_wallet.dart index c0a5eb853..dce078250 100644 --- a/lib/services/coins/nano/nano_wallet.dart +++ b/lib/services/coins/nano/nano_wallet.dart @@ -313,7 +313,14 @@ class NanoWallet extends CoinServiceAPI @override // Nano has no fees - Future get fees => throw UnimplementedError(); + Future get fees async => FeeObject( + numberOfBlocksFast: 1, + numberOfBlocksAverage: 1, + numberOfBlocksSlow: 1, + fast: 0, + medium: 0, + slow: 0, + ); Future updateBalance() async { final body = jsonEncode({ @@ -754,7 +761,11 @@ class NanoWallet extends CoinServiceAPI coin, ), ); - } catch (e) { + } catch (e, s) { + Logging.instance.log( + "Failed to refresh nano wallet $walletId: '$walletName': $e\n$s", + level: LogLevel.Warning, + ); GlobalEventBus.instance.fire( WalletSyncStatusChangedEvent( WalletSyncStatus.unableToSync,