mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +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) {
|
function transformState (state) {
|
||||||
const newState = state
|
const newState = state
|
||||||
|
if (!newState.TransactionController) return newState
|
||||||
const transactions = newState.TransactionController.transactions
|
const transactions = newState.TransactionController.transactions
|
||||||
|
|
||||||
newState.TransactionController.transactions = transactions.map((txMeta, _, txList) => {
|
newState.TransactionController.transactions = transactions.map((txMeta, _, txList) => {
|
||||||
if (
|
if (
|
||||||
txMeta.status === 'unapproved' &&
|
txMeta.status === 'unapproved' &&
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
const assert = require('assert')
|
const assert = require('assert')
|
||||||
const migration24 = require('../../../app/scripts/migrations/024')
|
const migration24 = require('../../../app/scripts/migrations/024')
|
||||||
|
const firstTimeState = {
|
||||||
|
meta: {},
|
||||||
|
data: require('../../../app/scripts/first-time-state'),
|
||||||
|
}
|
||||||
const properTime = (new Date()).getTime()
|
const properTime = (new Date()).getTime()
|
||||||
const storage = {
|
const storage = {
|
||||||
"meta": {},
|
"meta": {},
|
||||||
@ -34,4 +38,12 @@ describe('storage is migrated successfully and the txParams.from are lowercase',
|
|||||||
done()
|
done()
|
||||||
}).catch(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…
x
Reference in New Issue
Block a user