mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 01:47:00 +01:00
Move all users to new scalable backend
This commit is contained in:
parent
b430cbd064
commit
8bfa40d2d3
@ -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
|
||||
|
||||
|
@ -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'),
|
||||
]
|
||||
|
22
app/scripts/migrations/004.js
Normal file
22
app/scripts/migrations/004.js
Normal 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
|
||||
}
|
||||
}
|
@ -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()
|
||||
})
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user