mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-17 09:46:39 +01:00
fix: zcash address for exchange (#3491)
* fix: zcash address for exchange * fix: honour the restore height the user entered - Make Zcash rescan work in both directions by resetting sync from the new birth height - Keep the entered height when restoring a wallet from keys - Tolerate grouping separators in typed restore heights --------- Co-authored-by: Vik Sharma <vik@cakewallet.com>
This commit is contained in:
@@ -215,6 +215,10 @@ class WalletRestorePage extends BasePage {
|
||||
walletRestoreFromKeysFormKey.currentState!.privateKeyController.text;
|
||||
credentials['name'] =
|
||||
walletRestoreFromKeysFormKey.currentState!.nameTextEditingController.text;
|
||||
if (walletRestoreViewModel.hasBlockchainHeightSelector) {
|
||||
credentials['height'] =
|
||||
walletRestoreFromKeysFormKey.currentState!.blockchainHeightKey.currentState?.height;
|
||||
}
|
||||
} else {
|
||||
credentials['name'] =
|
||||
walletRestoreFromKeysFormKey.currentState!.nameTextEditingController.text;
|
||||
|
||||
@@ -65,7 +65,8 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
|
||||
try {
|
||||
final int _height;
|
||||
if (restoreHeightController.text.isNotEmpty) {
|
||||
_height = int.tryParse(restoreHeightController.text) ?? 0;
|
||||
final digits = restoreHeightController.text.replaceAll(RegExp(r'[^0-9]'), '');
|
||||
_height = int.tryParse(digits) ?? 0;
|
||||
} else {
|
||||
_height = 0;
|
||||
}
|
||||
|
||||
@@ -1185,6 +1185,19 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||
}
|
||||
}
|
||||
|
||||
if (receiveCurrency == CryptoCurrency.zec &&
|
||||
selectedAddressBookWallet?.type == WalletType.zcash) {
|
||||
if (wallet.type == WalletType.zcash && wallet.name == selectedAddressBookWallet!.name) {
|
||||
receiveAddress = wallet.walletAddresses.addressForExchange;
|
||||
} else {
|
||||
receiveAddress = (await selectedAddressBookWallet!.getAddresses())
|
||||
.entries
|
||||
.firstWhereOrNull((e) => e.value == 'transparent')
|
||||
?.key ??
|
||||
receiveAddress;
|
||||
}
|
||||
}
|
||||
|
||||
// parse Lightning address to bolt11 invoice
|
||||
if (receiveAddress.contains("@")) {
|
||||
receiveAddress = await getBolt11FromLightingAddress(receiveAddress) ?? receiveAddress;
|
||||
|
||||
Reference in New Issue
Block a user