aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-17 09:14:40 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-01-17 09:14:40 +0800
commitb457e88cd0fbc5724cbca68ecebf5e829c65bf98 (patch)
treeb97c0deac182ee29be57481f551733f298fb6137 /test
parent2d8383d3c8be80dab644fc67c47327872a87f50d (diff)
downloadgo-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.gz
go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.tar.zst
go-tangerine-b457e88cd0fbc5724cbca68ecebf5e829c65bf98.zip
support for int array types[]
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() {