aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Finlay <somniac@me.com>2016-04-05 06:39:34 +0800
committerDan Finlay <somniac@me.com>2016-04-05 06:39:34 +0800
commit283ac19cc2a0e09f08453a9b73d4af5f1166bf68 (patch)
tree1868d7831077a410c6cad0957eea0fad0348372f
parentc4bf8fcce62967b0a09ab848ab28e8471d584d13 (diff)
parent2d6a82e36d4f4f67f68896a5a189714c15baae9d (diff)
downloadtangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar.gz
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar.bz2
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar.lz
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar.xz
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.tar.zst
tangerine-wallet-browser-283ac19cc2a0e09f08453a9b73d4af5f1166bf68.zip
Merge pull request #90 from MetaMask/IndicateFauceting
Add mayBeFauceting boolean to account object
-rw-r--r--app/scripts/lib/idStore.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/scripts/lib/idStore.js b/app/scripts/lib/idStore.js
index 7fb5a6885..8ac5185db 100644
--- a/app/scripts/lib/idStore.js
+++ b/app/scripts/lib/idStore.js
@@ -9,6 +9,7 @@ const extend = require('xtend')
const createId = require('web3-provider-engine/util/random-id')
const autoFaucet = require('./auto-faucet')
const configManager = require('./config-manager-singleton')
+const DEFAULT_RPC = 'https://rawtestrpc.metamask.io/'
module.exports = IdentityStore
@@ -211,12 +212,28 @@ IdentityStore.prototype._loadIdentities = function(){
name: 'Wallet ' + (i+1),
img: 'QmW6hcwYzXrNkuHrpvo58YeZvbZxUddv69ATSHY3BHpPdd',
address: address,
+ mayBeFauceting: this._mayBeFauceting(i),
}
this._currentState.identities[address] = identity
})
this._didUpdate()
}
+// mayBeFauceting
+// If on testnet, index 0 may be fauceting.
+// The UI will have to check the balance to know.
+// If there is no balance and it mayBeFauceting,
+// then it is in fact fauceting.
+IdentityStore.prototype._mayBeFauceting = function(i) {
+ var config = configManager.getProvider()
+ if (i === 0 &&
+ config.type === 'rpc' &&
+ config.rpcTarget === DEFAULT_RPC) {
+ return true
+ }
+ return false
+}
+
//
// keyStore managment - unlocking + deserialization
//