From 8d44c1d383273024a6183de67877308784bb9def Mon Sep 17 00:00:00 2001 From: Josh Harvey Date: Tue, 5 Apr 2016 11:41:16 +0100 Subject: [PATCH] renamed cryptoUnits to cryptoAtoms for clarity --- lib/plugins.js | 14 +++++++------- todo.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/plugins.js b/lib/plugins.js index 53fa3a91..a04e7fd2 100644 --- a/lib/plugins.js +++ b/lib/plugins.js @@ -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) diff --git a/todo.txt b/todo.txt index d4a1eb1b..7a9f9bc1 100644 --- a/todo.txt +++ b/todo.txt @@ -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