diff options
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"); }); |