diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-19 19:59:29 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-19 19:59:29 +0800 |
commit | af54832d2435ff4116c887effa09e4f276ac970c (patch) | |
tree | d7e47bdf6ba4c6a7ab8cd7a688d8f7249428a132 /test/abi.parsers.js | |
parent | 86b417e83f1f631cd55d16596b458b74601c43e5 (diff) | |
download | dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar.gz dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar.bz2 dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar.lz dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar.xz dexon-af54832d2435ff4116c887effa09e4f276ac970c.tar.zst dexon-af54832d2435ff4116c887effa09e4f276ac970c.zip |
encoding real on input
Diffstat (limited to 'test/abi.parsers.js')
-rw-r--r-- | test/abi.parsers.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/abi.parsers.js b/test/abi.parsers.js index 740d52eca..bbf10bcd3 100644 --- a/test/abi.parsers.js +++ b/test/abi.parsers.js @@ -380,6 +380,46 @@ describe('abi', function() { ); }); + it('should parse input real', function () { + + // given + var d = clone(description); + + d[0].inputs = [ + { type: 'real' } + ]; + + // when + var parser = abi.inputParser(d); + + // then + assert.equal(parser.test([1]), "0000000000000000000000000000000100000000000000000000000000000000"); + assert.equal(parser.test([2.125]), "0000000000000000000000000000000220000000000000000000000000000000"); + assert.equal(parser.test([8.5]), "0000000000000000000000000000000880000000000000000000000000000000"); + assert.equal(parser.test([-1]), "ffffffffffffffffffffffffffffffff00000000000000000000000000000000"); + + }); + + it('should parse input ureal', function () { + + // given + var d = clone(description); + + d[0].inputs = [ + { type: 'ureal' } + ]; + + // when + var parser = abi.inputParser(d); + + // then + assert.equal(parser.test([1]), "0000000000000000000000000000000100000000000000000000000000000000"); + assert.equal(parser.test([2.125]), "0000000000000000000000000000000220000000000000000000000000000000"); + assert.equal(parser.test([8.5]), "0000000000000000000000000000000880000000000000000000000000000000"); + + }); + + }); describe('outputParser', function() { |