Skip to content

Commit

Permalink
fix: start passing passphrase when addind passphrase
Browse files Browse the repository at this point in the history
  • Loading branch information
r4mmer committed Sep 22, 2023
1 parent 6d5f1f5 commit fbbd209
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,10 @@ const returnStartedRoute = (Component, props, rest) => {
return <Redirect to={{pathname: '/wallet/'}}/>;
}

// Check if we are currently addind the passphrase
// This should hold until we finish loading the wallet
// ...

// Wallet is not loaded, but it is still loading addresses. Go to the loading screen
const reduxState = store.getState();
if (reduxState.loadingAddresses) {
Expand Down
2 changes: 1 addition & 1 deletion src/sagas/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function* startWallet(action) {
if (hardware) {
yield LOCAL_STORE.initHWStorage(xpub);
} else {
yield LOCAL_STORE.initStorage(words, password, pin);
yield LOCAL_STORE.initStorage(words, password, pin, passphrase);

Check warning on line 123 in src/sagas/wallet.js

View check run for this annotation

Codecov / codecov/patch

src/sagas/wallet.js#L123

Added line #L123 was not covered by tests
}
}

Expand Down
8 changes: 5 additions & 3 deletions src/storage.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,9 @@ export class LocalStorageStore {
cleanWallet() {
this.removeItem('wallet:id');
this.removeItem(IS_HARDWARE_KEY);
this.removeItem(STARTED_KEY);
this.removeItem(LOCKED_KEY);
// this.removeItem(STARTED_KEY);
// this.removeItem(LOCKED_KEY);
this.lock();

Check warning on line 94 in src/storage.js

View check run for this annotation

Codecov / codecov/patch

src/storage.js#L94

Added line #L94 was not covered by tests
this.removeItem(CLOSED_KEY);
delete this._storage;
this._storage = null;
Expand All @@ -104,13 +105,14 @@ export class LocalStorageStore {
}
}

async initStorage(seed, password, pin) {
async initStorage(seed, password, pin, passphrase='') {
this._storage = null;
this.setHardwareWallet(false);
const accessData = walletUtils.generateAccessDataFromSeed(
seed,
{
pin,
passphrase,
password,
networkName: config.getNetwork().name,
}
Expand Down
2 changes: 1 addition & 1 deletion src/utils/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ const wallet = {

// Clean wallet data, persisted data and redux
await this.cleanWallet(wallet);
return this.generateWallet(words, passphrase, pin, password, routerHistory);
this.generateWallet(words, passphrase, pin, password, routerHistory);

Check warning on line 434 in src/utils/wallet.js

View check run for this annotation

Codecov / codecov/patch

src/utils/wallet.js#L434

Added line #L434 was not covered by tests
},

/*
Expand Down

0 comments on commit fbbd209

Please sign in to comment.