diff --git a/test/abi.inputParser.js b/test/abi.inputParser.js index 2ee8776..2f0a4c4 100644 --- a/test/abi.inputParser.js +++ b/test/abi.inputParser.js @@ -227,56 +227,6 @@ describe('abi', function() { }); - it('should parse input hash', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "hash" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"); - - }); - - it('should parse input hash256', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "hash256" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"); - - }); - - - it('should parse input hash160', function() { - // given - var d = clone(description); - - d[0].inputs = [ - { type: "hash160" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"); - }); - it('should parse input address', function () { // given @@ -294,13 +244,13 @@ describe('abi', function() { }); - it('should parse input string', function () { + it('should parse input fixed bytes type', function () { // given var d = clone(description); d[0].inputs = [ - { type: "string" } + { type: "bytes32" } ]; // when @@ -318,14 +268,14 @@ describe('abi', function() { ); }); - it('should parse input int followed by a string', function () { + it('should parse input int followed by a fixed bytes type', function () { // given var d = clone(description); d[0].inputs = [ { type: "int" }, - { type: "string" } + { type: "bytes32" } ]; // when @@ -340,13 +290,13 @@ describe('abi', function() { ); }); - it('should parse input string followed by an int', function () { + it('should parse input fixed bytes type followed by an int', function () { // given var d = clone(description); d[0].inputs = [ - { type: "string" }, + { type: "bytes32" }, { type: "int" } ]; @@ -391,8 +341,8 @@ describe('abi', function() { },{ name: "test2", type: "function", - inputs: [{ type: "string" }], - outputs: [{ type: "string" }] + inputs: [{ type: "bytes32" }], + outputs: [{ type: "bytes32" }] }]; // when diff --git a/test/abi.outputParser.js b/test/abi.outputParser.js index 1ddd9d4..ac02ce1 100644 --- a/test/abi.outputParser.js +++ b/test/abi.outputParser.js @@ -21,13 +21,13 @@ var description = [{ describe('abi', function() { describe('outputParser', function() { - it('should parse output string', function() { + it('should parse output fixed bytes type', function() { // given var d = clone(description); d[0].outputs = [ - { type: "string" } + { type: "bytes32" } ]; // when @@ -181,64 +181,6 @@ describe('abi', function() { assert.equal(parser.test("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0], -16); }); - it('should parse output hash', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'hash' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0], - "0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1" - ); - }); - - it('should parse output hash256', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'hash256' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0], - "0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1" - ); - }); - - it('should parse output hash160', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'hash160' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test("0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0], - "0x000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1" - ); - // TODO shouldnt' the expected hash be shorter? - }); - it('should parse output address', function() { // given @@ -317,14 +259,14 @@ describe('abi', function() { }); - it('should parse multiple output strings', function() { + it('should parse multiple output fixed bytes type', function() { // given var d = clone(description); d[0].outputs = [ - { type: "string" }, - { type: "string" } + { type: "bytes32" }, + { type: "bytes32" } ]; // when @@ -380,8 +322,8 @@ describe('abi', function() { },{ name: "test2", type: "function", - inputs: [{ type: "string" }], - outputs: [{ type: "string" }] + inputs: [{ type: "bytes32" }], + outputs: [{ type: "bytes32" }] }]; // when