File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ const extend = require('xtend')
99const createId = require ( 'web3-provider-engine/util/random-id' )
1010const autoFaucet = require ( './auto-faucet' )
1111const configManager = require ( './config-manager-singleton' )
12+ const DEFAULT_RPC = 'https://rawtestrpc.metamask.io/'
1213
1314
1415module . exports = IdentityStore
@@ -211,12 +212,28 @@ IdentityStore.prototype._loadIdentities = function(){
211212 name : 'Wallet ' + ( i + 1 ) ,
212213 img : 'QmW6hcwYzXrNkuHrpvo58YeZvbZxUddv69ATSHY3BHpPdd' ,
213214 address : address ,
215+ mayBeFauceting : this . _mayBeFauceting ( i ) ,
214216 }
215217 this . _currentState . identities [ address ] = identity
216218 } )
217219 this . _didUpdate ( )
218220}
219221
222+ // mayBeFauceting
223+ // If on testnet, index 0 may be fauceting.
224+ // The UI will have to check the balance to know.
225+ // If there is no balance and it mayBeFauceting,
226+ // then it is in fact fauceting.
227+ IdentityStore . prototype . _mayBeFauceting = function ( i ) {
228+ var config = configManager . getProvider ( )
229+ if ( i === 0 &&
230+ config . type === 'rpc' &&
231+ config . rpcTarget === DEFAULT_RPC ) {
232+ return true
233+ }
234+ return false
235+ }
236+
220237//
221238// keyStore managment - unlocking + deserialization
222239//
You can’t perform that action at this time.
0 commit comments