* Added default ETH(infura)

* Code changes regarding review on PR 179 (https://github.com/lamassu/lamassu-server/pull/179)

*  Code changes regarding review on PR 179 (#179)
This commit is contained in:
pedromiguelmiranda 2018-10-03 15:11:19 +01:00 committed by Josh Harvey
parent 52309c53a4
commit 50e78078e3

View file

@ -97,13 +97,16 @@ function plugin (crypto) {
}
function run () {
const ETHEREUM_CRYPTO_CODE ='ETH'
const choices = _.map(c => {
const checked = isInstalledSoftware(c) && isInstalledVolume(c)
return {
name: c.display,
value: c.code,
checked,
disabled: checked && 'Installed'
disabled: c.cryptoCode === ETHEREUM_CRYPTO_CODE
? 'Installed, use Infura option'
: checked && 'Installed'
}
}, cryptos)
@ -117,5 +120,8 @@ function run () {
})
inquirer.prompt(questions)
.then(answers => processCryptos(answers.crypto))
.then(answers => {
answers.crypto.push(coinUtils.getCryptoCurrency(ETHEREUM_CRYPTO_CODE).code)
processCryptos(answers.crypto)
})
}