merge conflicts

This commit is contained in:
Alexandre Van de Sande 2016-02-25 11:13:34 -03:00
commit a824f5ad83
2 changed files with 18 additions and 11 deletions

View File

@ -40,12 +40,15 @@ var utf8 = require('utf8');
var unitMap = {
'wei': '1',
'kwei': '1000',
'ada': '1000',
'Kwei': '1000',
'babbage': '1000',
'femtoether': '1000',
'mwei': '1000000',
'babbage': '1000000',
'Mwei': '1000000',
'lovelace': '1000000',
'picoether': '1000000',
'gwei': '1000000000',
'Gwei': '1000000000',
'shannon': '1000000000',
'nanoether': '1000000000',
'nano': '1000000000',
@ -58,7 +61,6 @@ var unitMap = {
'ether': '1000000000000000000',
'kether': '1000000000000000000000',
'grand': '1000000000000000000000',
'einstein': '1000000000000000000000',
'mether': '1000000000000000000000000',
'gether': '1000000000000000000000000000',
'tether': '1000000000000000000000000000000'
@ -293,13 +295,13 @@ var getValueOfUnit = function (unit) {
*
* Possible units are:
* SI Short SI Full Effigy Other
* - kwei femtoether ada
* - mwei picoether babbage
* - kwei femtoether babbage
* - mwei picoether lovelace
* - gwei nanoether shannon nano
* - -- microether szabo micro
* - -- milliether finney milli
* - ether -- --
* - kether einstein grand
* - kether -- grand
* - mether
* - gether
* - tether
@ -320,13 +322,14 @@ var fromWei = function(number, unit) {
*
* Possible units are:
* SI Short SI Full Effigy Other
* - kwei femtoether ada
* - mwei picoether babbage
* - kwei femtoether babbage
* - mwei picoether lovelace
* - gwei nanoether shannon nano
* - -- microether szabo micro
* - -- microether szabo micro
* - -- milliether finney milli
* - ether -- --
* - kether einstein grand
* - kether -- grand
* - mether
* - gether
* - tether

View File

@ -8,8 +8,14 @@ describe('lib/utils/utils', function () {
assert.equal(utils.toWei(1, 'wei'), '1');
assert.equal(utils.toWei(1, 'kwei'), '1000');
assert.equal(utils.toWei(1, 'Kwei'), '1000');
assert.equal(utils.toWei(1, 'babbage'), '1000');
assert.equal(utils.toWei(1, 'mwei'), '1000000');
assert.equal(utils.toWei(1, 'Mwei'), '1000000');
assert.equal(utils.toWei(1, 'lovelace'), '1000000');
assert.equal(utils.toWei(1, 'gwei'), '1000000000');
assert.equal(utils.toWei(1, 'Gwei'), '1000000000');
assert.equal(utils.toWei(1, 'shannon'), '1000000000');
assert.equal(utils.toWei(1, 'szabo'), '1000000000000');
assert.equal(utils.toWei(1, 'finney'), '1000000000000000');
assert.equal(utils.toWei(1, 'ether'), '1000000000000000000');
@ -20,8 +26,6 @@ describe('lib/utils/utils', function () {
assert.equal(utils.toWei(1, 'tether'), '1000000000000000000000000000000');
assert.equal(utils.toWei(1, 'kwei'), utils.toWei(1, 'femtoether'));
assert.equal(utils.toWei(1, 'babbage'), utils.toWei(1, 'picoether'));
assert.equal(utils.toWei(1, 'shannon'), utils.toWei(1, 'nanoether'));
assert.equal(utils.toWei(1, 'szabo'), utils.toWei(1, 'microether'));
assert.equal(utils.toWei(1, 'finney'), utils.toWei(1, 'milliether'));
assert.equal(utils.toWei(1, 'milli'), utils.toWei(1, 'milliether'));