From bccc85c3ca4483dc0ac7d43b0eba98583f9b988d Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 14 Nov 2023 13:04:10 -0600 Subject: [PATCH] ecash tweaks --- lib/wallets/crypto_currency/coins/ecash.dart | 2 +- lib/wallets/isar/models/wallet_info.dart | 3 --- lib/wallets/wallet/impl/ecash_wallet.dart | 12 ++++++------ 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lib/wallets/crypto_currency/coins/ecash.dart b/lib/wallets/crypto_currency/coins/ecash.dart index 9b5d84b37..2d428babb 100644 --- a/lib/wallets/crypto_currency/coins/ecash.dart +++ b/lib/wallets/crypto_currency/coins/ecash.dart @@ -32,8 +32,8 @@ class Ecash extends Bip39HDCurrency { @override List get supportedDerivationPathTypes => [ + DerivePathType.eCash44, DerivePathType.bip44, - if (coin != Coin.bitcoincashTestnet) DerivePathType.bch44, ]; @override diff --git a/lib/wallets/isar/models/wallet_info.dart b/lib/wallets/isar/models/wallet_info.dart index dffb9fe74..2fc992da1 100644 --- a/lib/wallets/isar/models/wallet_info.dart +++ b/lib/wallets/isar/models/wallet_info.dart @@ -55,9 +55,6 @@ class WalletInfo implements IsarId { // /// Wallet creation chain height. Applies to select coin only. // final int creationHeight; - // - // /// Wallet restore chain height. Applies to select coin only. - // final int restoreHeight; final String? otherDataJsonString; diff --git a/lib/wallets/wallet/impl/ecash_wallet.dart b/lib/wallets/wallet/impl/ecash_wallet.dart index 31d236d19..bb1dec65e 100644 --- a/lib/wallets/wallet/impl/ecash_wallet.dart +++ b/lib/wallets/wallet/impl/ecash_wallet.dart @@ -84,7 +84,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin { DerivePathType.bip44 || cryptoCurrency.addressType(address: e.value) == DerivePathType.eCash44)) { - return bitbox.Address.toCashAddress(e.value); + return bitbox.Address.toECashAddress(e.value); } else { return e.value; } @@ -98,7 +98,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin { DerivePathType.bip44 || cryptoCurrency.addressType(address: e.value) == DerivePathType.eCash44)) { - return bitbox.Address.toCashAddress(e.value); + return bitbox.Address.toECashAddress(e.value); } else { return e.value; } @@ -337,7 +337,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin { return (blockedReason: blockedReason, blocked: blocked); } - // TODO: correct formula for bch? + // TODO: correct formula for ecash? @override Amount roughFeeEstimate(int inputCount, int outputCount, int feeRatePerKB) { return Amount( @@ -352,7 +352,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin { return vSize * (feeRatePerKB / 1000).ceil(); } - // not all coins need to override this. BCH does due to cash addr string formatting + // not all coins need to override this. ecash does due to cash addr string formatting @override Future<({List
addresses, int index})> checkGaps( int txCountBatchSize, @@ -396,8 +396,8 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin { derivePathType: type, ); - // bch specific - final addressString = bitbox.Address.toCashAddress( + // ecash specific + final addressString = bitbox.Address.toECashAddress( addressData.address.toString(), );