support bitgo test mode

This commit is contained in:
Josh Harvey 2017-06-11 15:56:49 +03:00
parent 95aaee4037
commit db34c8c8e3
2 changed files with 12 additions and 1 deletions

View file

@ -1,4 +1,5 @@
const BitGo = require('bitgo')
const BN = require('../../../bn')
const E = require('../../../error')
@ -9,7 +10,8 @@ const userAgent = 'Lamassu-Server/' + pjson.version
const NAME = 'BitGo'
function buildBitgo (account) {
return new BitGo.BitGo({accessToken: account.token, env: 'prod', userAgent: userAgent})
const env = account.environment === 'test' ? 'test' : 'prod'
return new BitGo.BitGo({accessToken: account.token, env, userAgent: userAgent})
}
function getWallet (account) {