renamed cryptoUnits to cryptoAtoms for clarity

This commit is contained in:
Josh Harvey 2016-04-05 11:41:16 +01:00
parent e462359299
commit 8d44c1d383
2 changed files with 9 additions and 9 deletions

View file

@ -248,28 +248,28 @@ exports.pollQueries = function pollQueries (session, cb) {
})
}
function _sendCoins (toAddress, cryptoUnits, cryptoCoin, cb) {
function _sendCoins (toAddress, cryptoAtoms, cryptoCoin, cb) {
var cryptoCode = cryptoCoin.unitCode
var walletPlugin = walletPlugins[cryptoCode]
var transactionFee = cachedConfig.exchanges.settings.transactionFee
if (cryptoCode === 'BTC') {
walletPlugin.sendBitcoins(toAddress, cryptoUnits, transactionFee, cb)
walletPlugin.sendBitcoins(toAddress, cryptoAtoms, transactionFee, cb)
} else {
walletPlugin.sendCoins(toAddress, cryptoUnits, cryptoCoin, transactionFee, cb)
walletPlugin.sendCoins(toAddress, cryptoAtoms, cryptoCoin, transactionFee, cb)
}
}
function executeTx (session, tx, authority, cb) {
db.addOutgoingTx(session, tx, function (err, toSend) {
if (err) return cb(err)
var cryptoUnitsToSend = toSend.cryptoUnits
if (cryptoUnitsToSend === 0) {
var cryptoAtomsToSend = toSend.cryptoAtoms
if (cryptoAtomsToSend === 0) {
return cb(null, {statusCode: 204, txId: tx.txId, txHash: null})
}
_sendCoins(tx.toAddress, cryptoUnitsToSend, function (_err, txHash) {
_sendCoins(tx.toAddress, cryptoAtomsToSend, function (_err, txHash) {
var fee = null // Need to fill this out in plugins
if (_err) toSend = {cryptoUnits: new BigNumber(0), fiat: 0}
if (_err) toSend = {cryptoAtoms: new BigNumber(0), fiat: 0}
db.sentCoins(session, tx, authority, toSend, fee, _err, txHash)
if (_err) return cb(_err)

View file

@ -1,5 +1,5 @@
- rethink scale names: is unit satoshi or btc? cryptoAtom, cryptoAtom
- cryptoCoin is record, not code
- specify crypto and fiat for trades
- make sure ticker is in full coins
- rethink scale names: is unit satoshi or btc?
- cryptoCoin is record, not code
- getDeviceRate should return bignumber