1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-23 01:39:44 +01:00

Move all users to new scalable backend

This commit is contained in:
Dan Finlay 2016-05-11 13:10:54 -07:00
parent b430cbd064
commit 8bfa40d2d3
4 changed files with 31 additions and 8 deletions

View File

@ -3,6 +3,7 @@
## Current Master
- Fixed bug where send view would not load correctly the first time it was visited per account.
- Migrated all users to new scalable backend.
## 1.8.1 2016-05-10

View File

@ -1,10 +1,5 @@
var path = require('path')
var fs = require('fs')
var migration2 = require('../migrations/002')
var migration3 = require('../migrations/003')
module.exports = [
migration2,
migration3,
require('../migrations/002'),
require('../migrations/003'),
require('../migrations/004'),
]

View File

@ -0,0 +1,22 @@
module.exports = {
version: 4,
migrate: function(data) {
try {
if (data.config.provider.type !== 'rpc') return data
switch (data.config.provider.rpcTarget) {
case 'https://testrpc.metamask.io/':
data.config.provider = {
type: 'testnet'
}
break
case 'https://rpc.metamask.io/':
data.config.provider = {
type: 'mainnet'
}
break
}
} catch (_) {}
return data
}
}

View File

@ -5,6 +5,7 @@ var wallet1 = require(path.join('..', 'lib', 'migrations', '001.json'))
var migration2 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '002'))
var migration3 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '003'))
var migration4 = require(path.join('..', '..', 'app', 'scripts', 'migrations', '004'))
describe('wallet1 is migrated successfully', function() {
@ -23,6 +24,10 @@ describe('wallet1 is migrated successfully', function() {
var secondResult = migration3.migrate(firstResult)
assert.equal(secondResult.config.provider.rpcTarget, newTestRpc)
var thirdResult = migration4.migrate(secondResult)
assert.equal(secondResult.config.provider.rpcTarget, null)
assert.equal(secondResult.config.provider.type, 'testnet')
done()
})
})