mirror of
https://github.com/status-im/web3.js.git
synced 2025-02-24 03:58:13 +00:00
merge conflicts
This commit is contained in:
commit
a824f5ad83
@ -40,12 +40,15 @@ var utf8 = require('utf8');
|
|||||||
var unitMap = {
|
var unitMap = {
|
||||||
'wei': '1',
|
'wei': '1',
|
||||||
'kwei': '1000',
|
'kwei': '1000',
|
||||||
'ada': '1000',
|
'Kwei': '1000',
|
||||||
|
'babbage': '1000',
|
||||||
'femtoether': '1000',
|
'femtoether': '1000',
|
||||||
'mwei': '1000000',
|
'mwei': '1000000',
|
||||||
'babbage': '1000000',
|
'Mwei': '1000000',
|
||||||
|
'lovelace': '1000000',
|
||||||
'picoether': '1000000',
|
'picoether': '1000000',
|
||||||
'gwei': '1000000000',
|
'gwei': '1000000000',
|
||||||
|
'Gwei': '1000000000',
|
||||||
'shannon': '1000000000',
|
'shannon': '1000000000',
|
||||||
'nanoether': '1000000000',
|
'nanoether': '1000000000',
|
||||||
'nano': '1000000000',
|
'nano': '1000000000',
|
||||||
@ -58,7 +61,6 @@ var unitMap = {
|
|||||||
'ether': '1000000000000000000',
|
'ether': '1000000000000000000',
|
||||||
'kether': '1000000000000000000000',
|
'kether': '1000000000000000000000',
|
||||||
'grand': '1000000000000000000000',
|
'grand': '1000000000000000000000',
|
||||||
'einstein': '1000000000000000000000',
|
|
||||||
'mether': '1000000000000000000000000',
|
'mether': '1000000000000000000000000',
|
||||||
'gether': '1000000000000000000000000000',
|
'gether': '1000000000000000000000000000',
|
||||||
'tether': '1000000000000000000000000000000'
|
'tether': '1000000000000000000000000000000'
|
||||||
@ -293,13 +295,13 @@ var getValueOfUnit = function (unit) {
|
|||||||
*
|
*
|
||||||
* Possible units are:
|
* Possible units are:
|
||||||
* SI Short SI Full Effigy Other
|
* SI Short SI Full Effigy Other
|
||||||
* - kwei femtoether ada
|
* - kwei femtoether babbage
|
||||||
* - mwei picoether babbage
|
* - mwei picoether lovelace
|
||||||
* - gwei nanoether shannon nano
|
* - gwei nanoether shannon nano
|
||||||
* - -- microether szabo micro
|
* - -- microether szabo micro
|
||||||
* - -- milliether finney milli
|
* - -- milliether finney milli
|
||||||
* - ether -- --
|
* - ether -- --
|
||||||
* - kether einstein grand
|
* - kether -- grand
|
||||||
* - mether
|
* - mether
|
||||||
* - gether
|
* - gether
|
||||||
* - tether
|
* - tether
|
||||||
@ -320,13 +322,14 @@ var fromWei = function(number, unit) {
|
|||||||
*
|
*
|
||||||
* Possible units are:
|
* Possible units are:
|
||||||
* SI Short SI Full Effigy Other
|
* SI Short SI Full Effigy Other
|
||||||
* - kwei femtoether ada
|
* - kwei femtoether babbage
|
||||||
* - mwei picoether babbage
|
* - mwei picoether lovelace
|
||||||
* - gwei nanoether shannon nano
|
* - gwei nanoether shannon nano
|
||||||
* - -- microether szabo micro
|
* - -- microether szabo micro
|
||||||
|
* - -- microether szabo micro
|
||||||
* - -- milliether finney milli
|
* - -- milliether finney milli
|
||||||
* - ether -- --
|
* - ether -- --
|
||||||
* - kether einstein grand
|
* - kether -- grand
|
||||||
* - mether
|
* - mether
|
||||||
* - gether
|
* - gether
|
||||||
* - tether
|
* - tether
|
||||||
|
@ -8,8 +8,14 @@ describe('lib/utils/utils', function () {
|
|||||||
|
|
||||||
assert.equal(utils.toWei(1, 'wei'), '1');
|
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, '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, '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, 'Gwei'), '1000000000');
|
||||||
|
assert.equal(utils.toWei(1, 'shannon'), '1000000000');
|
||||||
assert.equal(utils.toWei(1, 'szabo'), '1000000000000');
|
assert.equal(utils.toWei(1, 'szabo'), '1000000000000');
|
||||||
assert.equal(utils.toWei(1, 'finney'), '1000000000000000');
|
assert.equal(utils.toWei(1, 'finney'), '1000000000000000');
|
||||||
assert.equal(utils.toWei(1, 'ether'), '1000000000000000000');
|
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, 'tether'), '1000000000000000000000000000000');
|
||||||
|
|
||||||
assert.equal(utils.toWei(1, 'kwei'), utils.toWei(1, 'femtoether'));
|
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, 'szabo'), utils.toWei(1, 'microether'));
|
||||||
assert.equal(utils.toWei(1, 'finney'), utils.toWei(1, 'milliether'));
|
assert.equal(utils.toWei(1, 'finney'), utils.toWei(1, 'milliether'));
|
||||||
assert.equal(utils.toWei(1, 'milli'), utils.toWei(1, 'milliether'));
|
assert.equal(utils.toWei(1, 'milli'), utils.toWei(1, 'milliether'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user