mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-24 20:49:28 +00:00
feat: Implement sweep all WIP [skip ci]
This commit is contained in:
parent
0667e7fdcc
commit
5d51cd5459
1 changed files with 22 additions and 22 deletions
|
@ -69,33 +69,33 @@ abstract class WalletCreationVMBase with Store {
|
||||||
// if (restoreWallet != null &&
|
// if (restoreWallet != null &&
|
||||||
// restoreWallet.restoreMode == WalletRestoreMode.txids) {
|
// restoreWallet.restoreMode == WalletRestoreMode.txids) {
|
||||||
//* Create the newWallet that will receive the funds
|
//* Create the newWallet that will receive the funds
|
||||||
final newWallet = await createNewWalletWithoutSwitching(
|
// final newWallet = await createNewWalletWithoutSwitching(
|
||||||
options: options,
|
// options: options,
|
||||||
regenerateName: true,
|
// regenerateName: true,
|
||||||
);
|
// );
|
||||||
final newWalletAddress = newWallet.walletAddresses.address;
|
// final newWalletAddress = newWallet.walletAddresses.address;
|
||||||
print('New Wallet Address ' + newWalletAddress);
|
// print('New Wallet Address ' + newWalletAddress);
|
||||||
|
|
||||||
//* Switch to the restoredWallet in order to activate the node connection
|
// //* Switch to the restoredWallet in order to activate the node connection
|
||||||
_appStore.changeCurrentWallet(restoredWallet);
|
// _appStore.changeCurrentWallet(restoredWallet);
|
||||||
|
|
||||||
await restoredWallet.startSync();
|
// await restoredWallet.startSync();
|
||||||
print('Before syncing starts');
|
// print('Before syncing starts');
|
||||||
await syncCompleter.future;
|
// await syncCompleter.future;
|
||||||
print('After syncing ends');
|
// print('After syncing ends');
|
||||||
|
|
||||||
//* Sweep all funds from restoredWallet to newWallet
|
//* Sweep all funds from restoredWallet to newWallet
|
||||||
await sweepAllFundsToNewWallet(
|
// await sweepAllFundsToNewWallet(
|
||||||
restoredWallet,
|
// restoredWallet,
|
||||||
type,
|
// type,
|
||||||
newWalletAddress,
|
// newWalletAddress,
|
||||||
restoreWallet?.txId ?? '',
|
// restoreWallet?.txId ?? '',
|
||||||
);
|
// );
|
||||||
// } else {
|
// } else {
|
||||||
// await _walletInfoSource.add(restoredWallet.walletInfo);
|
await _walletInfoSource.add(restoredWallet.walletInfo);
|
||||||
// _appStore.changeCurrentWallet(restoredWallet);
|
_appStore.changeCurrentWallet(restoredWallet);
|
||||||
// _appStore.authenticationStore.allowed();
|
_appStore.authenticationStore.allowed();
|
||||||
// state = ExecutedSuccessfullyState();
|
state = ExecutedSuccessfullyState();
|
||||||
// }
|
// }
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
print('Errorrrrr');
|
print('Errorrrrr');
|
||||||
|
|
Loading…
Reference in a new issue