ecash tweaks

This commit is contained in:
julian 2023-11-14 13:04:10 -06:00
parent 269ad06f14
commit bccc85c3ca
3 changed files with 7 additions and 10 deletions

View file

@ -32,8 +32,8 @@ class Ecash extends Bip39HDCurrency {
@override @override
List<DerivePathType> get supportedDerivationPathTypes => [ List<DerivePathType> get supportedDerivationPathTypes => [
DerivePathType.eCash44,
DerivePathType.bip44, DerivePathType.bip44,
if (coin != Coin.bitcoincashTestnet) DerivePathType.bch44,
]; ];
@override @override

View file

@ -55,9 +55,6 @@ class WalletInfo implements IsarId {
// /// Wallet creation chain height. Applies to select coin only. // /// Wallet creation chain height. Applies to select coin only.
// final int creationHeight; // final int creationHeight;
//
// /// Wallet restore chain height. Applies to select coin only.
// final int restoreHeight;
final String? otherDataJsonString; final String? otherDataJsonString;

View file

@ -84,7 +84,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin {
DerivePathType.bip44 || DerivePathType.bip44 ||
cryptoCurrency.addressType(address: e.value) == cryptoCurrency.addressType(address: e.value) ==
DerivePathType.eCash44)) { DerivePathType.eCash44)) {
return bitbox.Address.toCashAddress(e.value); return bitbox.Address.toECashAddress(e.value);
} else { } else {
return e.value; return e.value;
} }
@ -98,7 +98,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin {
DerivePathType.bip44 || DerivePathType.bip44 ||
cryptoCurrency.addressType(address: e.value) == cryptoCurrency.addressType(address: e.value) ==
DerivePathType.eCash44)) { DerivePathType.eCash44)) {
return bitbox.Address.toCashAddress(e.value); return bitbox.Address.toECashAddress(e.value);
} else { } else {
return e.value; return e.value;
} }
@ -337,7 +337,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin {
return (blockedReason: blockedReason, blocked: blocked); return (blockedReason: blockedReason, blocked: blocked);
} }
// TODO: correct formula for bch? // TODO: correct formula for ecash?
@override @override
Amount roughFeeEstimate(int inputCount, int outputCount, int feeRatePerKB) { Amount roughFeeEstimate(int inputCount, int outputCount, int feeRatePerKB) {
return Amount( return Amount(
@ -352,7 +352,7 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin {
return vSize * (feeRatePerKB / 1000).ceil(); 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 @override
Future<({List<Address> addresses, int index})> checkGaps( Future<({List<Address> addresses, int index})> checkGaps(
int txCountBatchSize, int txCountBatchSize,
@ -396,8 +396,8 @@ class EcashWallet extends Bip39HDWallet with ElectrumXMixin {
derivePathType: type, derivePathType: type,
); );
// bch specific // ecash specific
final addressString = bitbox.Address.toCashAddress( final addressString = bitbox.Address.toECashAddress(
addressData.address.toString(), addressData.address.toString(),
); );