Skip to content
Permalink
Browse files

[DDW-637] Error debugging 3

  • Loading branch information...
daniloprates committed May 13, 2019
1 parent c4d5afb commit 137694dce20dbdea2e3ee6d572c235b34126a030
Showing with 14 additions and 1 deletion.
  1. +14 −1 source/renderer/app/stores/WalletsStore.js
@@ -525,25 +525,31 @@ export default class WalletsStore extends Store {
timestamp: string,
}): Generator<any, any, any> {
try {
console.log('1');
// Pause polling in order not to show Paper wallet in the UI
this._pausePolling();

console.log('2');
// Set inProgress state to show spinner if is needed
this._updateCertificateCreationState(true);

console.log('3');
// Generate wallet recovery phrase
const recoveryPhrase: Array<string> = yield this.getWalletRecoveryPhraseRequest.execute()
.promise;

console.log('4');
// Generate 9-words (additional) mnemonic
const additionalMnemonicWords: Array<string> = yield this.getWalletCertificateAdditionalMnemonicsRequest.execute()
.promise;
this.additionalMnemonicWords = additionalMnemonicWords.join(' ');

console.log('5');
// Generate spending password from 9-word mnemonic and save to store
const spendingPassword = mnemonicToSeedHex(this.additionalMnemonicWords);
this.walletCertificatePassword = spendingPassword;

console.log('6');
// Generate paper wallet scrambled mnemonic
const walletCertificateRecoveryPhrase: Array<string> = yield this.getWalletCertificateRecoveryPhraseRequest.execute(
{
@@ -555,13 +561,15 @@ export default class WalletsStore extends Store {
' '
);

console.log('7');
// Create temporary wallet
const walletData = {
name: 'Paper Wallet',
mnemonic: recoveryPhrase.join(' '),
};
const wallet = yield this.createWalletRequest.execute(walletData).promise;

console.log('8');
// Get temporary wallet address
let walletAddresses;
if (wallet) {
@@ -573,6 +581,7 @@ export default class WalletsStore extends Store {
yield this.deleteWalletRequest.execute({ walletId: wallet.id });
}

console.log('9');
// Set wallet certificate address
const walletAddress = get(
walletAddresses,
@@ -581,6 +590,7 @@ export default class WalletsStore extends Store {
);
this.walletCertificateAddress = walletAddress;

console.log('10');
// download pdf certificate
yield this._downloadCertificate(
walletAddress,
@@ -589,8 +599,11 @@ export default class WalletsStore extends Store {
params.timestamp
);
} catch (error) {
throw error;
console.log('generateCertificate error -----');
console.warn(error);
// throw error;
} finally {
console.log('resume');
this._resumePolling();
}
}).bind(this);

0 comments on commit 137694d

Please sign in to comment.
You can’t perform that action at this time.