Skip to content

Commit

Permalink
Fixes QR and addresses after wallet recovery
Browse files Browse the repository at this point in the history
Resolves brave#12170

Auditors:

Test Plan:
  • Loading branch information
NejcZdovc committed Dec 16, 2017
1 parent 8272c80 commit 97e7ee3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/browser/api/ledger.js
Original file line number Diff line number Diff line change
Expand Up @@ -1015,6 +1015,10 @@ const onWalletRecovery = (state, error, result) => {
result = result.setIn(['properties', 'wallet', 'keyinfo', 'seed'], seed)
}

// remove old QR codes and addresses
state = ledgerState.setInfoProp(state, 'walletQR', Immutable.Map())
state = ledgerState.setInfoProp(state, 'addresses', Immutable.Map())

callback(error, result)

if (balanceTimeoutId) {
Expand Down
4 changes: 4 additions & 0 deletions test/unit/app/browser/api/ledgerTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,10 @@ describe('ledger api unit tests', function () {
updatedStamp: 0
}
}))
.setIn(['ledger', 'info'], Immutable.fromJS({
addresses: {},
walletQR: {}
}))
assert(setRecoveryStatusSpy.withArgs(sinon.match.any, true))
assert.deepEqual(result.toJS(), expectedSate.toJS())
const callBack = onLedgerCallbackSpy.getCall(0).args[0]
Expand Down

0 comments on commit 97e7ee3

Please sign in to comment.