From db7422a1003496000aa199f11c742037534f4455 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 21 Nov 2024 11:08:13 -0600 Subject: [PATCH] update libepiccash and fix odd address error caused by some odd code --- crypto_plugins/flutter_libepiccash | 2 +- lib/wallets/wallet/impl/epiccash_wallet.dart | 25 +++++++------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/crypto_plugins/flutter_libepiccash b/crypto_plugins/flutter_libepiccash index 1d48c0a8a..0bb1b1ced 160000 --- a/crypto_plugins/flutter_libepiccash +++ b/crypto_plugins/flutter_libepiccash @@ -1 +1 @@ -Subproject commit 1d48c0a8aa394324e7c39267e5654038834aff95 +Subproject commit 0bb1b1ced6e0d3c66e383698f89825754c692986 diff --git a/lib/wallets/wallet/impl/epiccash_wallet.dart b/lib/wallets/wallet/impl/epiccash_wallet.dart index 2b289e84a..73955c8cb 100644 --- a/lib/wallets/wallet/impl/epiccash_wallet.dart +++ b/lib/wallets/wallet/impl/epiccash_wallet.dart @@ -299,26 +299,19 @@ class EpiccashWallet extends Bip39Wallet { } } + /// Only index 0 is currently used in stack wallet. Future
_generateAndStoreReceivingAddressForIndex( int index, ) async { - Address? address = await getCurrentReceivingAddress(); - - if (address != null) { - final splitted = address.value.split('@'); - //Check if the address is the same as the current epicbox domain - //Since we're only using one epicbpox now this doesn't apply but will be - // useful in the future - final epicboxConfig = await getEpicBoxConfig(); - if (splitted[1] != epicboxConfig.host) { - //Update the address - address = await thisWalletAddress(index, epicboxConfig); - } - } else { - final epicboxConfig = await getEpicBoxConfig(); - address = await thisWalletAddress(index, epicboxConfig); + // Since only 0 is a valid index in stack wallet at this time, lets just + // throw is not zero + if (index != 0) { + throw Exception("Invalid/unexpected address index used"); } + final epicBoxConfig = await getEpicBoxConfig(); + final address = await thisWalletAddress(index, epicBoxConfig); + if (info.cachedReceivingAddress != address.value) { await info.updateReceivingAddress( newAddress: address.value, @@ -948,8 +941,6 @@ class EpiccashWallet extends Bip39Wallet { final slatesToCommits = info.epicData?.slatesToCommits ?? {}; for (final tx in transactions) { - Logging.instance.log("tx: $tx", level: LogLevel.Info); - final isIncoming = tx.txType == epic_models.TransactionType.TxReceived || tx.txType == epic_models.TransactionType.TxReceivedCancelled;