diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-17 20:50:07 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-17 20:50:07 +0800 |
commit | 823fb2995b0ff6ebaf257206ad1ecf827b8567b8 (patch) | |
tree | f0f90a275304ccbc77e04577c29558f75b5f3af4 | |
parent | 1e2c1ae98a610d346c9ebe50fa00c4eb08955abd (diff) | |
download | go-tangerine-823fb2995b0ff6ebaf257206ad1ecf827b8567b8.tar.gz go-tangerine-823fb2995b0ff6ebaf257206ad1ecf827b8567b8.tar.zst go-tangerine-823fb2995b0ff6ebaf257206ad1ecf827b8567b8.zip |
tests for parsing output array
-rw-r--r-- | test/abi.parsers.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/test/abi.parsers.js b/test/abi.parsers.js index 8b5d59ef9..740d52eca 100644 --- a/test/abi.parsers.js +++ b/test/abi.parsers.js @@ -716,6 +716,33 @@ describe('abi', function() { }); + it('should parse output array', function () { + + // given + var d = clone(description); + d[0].outputs = [ + { type: 'int[]' } + ]; + + // when + var parser = abi.outputParser(d); + + // then + assert.equal(parser.test("0x" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000000000000000000000000000000000000000000005" + + "0000000000000000000000000000000000000000000000000000000000000006")[0][0], + 5 + ); + assert.equal(parser.test("0x" + + "0000000000000000000000000000000000000000000000000000000000000002" + + "0000000000000000000000000000000000000000000000000000000000000005" + + "0000000000000000000000000000000000000000000000000000000000000006")[0][1], + 6 + ); + + }); + }); }); |