Merge branch 'master' into qrPrefix

feature/default_network_editable
Frankie 8 years ago committed by GitHub
commit 3da887e56e
  1. 22
      .gitignore
  2. 1
      CHANGELOG.md
  3. 7
      app/scripts/first-time-state.js
  4. 4
      app/scripts/lib/migrator/index.js
  5. 7348
      package-lock.json
  6. 2
      package.json
  7. 2
      test/unit/components/bn-as-decimal-input-test.js
  8. 3
      test/unit/components/pending-tx-test.js
  9. 1
      test/unit/explorer-link-test.js
  10. 6
      test/unit/network-contoller-test.js
  11. 1
      test/unit/tx-controller-test.js

22
.gitignore vendored

@ -1,21 +1,27 @@
dist
npm-debug.log npm-debug.log
node_modules node_modules
temp package-lock.json
.tmp
.sass-cache
app/bower_components app/bower_components
test/bower_components test/bower_components
package package
temp
.tmp
.sass-cache
.DS_Store .DS_Store
app/.DS_Store
dist
builds/ builds/
disc/ disc/
notes.txt
app/.DS_Store
development/bundle.js
builds.zip builds.zip
test/integration/bundle.js
development/bundle.js
development/states.js development/states.js
test/integration/bundle.js
test/background.js test/background.js
test/bundle.js test/bundle.js
test/test-bundle.js test/test-bundle.js
notes.txt

@ -3,6 +3,7 @@
## Current Master ## Current Master
- Add a `ethereum:` prefix to the QR code address - Add a `ethereum:` prefix to the QR code address
- The default network on installation is now MainNet
- Fix currency API URL from cryptonator. - Fix currency API URL from cryptonator.
- Update gasLimit params with every new block seen. - Update gasLimit params with every new block seen.

@ -1,12 +1,15 @@
// test and development environment variables
const env = process.env.METAMASK_ENV
const METAMASK_DEBUG = 'GULP_METAMASK_DEBUG'
// //
// The default state of MetaMask // The default state of MetaMask
// //
module.exports = { module.exports = {
config: {}, config: {},
NetworkController: { NetworkController: {
provider: { provider: {
type: 'rinkeby', type: (METAMASK_DEBUG || env === 'test') ? 'rinkeby' : 'mainnet',
}, },
}, },
} }

@ -14,8 +14,8 @@ class Migrator {
async migrateData (versionedData = this.generateInitialState()) { async migrateData (versionedData = this.generateInitialState()) {
const pendingMigrations = this.migrations.filter(migrationIsPending) const pendingMigrations = this.migrations.filter(migrationIsPending)
for (let index in pendingMigrations) { for (const index in pendingMigrations) {
let migration = pendingMigrations[index] const migration = pendingMigrations[index]
versionedData = await migration.migrate(versionedData) versionedData = await migration.migrate(versionedData)
if (!versionedData.data) throw new Error('Migrator - migration returned empty data') if (!versionedData.data) throw new Error('Migrator - migration returned empty data')
if (versionedData.version !== undefined && versionedData.meta.version !== migration.version) throw new Error('Migrator - Migration did not update version number correctly') if (versionedData.version !== undefined && versionedData.meta.version !== migration.version) throw new Error('Migrator - Migration did not update version number correctly')

7348
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -123,7 +123,7 @@
"valid-url": "^1.0.9", "valid-url": "^1.0.9",
"vreme": "^3.0.2", "vreme": "^3.0.2",
"web3": "0.18.2", "web3": "0.18.2",
"web3-provider-engine": "^12.2.3", "web3-provider-engine": "^12.2.4",
"web3-stream-provider": "^2.0.6", "web3-stream-provider": "^2.0.6",
"xtend": "^4.0.1" "xtend": "^4.0.1"
}, },

@ -18,7 +18,7 @@ describe('BnInput', function () {
} }
const value = new BN(valueStr, 10) const value = new BN(valueStr, 10)
let inputStr = '2.3' const inputStr = '2.3'
let targetStr = '23' let targetStr = '23'
while (targetStr.length < 19) { while (targetStr.length < 19) {

@ -31,7 +31,6 @@ describe('PendingTx', function () {
it('should use updated values when edited.', function (done) { it('should use updated values when edited.', function (done) {
const renderer = ReactTestUtils.createRenderer() const renderer = ReactTestUtils.createRenderer()
const newGasPrice = '0x77359400' const newGasPrice = '0x77359400'
@ -40,7 +39,6 @@ describe('PendingTx', function () {
accounts: identities, accounts: identities,
txData, txData,
sendTransaction: (txMeta, event) => { sendTransaction: (txMeta, event) => {
// Assert changes: // Assert changes:
const result = ethUtil.addHexPrefix(txMeta.txParams.gasPrice) const result = ethUtil.addHexPrefix(txMeta.txParams.gasPrice)
assert.notEqual(result, gasPrice, 'gas price should change') assert.notEqual(result, gasPrice, 'gas price should change')
@ -70,7 +68,6 @@ describe('PendingTx', function () {
ReactTestUtils.Simulate.submit(form, { preventDefault () {}, target: { checkValidity () { ReactTestUtils.Simulate.submit(form, { preventDefault () {}, target: { checkValidity () {
return true return true
} } }) } } })
} catch (e) { } catch (e) {
console.log('WHAAAA') console.log('WHAAAA')
console.error(e) console.error(e)

@ -11,5 +11,4 @@ describe('explorer-link', function () {
var result = linkGen('hash', '42') var result = linkGen('hash', '42')
assert.notEqual(result.indexOf('kovan'), -1, 'kovan injected') assert.notEqual(result.indexOf('kovan'), -1, 'kovan injected')
}) })
}) })

@ -37,7 +37,7 @@ describe('# Network Controller', function () {
}) })
describe('#getNetworkState', function () { describe('#getNetworkState', function () {
it('should return loading when new', function () { it('should return loading when new', function () {
let networkState = networkController.getNetworkState() const networkState = networkController.getNetworkState()
assert.equal(networkState, 'loading', 'network is loading') assert.equal(networkState, 'loading', 'network is loading')
}) })
}) })
@ -45,14 +45,14 @@ describe('# Network Controller', function () {
describe('#setNetworkState', function () { describe('#setNetworkState', function () {
it('should update the network', function () { it('should update the network', function () {
networkController.setNetworkState(1) networkController.setNetworkState(1)
let networkState = networkController.getNetworkState() const networkState = networkController.getNetworkState()
assert.equal(networkState, 1, 'network is 1') assert.equal(networkState, 1, 'network is 1')
}) })
}) })
describe('#getRpcAddressForType', function () { describe('#getRpcAddressForType', function () {
it('should return the right rpc address', function () { it('should return the right rpc address', function () {
let rpcTarget = networkController.getRpcAddressForType('mainnet') const rpcTarget = networkController.getRpcAddressForType('mainnet')
assert.equal(rpcTarget, 'https://mainnet.infura.io/metamask', 'returns the right rpcAddress') assert.equal(rpcTarget, 'https://mainnet.infura.io/metamask', 'returns the right rpcAddress')
}) })
}) })

@ -320,5 +320,4 @@ describe('Transaction Controller', function () {
}) })
}) })
}) })
}) })

Loading…
Cancel
Save