aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/abi.parsers.js37
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() {