mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
make migration-24 compat with first-time-state
This commit is contained in:
parent
1153120fe8
commit
4efc718074
@ -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