Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/ddw 220 Implement async wallet restore #849

Merged
merged 29 commits into from
Apr 12, 2018

Conversation

nikolaglumac
Copy link
Contributor

@nikolaglumac nikolaglumac commented Apr 10, 2018

This PR contains the implementation of asynchronous wallet restoration and import features.
This is a major improvement as the wallet which is being restored/imported is momentarily available in the UI. User is able to straight away see the wallet's balance and existing wallet addresses while wallet transaction history is being fetched in the background. During the restoration process details are shown: restoration progress percentage and estimated time of completion. It is not possible to send new transactions during the entire restoration process.

TODOs:

  • Inject missing Japanese translation
  • Improve restoration progress spinner styling across the themes (design: http://zpl.io/2vlMzqn)
  • Update and fix acceptance tests

Summary screen

screen_shot_2018-04-10_at_19 54 06_1024

Send screen

screen_shot_2018-04-10_at_20 55 53_1024

Transactions screen

screen_shot_2018-04-10_at_21 16 01_1024

@nikolaglumac
Copy link
Contributor Author

All acceptance tests are updated and all are now passing 🎉

screen shot 2018-04-11 at 19 45 08

@nikolaglumac
Copy link
Contributor Author

@darko-mijic @DominikGuzei @tomothespian this PR is now ready for the review!

@nikolaglumac
Copy link
Contributor Author

nikolaglumac commented Apr 11, 2018

PS. I will post details of how to run Cardano-SL feature/CBR-90 branch in development mode in the Youtrack card: https://iohk.myjetbrains.com/youtrack/issue/DDW-220#comment=93-20254

Copy link
Contributor

@tomislavhoracek tomislavhoracek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work @nikolaglumac 👍

// Reject errors
response.on('error', (error) => reject(error));
// Resolve JSON results and handle weird backend behavior
// of "Left" (for errors) and "Right" (for success) properties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment should be removed as it is not the case here anymore!

if (!wallets.active) return <MainLayout><LoadingSpinner /></MainLayout>;

const isRestoreActive = get(wallets.active, 'syncState.tag') === 'restoring';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to refactor this into proper api TYPES instead of magic constants.

@@ -30,6 +31,8 @@ export default class WalletSendPage extends Component<Props> {
// Guard against potential null values
if (!activeWallet) throw new Error('Active wallet required for WalletSendPage.');

const isRestoreActive = get(activeWallet, 'syncState.tag') === 'restoring';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here -> using proper api types instead of 'restoring' string

@@ -51,7 +52,9 @@ export default class WalletSummaryPage extends Component<Props> {
let walletTransactions = null;
const noTransactionsLabel = intl.formatMessage(messages.noTransactions);

if (recentTransactionsRequest.isExecutingFirstTime || hasAny) {
const isRestoreActive = get(wallet, 'syncState.tag') === 'restoring';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@nikolaglumac
Copy link
Contributor Author

@DominikGuzei all your comments are now fixed!

@DominikGuzei DominikGuzei merged commit 2f7f87e into develop Apr 12, 2018
@DominikGuzei DominikGuzei deleted the feature/ddw-220-implement-async-wallet-restore branch April 12, 2018 09:23
@nikolaglumac nikolaglumac mentioned this pull request Apr 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants