diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-16 23:49:50 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-16 23:49:50 +0800 |
commit | adfd7d621d9313c705631c9235b8176f7b14ef22 (patch) | |
tree | 026fae50d6a9a81c9d67b31c135da854f70ad6b8 /abi.parsers.js | |
parent | 46e67c986278519ca9ba3ba2c6535dcc170a847b (diff) | |
download | dexon-solidity-adfd7d621d9313c705631c9235b8176f7b14ef22.tar.gz dexon-solidity-adfd7d621d9313c705631c9235b8176f7b14ef22.tar.zst dexon-solidity-adfd7d621d9313c705631c9235b8176f7b14ef22.zip |
Squashed 'libjsqrc/ethereumjs/' changes from 2c36d5f..e94da80
e94da80 default padding set to 32, separated to one variable
a1c0bb6 fixed checking first bit for parsing int output
774e9d2 abi.js rounds down floating point input
9a264a4 updated bower.json && package.json version, added bignumber.js to bower dependencies
0172939 fixed #28 and other small node.js issues
git-subtree-dir: libjsqrc/ethereumjs
git-subtree-split: e94da808cb2a9f0493b42e5e572f6aed78de5ee3
Diffstat (limited to 'abi.parsers.js')
-rw-r--r-- | abi.parsers.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/abi.parsers.js b/abi.parsers.js index 9d255e7a..ea2e00b1 100644 --- a/abi.parsers.js +++ b/abi.parsers.js @@ -43,6 +43,11 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); + }); @@ -69,6 +74,10 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); }); @@ -95,6 +104,10 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); }); @@ -124,6 +137,10 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); }); it('should parse input int128', function() { @@ -152,6 +169,10 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); }); @@ -181,6 +202,10 @@ describe('abi', function() { parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" ); + assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); + assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); + assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); }); |