diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-29 22:22:55 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2015-01-29 22:22:55 +0800 |
commit | 94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123 (patch) | |
tree | df0b2e41f5dc9e50b99fa45d597199fd71201678 /test/abi.parsers.js | |
parent | e1c0862658ca80d2a4a85bd15eab38b0482fee1b (diff) | |
parent | 8613382869503c6123c3f47772bfdb192f6d3c76 (diff) | |
download | dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar.gz dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar.bz2 dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar.lz dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar.xz dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.tar.zst dexon-94e0e5ab7d8ec9adcd03fedc3abe5cf6444a5123.zip |
Merge branch 'cpp' into cpp2
Conflicts:
example/balance.html
Diffstat (limited to 'test/abi.parsers.js')
-rw-r--r-- | test/abi.parsers.js | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/abi.parsers.js b/test/abi.parsers.js index 19fa1d4cf..12bccf5a5 100644 --- a/test/abi.parsers.js +++ b/test/abi.parsers.js @@ -5,6 +5,7 @@ var clone = function (object) { return JSON.parse(JSON.stringify(object)); }; var description = [{ "name": "test", + "type": "function", "inputs": [{ "name": "a", "type": "uint256" @@ -339,10 +340,12 @@ describe('abi', function() { // given var d = [{ name: "test", + type: "function", inputs: [{ type: "int" }], outputs: [{ type: "int" }] },{ name: "test2", + type: "function", inputs: [{ type: "string" }], outputs: [{ type: "string" }] }]; @@ -775,10 +778,12 @@ describe('abi', function() { // given var d = [{ name: "test", + type: "function", inputs: [{ type: "int" }], outputs: [{ type: "int" }] },{ name: "test2", + type: "function", inputs: [{ type: "string" }], outputs: [{ type: "string" }] }]; @@ -823,6 +828,38 @@ describe('abi', function() { }); + it('should parse 0x value', function () { + + // given + var d = clone(description); + d[0].outputs = [ + { type: 'int' } + ]; + + // when + var parser = abi.outputParser(d); + + // then + assert.equal(parser.test("0x")[0], 0); + + }); + + it('should parse 0x value', function () { + + // given + var d = clone(description); + d[0].outputs = [ + { type: 'uint' } + ]; + + // when + var parser = abi.outputParser(d); + + // then + assert.equal(parser.test("0x")[0], 0); + + }); + }); }); |