aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-13 23:13:43 +0800
committerMarek Kotewicz <marek.kotewicz@gmail.com>2015-03-13 23:13:43 +0800
commit60162d919b28549a6fee59f9a08309743c6548fe (patch)
treeedabde6b8c0337644833bd8adcdff30ea7d35e51
parent792c3e7094a086ff679aedf22208be78d44896b0 (diff)
downloaddexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar.gz
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar.bz2
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar.lz
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar.xz
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.tar.zst
dexon-solidity-60162d919b28549a6fee59f9a08309743c6548fe.zip
Squashed 'libjsqrc/ethereumjs/' changes from d509360..eceeda7
eceeda7 gulp cc3e373 Merge pull request #109 from LefterisJP/string_hash_rename 3a22498 string type basically becomes bytes type 760634a Changing abi tests to use fixed bytes type 6554479 Merge pull request #108 from frozeman/apiOverhaul b322378 removed unecessary utils 9a3d320 changed my author url 8516a2f removed uncommented line 1730f21 add version replacement use version.json now 27e5706 bumped version 3614cea bumped version 9c3d1b2 merged develop 2e320ed add versions 08a38b3 removed unecessary open in httpprovidor 5636510 add inputformatter for sha3 50ca903 add build f351e95 removed unecessary log 67ab5ef removed unecessary log git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: eceeda7d0878579cdc6324f3026ae88079c30720
-rw-r--r--abi.inputParser.js66
-rw-r--r--abi.outputParser.js72
-rw-r--r--db.methods.js4
3 files changed, 17 insertions, 125 deletions
diff --git a/abi.inputParser.js b/abi.inputParser.js
index 2ee87761..1d3a869e 100644
--- a/abi.inputParser.js
+++ b/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: "bytes" }
];
// 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: "bytes" }
];
// 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: "bytes" },
{ type: "int" }
];
@@ -391,8 +341,8 @@ describe('abi', function() {
},{
name: "test2",
type: "function",
- inputs: [{ type: "string" }],
- outputs: [{ type: "string" }]
+ inputs: [{ type: "bytes" }],
+ outputs: [{ type: "bytes" }]
}];
// when
diff --git a/abi.outputParser.js b/abi.outputParser.js
index 1ddd9d4f..955c0d5f 100644
--- a/abi.outputParser.js
+++ b/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: "bytes" }
];
// 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: "bytes" },
+ { type: "bytes" }
];
// when
@@ -380,8 +322,8 @@ describe('abi', function() {
},{
name: "test2",
type: "function",
- inputs: [{ type: "string" }],
- outputs: [{ type: "string" }]
+ inputs: [{ type: "bytes" }],
+ outputs: [{ type: "bytes" }]
}];
// when
diff --git a/db.methods.js b/db.methods.js
index 2ad38457..aac8981d 100644
--- a/db.methods.js
+++ b/db.methods.js
@@ -5,8 +5,8 @@ var u = require('./test.utils.js');
describe('web3', function() {
describe('db', function() {
- u.methodExists(web3.db, 'put');
- u.methodExists(web3.db, 'get');
+ u.methodExists(web3.db, 'putHex');
+ u.methodExists(web3.db, 'getHex');
u.methodExists(web3.db, 'putString');
u.methodExists(web3.db, 'getString');
});