From 823fb2995b0ff6ebaf257206ad1ecf827b8567b8 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sat, 17 Jan 2015 13:50:07 +0100 Subject: tests for parsing output array --- test/abi.parsers.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) 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 + ); + + }); + }); }); -- cgit