mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Merge pull request #3899 from MetaMask/migration-24-fix
make migration-24 compat with first-time-state
This commit is contained in:
commit
50c36074fb
@ -29,8 +29,8 @@ module.exports = {
|
||||
|
||||
function transformState (state) {
|
||||
const newState = state
|
||||
if (!newState.TransactionController) return newState
|
||||
const transactions = newState.TransactionController.transactions
|
||||
|
||||
newState.TransactionController.transactions = transactions.map((txMeta, _, txList) => {
|
||||
if (
|
||||
txMeta.status === 'unapproved' &&
|
||||
|
@ -1,5 +1,9 @@
|
||||
const assert = require('assert')
|
||||
const migration24 = require('../../../app/scripts/migrations/024')
|
||||
const firstTimeState = {
|
||||
meta: {},
|
||||
data: require('../../../app/scripts/first-time-state'),
|
||||
}
|
||||
const properTime = (new Date()).getTime()
|
||||
const storage = {
|
||||
"meta": {},
|
||||
@ -34,4 +38,12 @@ describe('storage is migrated successfully and the txParams.from are lowercase',
|
||||
done()
|
||||
}).catch(done)
|
||||
})
|
||||
|
||||
it('should migrate first time state', (done) => {
|
||||
migration24.migrate(firstTimeState)
|
||||
.then((migratedData) => {
|
||||
assert.equal(migratedData.meta.version, 24)
|
||||
done()
|
||||
}).catch(done)
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user