diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-17 09:14:40 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-17 09:14:40 +0800 |
commit | b457e88cd0fbc5724cbca68ecebf5e829c65bf98 (patch) | |
tree | b97c0deac182ee29be57481f551733f298fb6137 /test/abi.parsers.js | |
parent | 2d8383d3c8be80dab644fc67c47327872a87f50d (diff) | |
download | go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.gz go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.bz2 go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.lz go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.xz go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.zst go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.zip |
support for int array types[]
Diffstat (limited to 'test/abi.parsers.js')
-rw-r--r-- | test/abi.parsers.js | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/test/abi.parsers.js b/test/abi.parsers.js index ea2e00b13..851d85f77 100644 --- a/test/abi.parsers.js +++ b/test/abi.parsers.js @@ -307,8 +307,14 @@ describe('abi', function() { var parser = abi.inputParser(d); // then - assert.equal(parser.test('hello'), "68656c6c6f000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('world'), "776f726c64000000000000000000000000000000000000000000000000000000"); + assert.equal( + parser.test('hello'), + "000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000" + ); + assert.equal( + parser.test('world'), + "0000000000000000000000000000000000000000000000000000000000000005776f726c64000000000000000000000000000000000000000000000000000000" + ); }); it('should use proper method name', function () { @@ -346,9 +352,34 @@ describe('abi', function() { //then assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test2('hello'), "68656c6c6f000000000000000000000000000000000000000000000000000000"); + assert.equal( + parser.test2('hello'), + "000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000" + ); + + }); + + it('should parse input array of ints', function () { + + // given + var d = clone(description); + + d[0].inputs = [ + { type: "int[]" } + ]; + // when + var parser = abi.inputParser(d); + + // then + assert.equal( + parser.test([5, 6]), + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000000000000000000000000000000000000000000005" + + "0000000000000000000000000000000000000000000000000000000000000006" + ); }); + }); describe('outputParser', function() { |