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 BitGo = require('bitgo')
const BN = require('../../../bn') const BN = require('../../../bn')
const E = require('../../../error') const E = require('../../../error')
@ -9,7 +10,8 @@ const userAgent = 'Lamassu-Server/' + pjson.version
const NAME = 'BitGo' const NAME = 'BitGo'
function buildBitgo (account) { 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) { function getWallet (account) {

View file

@ -25,6 +25,15 @@
"secret": true, "secret": true,
"required": true, "required": true,
"value": "" "value": ""
},
{
"code": "environment",
"display": "Environment (prod or test)",
"fieldType": "string",
"secret": false,
"required": false,
"placeholder": "prod",
"value": ""
} }
] ]
} }